Repository navigation
Record staged driver tree versions in version-info for Accelerated AMIs - #2830
Conversation
20c0475 to
00f04b5
Compare
mselim00
left a comment
There was a problem hiding this comment.
thanks !just a few comments
| [ -L "$VERSION_PATH" ] && continue | ||
| VERSION=$(basename "$VERSION_PATH") | ||
| RPM_DIRS="" | ||
| for DIR in "$VERSION_PATH/.rpms" "$VERSION_PATH/flavors/open/.rpms"; do |
There was a problem hiding this comment.
we should also be looking at the RPMs for all favors, not just open
There was a problem hiding this comment.
True, but I am less strict about this though.
- The previous version-info only had proprietary kernel modules (last flavor installed).
- GRID does not have an RPM since it comes from a .run file.
- Since the purpose of this is version consistency checks and release notes, using open alone is good enough. We already validate that every userspace program and kernel module is of the same version in
validate.sh
If adding more flavors adds more nesting to the previously flat json, I am good to just use open.
There was a problem hiding this comment.
Aarushi and I chatted a bit on this offline.
I agree, based on the current state of the provisioners, it doesn’t actually add much value. however, it is technically more correct to also include the proprietary RPM (though I agree that it is net new to have both) and lets the generated JSON be used to provide additional validation against future potential code changes that may allow the proprietary package to be downgraded or even dropped entirely. the conclusion of our chat was basically that it’s a nice to have, we can merge this without that if things get unnecessarily messy
There was a problem hiding this comment.
Added both flavors of RPMS. The output now will be similar to :
"nvidia": {
"lts": {
....
"kmod-nvidia-latest-dkms": "580.178.04-1.amzn2023",
"kmod-nvidia-open-dkms": "580.178.04-1.amzn2023",
....
},
"pb": {
....
"kmod-nvidia-latest-dkms": "595.91.07-1.amzn2023",
"kmod-nvidia-open-dkms": "595.91.07-1.amzn2023",
....
}
}
| VERSION_JSON=$(echo "$RPMS" | xargs sudo rpm --query --package \ | ||
| --queryformat '\{"%{NAME}": "%{VERSION}-%{RELEASE}"\}\n' | jq --slurp --sort-keys 'add') |
There was a problem hiding this comment.
I'm guessing this doesn't work for proprietary? we might want to just try parsing this information from the RPM name, they're generally named according to a <name>-<version>-<release>.<architecture>.rpm convention
| sudo rpm --query --all --queryformat '\{"%{NAME}": "%{VERSION}-%{RELEASE}"\}\n' | jq --slurp --sort-keys 'add | {packages:(.)}' > $OUTPUT_FILE | ||
|
|
||
| # nvidia drivers | ||
| if [ -d /opt/nvidia ]; then |
There was a problem hiding this comment.
NIT: In the install provisioner we are pretty explicit with our usage of the terms lts and pb, so we can be explicit about paths her as well.
The check on whether this is an nvidia AMI across other provisioners is
if [ "$ENABLE_ACCELERATOR" != "nvidia" ]; then
// return or break early
fi
There was a problem hiding this comment.
Addressed the second part in the revision. As for being explicit about the lts and pb paths, I wanted to keep the check dynamic so that if we run into a similar issue like this where we have to add or change another driver version, it will still be compatible.
00f04b5 to
61d8677
Compare
61d8677 to
2136d4a
Compare
mselim00
left a comment
There was a problem hiding this comment.
lgtm, thanks for the revision!
Description of changes:
/opt/nvidia/<tree>/.rpms, not installed, so they never enter the rpm database because of whichrpm --query --allnever sees them and are missing from version-info.json. This made the release consistency check report them as removed and hid them from release notes.nvidia_driver_treeskey so the release consistency check and release notes can see every driver version present in the AMI.packagesremains rpm-database-only. Trees are discovered dynamically and not hard-coded, so is scalable to work with more driver versions with no changes.Output shape
{ "packages": { ... }, "nvidia_driver_trees": { "lts": { "nvidia-driver": "580.178.04-1.amzn2023", ... }, "pb": { "nvidia-driver": "595.91.07-1.amzn2023", ... } } }Testing Done
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
See this guide for recommended testing for PRs. Some tests may not apply. Completing tests and providing additional validation steps are not required, but it is recommended and may reduce review time and time to merge.