Skip to content

feat(nvidia): record nvidia package contents - #2865

Merged
lawraa merged 2 commits into
awslabs:mainfrom
lawraa:nvidia-tree-manifest
Nov 3, 2026
Merged

lawraa merged 2 commits into
awslabs:mainfrom
lawraa:nvidia-tree-manifest

Conversation

@lawraa

@lawraa lawraa commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Issue #, if available:

Description of changes:

  • generate-version-info.sh writes nvidia-package-contents.json: for each NVIDIA driver in the AMI, its version, and for each of its rpms the version, files.
  • Generated <ami_name>-nvidia-package-contents.json
  • Non-NVIDIA builds write {}.
  • To help streamline our release process.

Example nvidia-package-contents.json (trimmed to one package and one kmod):

{
  "lts": {
    "driver_version": "580.178.04",
    "packages": {
      "nvidia-persistenced": {
        "version": "580.178.04",
        "files": [
          "/usr/lib/.build-id",
          "/usr/lib/.build-id/e3",
          "/usr/lib/.build-id/e3/34cc7b05850a440c15910224e12ca286d02179",
          "/usr/lib/systemd/system/nvidia-persistenced.service"
        ],
        "scripts": "preinstall scriptlet (using /bin/sh):\n..."
      }
    },
    "kmods": {
      "kmod-nvidia-open-dkms": {
        "version": "580.178.04",
        "files": [],
        "scripts": "postinstall scriptlet (using /bin/sh):\ndkms add -m nvidia -v 580.178.04 -q --rpm_safe_upgrade || :"
      }
    }
  }
}

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Testing Done

  • make lint-code and packer validate (standard and enable_accelerator=nvidia)
  • Ran the script on drivers staged from the real NVIDIA rpms (580.178.04, 595.91.07) to verify the sample json file
  • Verify standard AMI writes {}

@lawraa
lawraa requested a review from a team as a code owner October 23, 2026 17:36
@lawraa
lawraa requested review from kummatty and mselim00 and removed request for kummatty October 26, 2026 17:39
@lawraa lawraa changed the title feat(nvidia): record rpms staged in each nvidia driver tree feat(nvidia): record rpms staged in nvidia driver Oct 29, 2026
@lawraa
lawraa force-pushed the nvidia-tree-manifest branch from c15efdc to b50e54c Compare October 30, 2026 21:13
@lawraa lawraa changed the title feat(nvidia): record rpms staged in nvidia driver feat(nvidia): record nvidia package contents Oct 30, 2026
@lawraa
lawraa requested a balanced review from Copilot November 2, 2026 19:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@lawraa
lawraa requested a review from kummatty November 2, 2026 19:15
PACKAGE_VERSION=$(sudo rpm --query --package --queryformat '%{VERSION}' "$RPM")
SCRIPTS=$(sudo rpm --query --package --scripts --triggers --filetriggers "$RPM")
# the file list goes through stdin because it can be too long for an argument
echo "$(sudo rpm --query --package --queryformat '[%{FILENAMES}\n]' "$RPM" | grep -v '^/usr/src/' \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't really care about all the files. We do explicitly copy out all the files within /usr/bin, /usr/lib64 and /usr/share during out boot.
So its only files outside these (and /usr/src), that we care about. Nit, In case the json can be made smaller ( i would assume most files to be in /usr/lib64)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review, done in f359bf9, the file now leaves out /usr/bin, /usr/lib64, /usr/share and /usr/src.

@lawraa
lawraa removed the request for review from mselim00 November 2, 2026 22:44
@lawraa
lawraa merged commit c36ece9 into awslabs:main Nov 3, 2026
2 checks passed
@lawraa
lawraa deleted the nvidia-tree-manifest branch November 11, 2026 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants