Skip to content

Create a swapfile in workflow-run-job-linux#9739

Open
trxcllnt wants to merge 2 commits into
NVIDIA:mainfrom
trxcllnt:fix/gha-swapfile
Open

Create a swapfile in workflow-run-job-linux#9739
trxcllnt wants to merge 2 commits into
NVIDIA:mainfrom
trxcllnt:fix/gha-swapfile

Conversation

@trxcllnt

@trxcllnt trxcllnt commented Jul 7, 2026

Copy link
Copy Markdown
Member

Create a swapfile in workflow-run-job-linux to work around OOMs during compiling.

@trxcllnt trxcllnt requested a review from a team as a code owner July 7, 2026 21:01
@trxcllnt trxcllnt requested a review from jrhemstad July 7, 2026 21:01
@github-project-automation github-project-automation Bot moved this to Todo in CCCL Jul 7, 2026
@cccl-authenticator-app cccl-authenticator-app Bot moved this from Todo to In Review in CCCL Jul 7, 2026
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: de8c8845-bcb4-45ff-bfb0-d937cba46f47

📥 Commits

Reviewing files that changed from the base of the PR and between 0ed347e and 9c1e455.

📒 Files selected for processing (1)
  • .github/actions/workflow-run-job-linux/action.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/actions/workflow-run-job-linux/action.yml

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved reliability for Linux-based automated runs by initializing temporary swap space when needed for memory-intensive jobs, helping prevent failures.
    • Adjusted system swappiness settings after enabling swap to better handle low-memory scenarios.

Walkthrough

Added Linux CI swap provisioning to the generated ci.sh run step. The script now measures disk and memory, skips creation when swap is already active, otherwise creates /swapfile, enables it, and sets vm.swappiness=10.

Changes

Swap Provisioning in Linux CI Action

Layer / File(s) Summary
Swap provisioning logic
.github/actions/workflow-run-job-linux/action.yml
Adds disk/memory calculation, swap detection, conditional /swapfile creation via fallocate, swap enabling, and vm.swappiness=10 in the generated script.

Sequence Diagram(s)

Not applicable.

Suggested labels: ci, infrastructure

Suggested reviewers: N/A


Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 2

🧹 Nitpick comments (2)
.github/actions/workflow-run-job-linux/action.yml (2)

117-117: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

suggestion: fallocate isn't supported on all filesystems (e.g., some overlay/network filesystems used by CI runners) and fails with "fallocate failed: Operation not supported". Given set -e is active, this would abort the job outright. Consider falling back to dd if fallocate fails.

Proposed fallback
-          sudo fallocate -l "$((SWAP_SIZE / 1024 / 1024 / 1024))G" /swapfile
+          sudo fallocate -l "$((SWAP_SIZE / 1024 / 1024 / 1024))G" /swapfile || \
+            sudo dd if=/dev/zero of=/swapfile bs=1M count=$((SWAP_SIZE / 1024 / 1024))

116-116: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low value

suggestion: if DISK_SIZE / 4 rounds down to 0 (very small root disk), fallocate -l 0G /swapfile may fail or create a useless empty swapfile. Worth a minimum-size floor, though likely low risk on real CI hardware.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 925bb416-855e-4993-85d3-e15c1e66a15e

📥 Commits

Reviewing files that changed from the base of the PR and between 84c2c01 and 0ed347e.

📒 Files selected for processing (1)
  • .github/actions/workflow-run-job-linux/action.yml

Comment thread .github/actions/workflow-run-job-linux/action.yml
Comment thread .github/actions/workflow-run-job-linux/action.yml Outdated
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@Jacobfaib

Copy link
Copy Markdown
Contributor

@trxcllnt rebasing over main should fix the clang-tidy issue.

Are the swap files ephemeral to the docker images? Or permanent? If they are ephemeral, perhaps we should consider allocating them directly in the devcontainer builds if that's possible as a longer-term solution.

@bernhardmgruber

Copy link
Copy Markdown
Contributor

/ok to test 9e2b7ae

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

😬 CI Workflow Results

🟥 Finished in 1h 34m: Pass: 99%/506 | Total: 5d 07h | Max: 1h 25m | Hits: 93%/730740

See results here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

3 participants