Skip to content

ci: move ubuntu-latest jobs onto linux-amd64-cpu4 - #1580

Merged
roivanov merged 13 commits into
NVIDIA:mainfrom
roivanov:ci/codeql-cpu8
Oct 30, 2026
Merged

roivanov merged 13 commits into
NVIDIA:mainfrom
roivanov:ci/codeql-cpu8

Conversation

@roivanov

@roivanov roivanov commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fixes #1518. Move the GitHub-hosted ubuntu-latest jobs onto linux-amd64-cpu4 (m7i.xlarge, 4 vCPU / 16 GiB), the same size as ubuntu-latest. Tile test jobs in cutile-rs.yml already run on linux-amd64-cpu16 and stay there. book.yml's deploy job stays on ubuntu-latest, because actions/deploy-pages publishes GitHub Pages from a GitHub-hosted runner.

Supersedes #1377. That draft was closed; this one is opened from roivanov/cuda-rust.

Problem

ubuntu-latest is 4 vCPU / 16 GB. On this public repository those minutes are free, and that size is the whole free pool. A larger GitHub-hosted runner is billed here too. nv-cpu-general is the same class of machine at the EC2 rate, and this repository already has that group for Tile CI.

Rust CodeQL is the long job. On main push 6d47ae4 it took 38m 31s (run); the baseline on ubuntu-latest was 42m 51s (job). On that same push, examples-compile took 9m 39s and clippy 5m 1s. An 8-core run left the Rust extract at about 35 minutes: the extractor loads each Cargo workspace through rust-analyzer with one worker thread. This pull request keeps every moved job on linux-amd64-cpu4.

Security

ubuntu-latest runs a pull_request workflow on its own, including one opened from outside NVIDIA. nv-cpu-general does not. Only an NVIDIA employee can start a job on these runners. An outside pull request runs only after an employee has checked that it is legitimate and approved it through copy-pr-bot.

Each job gets its own VM, destroyed when the job ends. Inbound network access is blocked. The moved workflows trigger on push to main and to pull-request/[0-9]+, which is what cutile-rs.yml already does. copy-pr-bot is already enabled (.github/copy-pr-bot.yaml). Draft pull requests do not auto-sync.

Cost

NVIDIA/cuda-rust is public. Standard ubuntu-latest minutes are free. GitHub larger runners are billed on public repositories too. nv-cpu-general is self-hosted EC2: GitHub does not meter it. The bill is the instance.

Rates are list price. GitHub rounds each job up to the next minute. EC2 is us-east-1 Linux on-demand; the runner group's region and any enterprise discount are not in the runner docs. The 150 GiB volume on these labels is extra and small next to the instance.

6d47ae4 ran every ubuntu-latest job this move takes: 53 jobs, 93.1 minutes of runner time, 125 billed minutes. book.yml deploy is left out of that total.

Runner Machine $/min This push
ubuntu-latest (this repo, public) 4 vCPU / 16 GB $0 $0
GitHub larger Linux 4-core 4 vCPU / 16 GB $0.012 $1.50
linux-amd64-cpu4 (this PR) m7i.xlarge, 4 vCPU / 16 GiB $0.00336 $0.42

The Rust CodeQL job, measured in rust:1.98.0-bookworm on linux-amd64-cpu8, was 36 billed minutes (run): about $0.24 on cpu8, about $0.12 on cpu4 if that duration holds. Installing rustup on the 8-core VM took 35m 12s (run). The container run took the same 35 minutes.

