Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
manifest.yaml: Add content_manifest folder to add <nvr>.json for build info #670
manifest.yaml: Add content_manifest folder to add <nvr>.json for build info #670
Changes from all commits
7550f7f
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jq -r
will print the string without quotes. Or you should be be able to just use$(arch)
for this.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't entirely follow the
jq
syntax here, though one thing to note is that the repo names need to be translated to those in https://access.redhat.com/security/data/metrics/repository-to-cpe.json which I think is missing here.The actual set of repos we use doesn't really change that often, so for this first iteration, we could just hardcode the fact that e.g.
rhel-8-baseos
maps torhel-8-for-$ARCH-baseos-rpms
,rhel-8-appstream
torhel-8-for-$ARCH-appstream-rpms
, etc... and error out if we get a repo name we don't know.Maybe cleaner eventually is to make that mapping part of the repo files themselves and add a treefile option to teach rpm-ostree to extract it and generate the JSON file and potentially even validate against https://access.redhat.com/security/data/metrics/repository-to-cpe.json.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mapping the repo names to their pulp repo IDs (ie, "[rhel-8-baseos]" to "[rhel-8-for-x86_64-baseos-eus-rpms__8_DOT_4]") would be a bit more complex task to put in postprocess so we decided to not do that here. I have just added the given repo names for now so that we can access them when mapping them to repository-to-cpe.json
So far, we are just landing the changes to create the relevant DIR/JSON file and symlinking it to /root.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had a chat with @gursewak1997 about this. I think in the end doing this in a postprocess script is probably not the right approach. We could hardcode equivalencies here, though the second we change the repo definition files in the internal redhat-coreos repo, it'll become incorrect data. Because of this, I think this data belongs best sitting alongside the repo files.
Apart from the rpm-ostree suggestion in the comment above, another easier option is a YAML file similar to the official
content_sets.yml
currently in use (internal example):(This would live in the
redhat-coreos
repo so it could be maintained atomically with the repo definitions and would be similarly copied into the workdir before builds.)And then
cosa build
would check for the existence of that file and auto-generate the JSON file to inject in the OS.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding was that Gursewak was going to work on the tooling to generate the
<nvr>.json
file and we would handle the problem of the repo names separately. The last working idea was just to rename all the repos to match what is in therepository-to-cpe.json
file after the tooling was in place.The YAML mapping file would also work; either way we are going to incur some amount of manual cost to maintain that the repo names are valid according to
repository-to-cpe.json
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I spoke with @jlebon today and we discussed various approaches to this, but ultimately settled on the proposal that Jonathan made in his last comment:
repository-to-cpe.json
baseurl
so we can detect when that changescosa build
that can consume the mapping YAML doc and produce the<nvr>.json
fileopenshift/release
that enforces changing the mapping YAML doc when changing the repo files@gursewak1997 if you have any additional questions/concerns, please let us know
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From #670 (comment) it seems like we don't need this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True but @miabbott suggested on going through with the creation of .conf file and symlinking the JSON file to /roothome.