This guide provides information for developers working on NodeWright packages, including validation steps to run before committing changes.
Before committing your changes, you should run the following validations to ensure your code meets the repository standards:
Source files (*.py, *.sh, *.yaml/*.yml, and Dockerfiles) must carry the full
Apache 2.0 license header (see .github/license-header.tmpl). Markdown and other docs
do not need a header. Add or refresh headers with:
make license-fmtThis runs google/addlicense via go run
(needs a local Go toolchain); it is idempotent and never duplicates a header. Verify
headers without modifying files (this is what CI runs) using:
make license-checkThe License Headers workflow gates this on every PR, and also fails if a file ends up
with a duplicated header.
All packages must have a valid config.json file that complies with the skyhook agent schemas v1.
Important:
- Standalone packages (those not inheriting from another skyhook-packages image) must have a
config.jsonfile - Packages that inherit from another skyhook-packages image (e.g.,
nvidia-tunedinherits fromtuned) can omitconfig.jsonif they don't need their own configuration
To validate config.json files locally, use the published skyhook-agent image from ghcr.io. The skyhook-agent source code is available in the NVIDIA/skyhook repository.
Prerequisites:
- Docker installed and running
Quick Start - Using Makefile:
The easiest way to validate packages is using the makefile targets:
# For standalone packages (not inherited)
make validate-standalone PACKAGE=<package-name>
# For inherited packages (inherits from skyhook-packages)
make validate-inherited PACKAGE=<package-name>Examples:
# Validate a standalone package
make validate-standalone PACKAGE=shellscript
# Validate an inherited package
make validate-inherited PACKAGE=nvidia-tunedManual Validation:
Important for Inherited Packages:
If your package inherits from another package image (i.e., your Dockerfile has FROM ghcr.io/nvidia/nodewright-packages/..., or the legacy FROM ghcr.io/nvidia/skyhook-packages/... in older versions), you must build the container first before validating. This is because the validation needs access to all files that will be in the final container, including those from the base image.
For inherited packages, build first:
# Build your package container
docker build -t my-package:test <package-name>
# Extract /skyhook-package from the built container
docker create --name temp-extract my-package:test
docker cp temp-extract:/skyhook-package /tmp/extracted-package
docker rm temp-extract
# Validate using the extracted package
docker run --rm \
--entrypoint python \
-v /tmp/extracted-package:/skyhook-package:ro \
-v $(pwd)/scripts/validate.py:/tmp/validate.py:ro \
ghcr.io/nvidia/skyhook/agent:latest \
/tmp/validate.py /skyhook-package/config.json
# Cleanup
rm -rf /tmp/extracted-packageFor standalone packages (not inherited), validate directly:
Validate a single config.json file:
docker run --rm \
--entrypoint python \
-v $(pwd):/workspace \
-w /workspace \
ghcr.io/nvidia/skyhook/agent:latest \
/workspace/scripts/validate.py /workspace/<package-name>/config.jsonExample - Validate shellscript package:
docker run --rm \
--entrypoint python \
-v $(pwd):/workspace \
-w /workspace \
ghcr.io/nvidia/skyhook/agent:latest \
/workspace/scripts/validate.py /workspace/shellscript/config.jsonValidate all config.json files in the repository:
# Find all config.json files and validate each
for config in */config.json; do
echo "Validating $config..."
docker run --rm \
--entrypoint python \
-v $(pwd):/workspace \
-w /workspace \
ghcr.io/nvidia/skyhook/agent:latest \
/workspace/scripts/validate.py "/workspace/$config" || exit 1
doneAll commits must use Conventional Commits format with the package name as scope:
feat(shellscript): Add support for upgrade stagefix(tuning): Post-interrupt check for containerd changes did not allow infinity settingdocs(general/ci): Update the main README.md for CI workflow
Every commit must be both signed off (-s, the DCO) and cryptographically signed (-S):
git commit -s -S -m "feat(shellscript): your message"The Commit Requirements workflow comments on any pull request with a commit missing either one. One-time signing setup and how to fix existing commits are in CONTRIBUTING.md.
The suite is Docker-based: each test copies a package into a temporary
directory, bind-mounts it into a throwaway container, and runs a lifecycle
script inside it. A working Docker (or Podman) daemon is required. Both targets
create a venv/ on first run.
# Every package, in parallel
make test
# A single package (test dirs use underscores: nvidia-setup -> nvidia_setup)
make test-package PACKAGE=nvidia-setuptests/helpers/ holds the shared harness plus its own tests. Run those when you
change the harness itself (this target creates the venv/ too, so it works on a
fresh checkout):
make test-harnessA package may declare a prebuilt test base image
(tests/integration/<pkg>/test-base/Dockerfile) so expensive setup happens once
per OS at image-build time instead of once per test. The test and
test-package targets build these automatically; build them explicitly with:
make test-base-images PACKAGE=nvidia-tuned # add NO_CACHE=1 to force a rebuildThese images are local-only and are never pushed to or pulled from a registry.
The harness bind-mounts a temporary directory into each container, and Docker
Desktop and colima share only certain host paths with the daemon's VM. The
default macOS TMPDIR (/var/folders/...) is usually not one of them. When it
is not shared, the mount silently comes up empty and every test fails with
Script ... not found in container, which does not point at the real cause.
Point TMPDIR at a shared path first:
export TMPDIR="$HOME/.cache/skyhook-tests"
mkdir -p "$TMPDIR"
make testThe CI pipeline automatically runs validations:
- PR Builds: Validates
config.jsonfiles that were changed in the PR - Tag Builds: Always validates
config.jsonfiles before building containers - Inherited Packages: For packages that inherit from other skyhook-packages images, the container is built first, then validation runs against the built container to ensure all files (including those from the base image) are available
- Build Blocking: If validation fails, the container build is blocked
Dockerfile: Required for all packagesconfig.json: Required unless the package inherits from another skyhook-packages imageREADME.md: Recommended for documentation
- Must comply with skyhook agent schemas v1
- Must include valid
schema_version,package_name, andpackage_version package_versionmust follow Semantic Versioning
- If your package inherits from another package image, the
FROMline must containnodewright-packagesin the image path. The tooling also accepts the formerskyhook-packagesname so that older versions still build; see Package Image Locations. - Example:
FROM ghcr.io/nvidia/nodewright-packages/tuned:${TUNED_VERSION}
This error indicates the script is not running in the skyhook-agent container. Make sure you're using docker run with the skyhook-agent image.
If your package inherits from another skyhook-packages image and validation fails with "Step files did not exist", you need to build the container first before validating. The validation script needs access to all files that will be in the final container, including those from the base image. See the "Important for Inherited Packages" section above for instructions.
Check that:
- The path to
config.jsonis correct - The file exists in the package directory
- The volume mount path is correct (should be
/workspace/<package-name>/config.json)
This means:
- Your package doesn't have a
config.jsonfile, AND - Your Dockerfile doesn't inherit from another skyhook-packages image
Either:
- Add a
config.jsonfile to your package, OR - Update your Dockerfile to inherit from a package image (e.g.,
FROM ghcr.io/nvidia/nodewright-packages/<package-name>:<version>)
- Package Lifecycle Documentation - Comprehensive guide to package lifecycle stages
- Contributing Guide - General contribution guidelines
- Main README - Repository overview and package documentation
- NodeWright Agent Schemas - Official schema documentation