Changes

  • runs-on: linux-amd64-cpu4 for the jobs that were on ubuntu-latest: CI's callees (fmt, clippy, unit-tests, cargo-deny), docs, examples-compile, codeql, book build, status-guard, naming-guard, ci-status, and the changes job in cutile-rs.yml.

  • Drop pull_request. Trigger on push to main and pull-request/[0-9]+.

  • Jobs that call cargo, rustfmt, or the CodeQL Rust extractor run in rust:1.98.0-bookworm. That matches the root rust-toolchain.toml pin. The Oxide nightly still comes from cuda-oxide/rust-toolchain.toml when the job enters that tree. The nv-cpu-general image has no rustup, and a missing rustup makes the Rust extractor exit 0 with an empty database. The Rust leg fails if rustup show active-toolchain cannot see the root pin.

  • CUDA jobs (clippy, docs, examples-compile, and the cuda.h unit tests) run in nvidia/cuda:13.1.1-devel-ubuntu24.04. The toolkit installer needs lsb_release and an Ubuntu apt repo, so it fails in rust:bookworm. The devel image already has the toolkit. Container steps use bash; the default shell is dash, which rejects set -o pipefail.

  • The CUDA jobs call .github/actions/setup-cuda-container with the $/ form, which loads the action from the workflow's own commit before checkout. It installs git first (the CUDA image has none), so checkout gets a real clone, then marks the workspace safe for git and installs a pinned, checksum-verified rustup-init. examples-compile also installs python3 for sync-example-locks.sh.

  • book.yml deploy stays on ubuntu-latest and runs only for refs/heads/main, so a mirror push cannot publish the site.

  • Tile test jobs in cutile-rs.yml stay on linux-amd64-cpu16.

  • Path-filtered workflows (ci, docs, examples-compile, codeql, book, naming-guard) no longer use a workflow-level paths: filter. copy-pr-bot creates pull-request/<n> at an existing SHA, so GitHub often sees no changed files and would skip the run. Each has a changes job (dorny/paths-filter against main, as cutile-rs.yml does); the jobs run when it matches, when no diff is detected, when the event is not a push, or when the gate itself fails.

  • The intrinsic ABI ledger check compares against the merge base with origin/main on pull-request/<n> pushes, not HEAD^, so an earlier commit of a multi-commit PR cannot hide a breaking change.

  • CodeQL uploads to refs/pull/<n>/head with the pushed SHA on mirror pushes, so results reach the pull request's code scanning alerts.

  • cuda-oxide/scripts/check-ci-image-pins.sh (run in the toolchain-pin-parity job and just check-guards) fails if a workflow's rust:<version> image no longer matches the root rust-toolchain.toml.

Result

Container run on linux-amd64-cpu8: Rust analysis 35m 1s. rustc 1.98.0 (88d9e12ae 2026-08-18), active toolchain overridden by the root rust-toolchain.toml. 1,391 files extracted without error, 190 with errors, 1,580 scanned. Analyze (actions) passed in the same image.

Testing

Workflow-only change. just check and example smoketests do not apply.

Post-PR TODOs

  • Reorganize the workflows so we build the container image once, push it to ephemeral storage, and reuse it across jobs.

Checklist

  • All commits signed off (git commit -s)
  • SPDX headers on new source files

Questions about the review? Ping us in #contributors on Discord.

@roivanov
roivanov marked this pull request as ready for review October 20, 2026 21:56
@roivanov

Copy link
Copy Markdown
Collaborator Author

@cryos @assignUser please review. I re-created PR from my fork and merged latest main

@assignUser

Copy link
Copy Markdown
Contributor

A local action is loaded from the workspace, so it cannot be the first step.

Actually there is a new syntax where you start the path with $/path/to/action instead of just a file path. This causes the action to be checked out prior to the actual workflow running, as if it was an external action. This allows it to run without a checkout. I have used this here: https://github.com/NVIDIA/cuda-rust/pull/1607/changes/9ab6e688d1e276295732cf728e91b8e04ebb656c..8454bb6cf50956f90df8043e41901b1b948856fd

@roivanov

Copy link
Copy Markdown
Collaborator Author

A local action is loaded from the workspace, so it cannot be the first step.

Actually there is a new syntax where you start the path with $/path/to/action instead of just a file path. This causes the action to be checked out prior to the actual workflow running, as if it was an external action. This allows it to run without a checkout. I have used this here: https://github.com/NVIDIA/cuda-rust/pull/1607/changes/9ab6e688d1e276295732cf728e91b8e04ebb656c..8454bb6cf50956f90df8043e41901b1b948856fd

It worked because we have git checkout before each call. But let me check this new feature!

@assignUser

assignUser commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Yes, but with this you can install git first and get a proper git checkout instead of just the archive from the api fallback!

@roivanov
roivanov force-pushed the ci/codeql-cpu8 branch 3 times, most recently from deb008a to dc0de9b Compare October 23, 2026 17:41
@roivanov

Copy link
Copy Markdown
Collaborator Author

please take another look @assignUser

@roivanov
roivanov marked this pull request as draft October 23, 2026 21:22
@copy-pr-bot

copy-pr-bot Bot commented Oct 26, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@NVIDIA NVIDIA deleted a comment from copy-pr-bot Bot Oct 26, 2026
@roivanov
roivanov marked this pull request as ready for review October 26, 2026 19:18
@roivanov

