-
Notifications
You must be signed in to change notification settings - Fork 129
manifest.yaml: Add content_manifest folder to add <nvr>.json for build info #670
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -164,6 +164,29 @@ postprocess: | |
| # NB: we don't use -f here so we break when this is no longer needed | ||
| rm -v /etc/iscsi/initiatorname.iscsi | ||
|
|
||
| # Add content_manifests dir to have json files for build info | ||
| # See https://issues.redhat.com/browse/GRPA-3731 | ||
| - | | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| REPOS=`jq .repos /usr/share/rpm-ostree/treefile.json` | ||
| ARCH=`jq .basearch /usr/share/rpm-ostree/treefile.json | tr -d '"'` | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| . /etc/os-release | ||
| mkdir -p /usr/share/buildinfo/content_manifests && cd "$_" && touch $ID-$OSTREE_VERSION.json | ||
| # Make an empty json and add all the relevant fields | ||
| echo "$(var=$REPOS; jq --argjson repos "$var" '. += | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't entirely follow the 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. 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.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.yaml
repo_mapping:
rhel-8-baseos:
name: rhel-8-for-$ARCH-baseos-eus-rpms__8_DOT_4
rhel-8-appstream:
name: rhel-8-for-$ARCH-appstream-eus-rpms__8_DOT_4
...(This would live in the And then
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 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
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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:
@gursewak1997 if you have any additional questions/concerns, please let us know |
||
| { | ||
| "metadata": { | ||
| "icm_version": 1, | ||
| "icm_spec": "https://raw.githubusercontent.com/containerbuildsystem/atomic-reactor/master/atomic_reactor/schemas/content_manifest.json", | ||
| "image_layer_index": 1 | ||
| }, | ||
| "content_sets": $repos, | ||
| "image_contents": [] | ||
| }' $ID-$OSTREE_VERSION.json)" > $ID-$OSTREE_VERSION.json | ||
|
|
||
| etc-group-members: | ||
| - wheel | ||
| - sudo | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # This file is part of systemd. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From #670 (comment) it seems like we don't need this.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| # | ||
| # systemd is free software; you can redistribute it and/or modify it | ||
| # under the terms of the GNU Lesser General Public License as published by | ||
| # the Free Software Foundation; either version 2.1 of the License, or | ||
| # (at your option) any later version. | ||
|
|
||
| # See tmpfiles.d(5) for details | ||
|
|
||
| L /var/roothome/buildinfo - - - - /usr/share/buildinfo | ||
Uh oh!
There was an error while loading. Please reload this page.