Copy link
Copy Markdown
Collaborator Author

/ok to test 3f105a2

Self-hosted runners reject pull_request, so these workflows trigger on the
copy-pr-bot mirror. Cargo jobs use rust:1.98.0-bookworm. CUDA jobs use the
Ubuntu devel image, which already has the toolkit, and check the repo out
before the local setup action. The Pages deploy stays on ubuntu-latest.

Signed-off-by: Roman Ivanov <[email protected]>
The CUDA image has no git, so checkout falls back to an API tarball unless
git is already installed. The $/ action reference runs that install first.

Signed-off-by: Roman Ivanov <[email protected]>
A blank line between workflow steps makes the step list easier to scan.

Signed-off-by: Roman Ivanov <[email protected]>
copy-pr-bot creates pull-request/<n> at an existing SHA, and GitHub often treats
that push as having no changed files. A workflow-level `paths:` filter then
skips the run, so a pull request can pass with CI, docs, examples, CodeQL, book
and naming checks never started. cutile-rs.yml already avoids this.

Drop `paths:` from ci, docs, examples-compile, codeql, book and naming-guard.
Each now has a `changes` job that runs dorny/paths-filter against main with the
old path list. Jobs run when the filter matches, when no file diff is detected,
or when the event is not a push (schedule, workflow_dispatch). If the gate job
itself fails the jobs run, so the gate cannot hide a check.

Signed-off-by: Roman Ivanov <[email protected]>
…ror pushes

The append-only ABI ledger check picked its base from the pull_request event.
On a copy-pr-bot mirror push there is no such event, and on the first push to
a new pull-request/<n> branch `before` is all zeros, so the base fell back to
HEAD^. Only the last commit was compared, and a breaking ledger change in an
earlier commit of a multi-commit pull request passed the final check.

For pull-request/<n> branches use the merge base with origin/main, which the
fetch-depth 0 checkout already has. Other pushes keep `before`, then HEAD^.
Print the chosen base in the log.

Signed-off-by: Roman Ivanov <[email protected]>
On a copy-pr-bot mirror push the analyze action uploads under
refs/heads/pull-request/<n>, so the scan runs and the job goes green but its
results never attach to the pull request's code scanning alerts.

Resolve refs/pull/<n>/head and the pushed SHA, which is the pull request's head
commit, and pass them to the analyze action's `ref` and `sha` inputs. Pushes to
main and scheduled runs leave both empty and keep the default ref.

Signed-off-by: Roman Ivanov <[email protected]>
The setup-cuda-container action installed Rust with `curl https://sh.rustup.rs
| sh`, with no version and no checksum. The Jimver/cuda-toolkit step it replaced
was pinned to a commit. Download rustup-init 1.29.2 from the versioned archive
URL and check its published SHA-256 before running it. Fail on a non-x86_64
host, since the pinned checksum is for that target.

Signed-off-by: Roman Ivanov <[email protected]>
The book build interpolated ${{ github.ref }} straight into the shell script.
A branch name is chosen by whoever pushes it, so pass it through the
environment variable GitHub already sets instead of expanding it into the
script text.

Signed-off-by: Roman Ivanov <[email protected]>
The Rust jobs now run in rust:1.98.0-bookworm because the runner VM image has
no rustup. That tag copies the stable pin in the root rust-toolchain.toml, in
twelve places, and nothing keeps them together; the existing parity guard only
covers the SIMT pin under cuda-oxide/. A stale tag still builds, since rustup
installs the pinned toolchain, but it costs a download in every job and puts the
CodeQL Rust extractor on a different compiler.

Add check-ci-image-pins.sh and run it in the toolchain-pin-parity job and in
`just check-guards`. It fails if no rust:<version> reference is found, so it
cannot pass by matching nothing.

Signed-off-by: Roman Ivanov <[email protected]>
The ci, docs and examples-compile workflows decide in a `changes` job whether to
run on a mirror push, and their path lists covered `.github/workflows/**` but not
the new `.github/actions/setup-cuda-container/**`. A change to only that action
matched no path, so the unit tests, clippy, docs and example builds that depend
on it were skipped. Add the action's path to all three lists.

Signed-off-by: Roman Ivanov <[email protected]>
@roivanov

Copy link
Copy Markdown
Collaborator Author

Discussion: how CI runs on pull requests changes with this PR, and where to document it

This PR moves the workflows from ubuntu-latest to NVIDIA self-hosted runners. Those runners reject pull_request, so the workflows now trigger on push to main and to the pull-request/<n> branches that copy-pr-bot creates, as Tile CI (cutile-rs.yml) already does.

What contributors will notice:

  • Every commit must be cryptographically signed (SSH or GPG, shown as "Verified" on GitHub). On this PR a history rewrite left the commits unsigned and the bot held the PR for validation. Re-signing all of them and force-pushing fixed it: the bot mirrored the new head with no /ok to test. Signed-off-by (DCO) is a different thing and is still required.
  • Pull requests from authors the bot does not trust wait for a vetter to comment /ok to test <full commit SHA> (the full SHA only), and each new commit needs a new approval.
  • Forks: a pull request from a fork runs in NVIDIA/cuda-rust on pull-request/<n>, not in the fork. A push to a fork's own main (for example a fork sync) still starts the workflows there, and jobs that need an NVIDIA runner label stay queued because a fork has none.

CONTRIBUTING.md currently describes copy-pr-bot for Tile CI only, and its "Signing Your Commits" section covers DCO sign-off, not cryptographic signing.

Questions for reviewers:

  1. Should this be documented in CONTRIBUTING.md (a "Continuous Integration" section, the sign-off and signing wording, and a "commits are Verified" line in the PR template) in this PR, or in a separate docs PR?
  2. Can a vetter confirm the wording on who is trusted and how approval works? The bot's own documentation needs NVIDIA login, so the points above come from what I observed on this PR.
  3. Any concern about requiring signed commits for external contributors?

I plan to announce the change to contributors once this merges.

@elibol elibol left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

elibol
elibol previously approved these changes Oct 30, 2026
cryos
cryos previously approved these changes Oct 30, 2026
The workflows run on NVIDIA self-hosted runners, which reject
pull_request, so all pull request CI now goes through copy-pr-bot: it
mirrors the pull request to pull-request/<n> and the workflows trigger on
push to that branch and to main. This was already true for cutile-rs and
is new for cuda-oxide contributors. Document it.

- CONTRIBUTING.md: a table that sets the DCO sign-off (-s) apart from the
  cryptographic signature (-S, Verified on GitHub), how to sign and how to
  re-sign after a rebase; a Continuous Integration section that explains
  the copy-pr-bot flow and when /ok to test <full SHA> is needed, then
  drafts, forks, skipped jobs and the runner labels for new workflows.
- pull_request_template.md: a checklist line for signed commits.
- AGENTS.md: replace the workflow-level path filter description with the
  changes-job gating, and say not to add pull_request triggers or
  ubuntu-latest (book.yml deploy aside).

Signed-off-by: Roman Ivanov <[email protected]>
@roivanov
roivanov dismissed stale reviews from cryos and elibol via 05f2f58 October 30, 2026 19:51
@roivanov

Copy link
Copy Markdown
Collaborator Author

Updated the docs, you may want to give another look @elibol @assignUser @cryos

cryos
cryos previously approved these changes Oct 30, 2026

@cryos cryos left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Doc updates look good to me, very thorough. My only nit is that they may be a little long for folks to read.

Conflicts in the workflow triggers and path filters from NVIDIA#1516, which added
cuda-repr/** to the filters and pull-request/[0-9]+ to the push branches of
the old workflow-level filters.

This branch already triggers on push to main and to pull-request/[0-9]+ and
gates its jobs with a changes job instead of a workflow-level paths filter,
so keep this branch's workflows and add cuda-repr/** to the changes-job
filters of ci.yml, docs.yml and examples-compile.yml. cutile-rs.yml took the
same entry from main without a conflict.

Signed-off-by: Roman Ivanov <[email protected]>
@roivanov
roivanov merged commit 5c36cb9 into NVIDIA:main Oct 30, 2026
77 checks passed
@roivanov
roivanov deleted the ci/codeql-cpu8 branch October 30, 2026 22:34
elibol added a commit to elibol/cuda-rust that referenced this pull request Oct 30, 2026
Merge main through NVIDIA#1541, NVIDIA#1683 and NVIDIA#1634. Resolve workflow conflicts using the accepted NVIDIA#1580 copy-pr-bot triggers.

Signed-off-by: Melih Elibol <[email protected]>
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.

ci: move ubuntu-latest jobs onto linux-amd64-cpu4 or larger runners

4 participants