Skip to content

RHAIENG-6546: align rhoai-2.25 GHA disk layout with main (no LVM, /mnt, ubuntu-26.04) - #2647

Merged
jiridanek merged 9 commits into
rhoai-2.25from
fix/rhoai-2.25-disk-layout-main
Jul 30, 2026
Merged

RHAIENG-6546: align rhoai-2.25 GHA disk layout with main (no LVM, /mnt, ubuntu-26.04)#2647
jiridanek merged 9 commits into
rhoai-2.25from
fix/rhoai-2.25-disk-layout-main

Conversation

@jiridanek

@jiridanek jiridanek commented Jul 30, 2026

Copy link
Copy Markdown
Member

Summary

  • Cherry-pick ISSUE#3965 (e4cf912dfb): remove LVM overlay + orphaned free-up-disk-space action; finish /mnt Podman storage layout; drop codeserver swap; fix software-versions to use /mnt without custom TMPDIR bind
  • RHAIENG-6546: backport ci/logging_config.py so monitor_resources.py stops ModuleNotFoundError; drop related rows from docs/ci-failure-triage.md
  • Migrate remaining workflows from ubuntu-24.04 / ubuntu-latestubuntu-26.04 (equivalent of main f3c39c50c9; cherry-pick conflicted with RHDS-only workflows)

Test plan

Done

In progress / outstanding

Summary by CodeRabbit

  • CI Improvements
    • Updated many GitHub Actions workflows to use the Ubuntu 26.04 runner for more consistent CI across builds, tests, scans, releases, and maintenance.
    • Refreshed notebook build disk/Podman storage setup guidance and logging breadcrumbs; adjusted Podman storage preparation and removed swap/dedicated storage setup.
    • Removed prior automated disk-space cleanup and legacy storage/LVM overlay script; added runner-appropriate AppArmor workaround where needed.
  • Logging
    • Improved structured logging console rendering for dict/list values, ensuring safer serialization.
  • Documentation
    • Updated CI failure-triage pointers to reflect current Podman/architecture issue patterns.

Summary by CodeRabbit

  • Chores
    • Updated automated workflows to run on Ubuntu 26.04 for more consistent build, test, release, and security-check environments.
    • Reworked notebook/container runner disk-space handling, including a dedicated cleanup action and conditional storage steps.
    • Added a CI self-test to verify cleanup reclaims disk space and removes expected cached tooling.
    • Added an Ubuntu 26.04 Podman/pasta compatibility adjustment for container tests.
  • Bug Fixes
    • Improved console logging of structured output (lists/dictionaries) when values aren’t directly JSON-serializable.
  • Documentation
    • Refined CI failure triage guidance by updating the “Other failure classes” table.

Related issues

jiridanek and others added 3 commits July 30, 2026 12:33
…rlay (opendatahub-io#3967)

* chore: fix podman registry auth by ensuring storage directory exists
* chore: standardize TMPDIR across GHA workflows to /var/tmp
* chore: simplify monitor_resources.py and fix hardcoded values

- Replace subprocess `df` + fragile text parsing with shutil.disk_usage()
- Fix monitored path /var/lib/containers → /mnt/containers/storage
- Cache shutil.which('free') at module level instead of per-iteration
- Parse free -h into structured dict for proper JSON logging
- Use ${USER} instead of hardcoded runner:runner in build template

* chore: remove custom TMPDIR in Podman workflows
* chore: handle timeout in memory usage retrieval with subprocess timeout retry
* chore(ci): update crio.conf comment to clarify runroot configuration
* chore: add signal handling to monitor_resources.py for clean shutdown

Co-authored-by: Junie <junie@jetbrains.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
(cherry picked from commit e4cf912)
scripts/monitor_resources.py already imports ci.logging_config on rhoai-2.25
but the module was missing, causing background ModuleNotFoundError in Build
Notebooks. Drop the matching triage rows now that /mnt layout + logging are
aligned with main.

Co-authored-by: Cursor <cursoragent@cursor.com>
Align rhoai-2.25 with main's runner pin (f3c39c5): replace ubuntu-24.04
and ubuntu-latest with ubuntu-26.04 across workflows. Cherry-pick of that
commit conflicted heavily with RHDS-only workflows, so apply the equivalent
mechanical migration instead.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The PR pins GitHub Actions jobs to Ubuntu 26.04, updates Podman and disk management, adds structured logging, introduces disk cleanup validation, adjusts container AppArmor handling, and refactors ROCm PyTorch image build steps.

Changes

CI platform updates

Layer / File(s) Summary
Shared logging configuration
ci/logging_config.py
Adds structured logging documentation, pretty rendering, template interpolation, optional highlighting, and configurable structlog integration.
Ubuntu 26.04 workflow migration
.github/workflows/*
Moves workflow jobs from floating or older Ubuntu runner labels to ubuntu-26.04.
Podman storage and disk cleanup
.github/workflows/software-versions.yaml, .github/workflows/test-containers.yaml, .github/actions/free-up-disk-space/action.yml, .github/workflows/test-free-up-disk-space.yaml, .github/workflows/build-notebooks-TEMPLATE.yaml, docs/ci-failure-triage.md
Updates Podman storage and AppArmor handling, adds disk cleanup and validation, and revises CI troubleshooting guidance.
ROCm image build refactoring
jupyter/rocm/pytorch/..., runtimes/rocm-pytorch/...
Splits installation, de-vendoring, and permission fixes into strict Bash heredoc build steps.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related issues

Possibly related PRs

Suggested labels: lgtm, approved

Suggested reviewers: atheo89, dibryant, ysok

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 62.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: syncing GHA disk layout and runner updates with main.
Description check ✅ Passed The description covers the changes and testing, but it uses different headings and omits the template's checklist items.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Fix failing CI checks
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/rhoai-2.25-disk-layout-main

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

rhoai-2.25 sets reportAttributeAccessIssue=none, so the ignore comments
copied from main trip reportUnnecessaryTypeIgnoreComment under pre-commit.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown

Superseded by newer run: https://github.com/red-hat-data-services/notebooks/actions/runs/30535872380

CI status [antigravity]

Run: Build Notebooks (pr) #305353070473/3 complete · 1 passed · 2 cancelled
Last updated: 2026-07-30T10:39:18Z after workflow update completed

Failures so far

Job Failed step Link
codeserver-ubi9-python-3.12 · linux/amd64 [rhoai] / build Run actions/setup-go@b7ad1da logs
codeserver-ubi9-python-3.12 · linux/arm64 [rhoai] / build Prefetch hermetic build dependencies logs

Likely root causes

  • The workflow run was cancelled (The operation was canceled.), causing the jobs (codeserver-ubi9-python-3.12 · linux/amd64 [rhoai] / build and codeserver-ubi9-python-3.12 · linux/arm64 [rhoai] / build) to terminate prematurely during setup or prefetch steps.

Suggested next steps

  • Re-run the workflow to check if the build completes successfully without cancellation.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
ci/logging_config.py (1)

56-71: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Reaches into a private structlog attribute.

self._default_column_formatter is an internal implementation detail of structlog.dev.ConsoleRenderer (populated by its private _configure_columns() method), not part of the documented public API. The documented, supported customization path is the columns constructor parameter. Relying on the underscore-prefixed attribute risks silent breakage on a future structlog upgrade (e.g. any code path that later sets one of the new 25.5.0 properties would trigger _configure_columns() and discard this override).

Since this depends on structlog's internal implementation, please verify against the pinned structlog version and consider building an explicit columns list instead (defining a default column with key="") for a stable, documented API surface.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ci/logging_config.py` around lines 56 - 71, The PrettyConsoleRenderer
initializer relies on private _default_column_formatter, which can be
overwritten by structlog. Replace this override with an explicit columns
configuration using the documented columns parameter, including a default column
with key="" and the existing key/value styles, pretty value representation, and
"\n  " prefix; verify the configuration against the pinned structlog version.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@ci/logging_config.py`:
- Around line 45-53: Update _pretty_value_repr so its json.dumps call safely
handles non-JSON-serializable values by using a repr-based fallback for
unsupported objects, while preserving the existing indented JSON and
highlighting behavior for serializable dicts and lists.

---

Nitpick comments:
In `@ci/logging_config.py`:
- Around line 56-71: The PrettyConsoleRenderer initializer relies on private
_default_column_formatter, which can be overwritten by structlog. Replace this
override with an explicit columns configuration using the documented columns
parameter, including a default column with key="" and the existing key/value
styles, pretty value representation, and "\n  " prefix; verify the configuration
against the pinned structlog version.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: b0fd1480-dee0-4573-b957-65f15c090f8a

📥 Commits

Reviewing files that changed from the base of the PR and between da5cd33 and a2c6724.

📒 Files selected for processing (37)
  • .github/actions/free-up-disk-space/action.yml
  • .github/workflows/auto-add-issue-to-project.yml
  • .github/workflows/build-notebooks-TEMPLATE.yaml
  • .github/workflows/build-notebooks-pr-aipcc.yaml
  • .github/workflows/build-notebooks-pr-rhel.yaml
  • .github/workflows/build-notebooks-push.yaml
  • .github/workflows/code-quality.yaml
  • .github/workflows/codeql.yaml
  • .github/workflows/create-release.yaml
  • .github/workflows/docs.yaml
  • .github/workflows/gitleaks.yaml
  • .github/workflows/insta-merge.yaml
  • .github/workflows/instant-merge.yaml
  • .github/workflows/notebook-digest-updater.yaml
  • .github/workflows/notebooks-digest-updater.yaml
  • .github/workflows/notebooks-release.yaml
  • .github/workflows/notify-team-to-review-pr.yml
  • .github/workflows/params-env.yaml
  • .github/workflows/piplock-renewal.yaml
  • .github/workflows/pr-merge-image-delete.yml
  • .github/workflows/purge-ghcr.yaml
  • .github/workflows/rpms-lock-renewal.yaml
  • .github/workflows/sec-scan.yml
  • .github/workflows/security.yaml
  • .github/workflows/semgrep.yaml
  • .github/workflows/software-versions.yaml
  • .github/workflows/sync-branches-through-pr.yml
  • .github/workflows/test-capture-kernel-logs.yaml
  • .github/workflows/test-containers.yaml
  • .github/workflows/test-provision-k8s.yaml
  • .github/workflows/test-trivy-scan-action.yaml
  • .github/workflows/update-buildconfigs.yaml
  • .github/workflows/update-commit-latest-env.yaml
  • .github/workflows/update-tags.yaml
  • ci/cached-builds/gha_lvm_overlay.sh
  • ci/logging_config.py
  • docs/ci-failure-triage.md
💤 Files with no reviewable changes (3)
  • .github/actions/free-up-disk-space/action.yml
  • ci/cached-builds/gha_lvm_overlay.sh
  • docs/ci-failure-triage.md

Comment thread ci/logging_config.py
Port main's Fix AppArmor pasta/podman signal conflict into
test-containers.yaml. Without it, container stop fails with CNI
permission denied on ubuntu-26.04 (Test Infrastructure Self-Test).

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown

Superseded by newer run: https://github.com/red-hat-data-services/notebooks/actions/runs/30535450798

CI status [antigravity]

Run: Build Notebooks (push) #305358723802/2 complete · 2 skipped
Last updated: 2026-07-30T10:45:24Z

Workflow completed with skipped jobs.

@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown

Superseded by newer run: https://github.com/red-hat-data-services/notebooks/actions/runs/30536210175

CI status [antigravity]

Run: Build Notebooks (pr) #305354507983/3 complete · 1 passed · 2 cancelled
Last updated: 2026-07-30T10:45:47Z after workflow update completed

Failures so far

Job Failed step Link
codeserver-ubi9-python-3.12 · linux/arm64 [rhoai] / build Build: make codeserver-ubi9-python-3.12 logs
codeserver-ubi9-python-3.12 · linux/amd64 [rhoai] / build Build: make codeserver-ubi9-python-3.12 logs

Likely root causes

  • The workflow run was cancelled (##[error]The operation was canceled.), likely due to manual cancellation, a timeout, or a preceding job failure/cancellation in the workflow.
  • In the failed jobs (codeserver-ubi9-python-3.12 · linux/arm64 [rhoai] / build and codeserver-ubi9-python-3.12 · linux/amd64 [rhoai] / build), building was underway (make codeserver-ubi9-python-3.12), but the build was interrupted by the cancellation signal before completion.

Suggested next steps

  • Re-run the workflow if the cancellation was unintended or caused by a transient concurrency constraint.
  • Review recent workflow changes in .github/workflows/build-notebooks-TEMPLATE.yaml regarding disk layout and resource monitoring if cancellations recur during builds.

Address CodeRabbit: avoid TypeError in pretty log rendering when a
dict/list value contains a non-JSON-serializable object.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown

Superseded by newer run: https://github.com/red-hat-data-services/notebooks/actions/runs/30535877175

CI status [antigravity]

Run: Build Notebooks (push) #305362101752/2 complete · 2 skipped
Last updated: 2026-07-30T10:50:29Z

Workflow completed with skipped jobs.

@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown

Superseded by newer run: https://github.com/red-hat-data-services/notebooks/actions/runs/30543457245

CI status [antigravity]

Run: Build Notebooks (pr) #305358771753/3 complete · 1 passed · 2 cancelled
Last updated: 2026-07-30T10:50:55Z after workflow update completed

Failures so far

Job Failed step Link
codeserver-ubi9-python-3.12 · linux/amd64 [rhoai] / build Build: make codeserver-ubi9-python-3.12 logs
codeserver-ubi9-python-3.12 · linux/arm64 [rhoai] / build Build: make codeserver-ubi9-python-3.12 logs

Likely root causes

  • The build jobs codeserver-ubi9-python-3.12 · linux/amd64 [rhoai] / build and codeserver-ubi9-python-3.12 · linux/arm64 [rhoai] / build concluded as cancelled during container image build steps (dnf install and COPY .git /root/.git).

Suggested next steps

  • Re-run the workflow to check whether the cancellation was due to a manual abort, timeout, or external workflow concurrency interruption.

Reclaim runner preinstalls only for the two RHDS AIPCC targets that
ENOSPC on single-volume ubuntu-26.04, and add a path-triggered self-test.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown

Superseded by newer run: https://github.com/red-hat-data-services/notebooks/actions/runs/30547662601

CI status [antigravity]

Run: Build Notebooks (push) #305434572452/2 complete · 2 skipped
Last updated: 2026-07-30T12:39:44Z

Workflow completed with skipped jobs.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/test-free-up-disk-space.yaml:
- Around line 64-70: Update the fixed-path validation loop in the workflow to
include /usr/local/share/boost and /usr/local/lib/node_modules alongside the
existing paths, ensuring both action-managed deletions are verified by the
self-test.
- Around line 56-62: Update the cleanup self-test around min_gain_kb so it does
not require a fixed 5 GiB reclaimed-space threshold tied to the runner image
layout. Assert that cleanup reclaims a positive amount and verify the expected
cleanup paths instead, or replace the current threshold with an explicitly
maintained contract.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: be714957-24c9-44bb-9d39-3c37496f41b8

📥 Commits

Reviewing files that changed from the base of the PR and between ed0ac12 and 7f7a11a.

📒 Files selected for processing (3)
  • .github/actions/free-up-disk-space/action.yml
  • .github/workflows/build-notebooks-TEMPLATE.yaml
  • .github/workflows/test-free-up-disk-space.yaml

Comment on lines +56 to +62
# Expect at least ~5 GiB reclaimed on a stock ubuntu-26.04 runner
# (android/dotnet/CodeQL alone are usually well above this).
min_gain_kb=$((5 * 1024 * 1024))
if (( gained_kb < min_gain_kb )); then
echo "::error::Expected at least 5 GiB freed, got $((gained_kb / 1024 / 1024)) GiB"
exit 1
fi

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Avoid making this self-test depend on a fixed 5 GiB image layout.

GitHub currently lists ubuntu-26.04 as a public-preview image and warns that preview images are provided as-is, so installed contents can change. (docs.github.com) A correct cleanup can therefore fail this gate after runner-image updates. Prefer asserting positive reclaimed space plus the expected paths, or make the threshold an explicit maintained contract.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/test-free-up-disk-space.yaml around lines 56 - 62, Update
the cleanup self-test around min_gain_kb so it does not require a fixed 5 GiB
reclaimed-space threshold tied to the runner image layout. Assert that cleanup
reclaims a positive amount and verify the expected cleanup paths instead, or
replace the current threshold with an explicitly maintained contract.

Comment on lines +64 to +70
# Paths the action deletes; tolerate already-missing.
for path in \
/usr/local/lib/android \
/usr/share/dotnet \
/opt/ghc \
/usr/local/.ghcup \
/opt/hostedtoolcache/CodeQL

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Validate every fixed path removed by the action.

The action also deletes /usr/local/share/boost and /usr/local/lib/node_modules, but this loop does not verify either path. Add both entries so cleanup regressions cannot pass the self-test unnoticed.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/test-free-up-disk-space.yaml around lines 64 - 70, Update
the fixed-path validation loop in the workflow to include /usr/local/share/boost
and /usr/local/lib/node_modules alongside the existing paths, ensuring both
action-managed deletions are verified by the self-test.

@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown

Superseded by newer run: https://github.com/red-hat-data-services/notebooks/actions/runs/30543463730

CI status [antigravity]

Run: Build Notebooks (push) #305476626012/2 complete · 2 skipped
Last updated: 2026-07-30T13:36:31Z

Workflow completed with skipped jobs.

@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown

Superseded by newer run: https://github.com/red-hat-data-services/notebooks/actions/runs/30550792399

CI status [antigravity]

Run: Build Notebooks (pr) #305434637303/3 complete · 1 passed · 2 cancelled
Last updated: 2026-07-30T13:37:02Z after workflow update completed

Failures so far

Job Failed step Link
codeserver-ubi9-python-3.12 · linux/amd64 [rhoai] / build Build: make codeserver-ubi9-python-3.12 logs
codeserver-ubi9-python-3.12 · linux/arm64 [rhoai] / build Build: make codeserver-ubi9-python-3.12 logs

Likely root causes

  • The workflow run was cancelled by an external event or user action (The operation was canceled).
  • Resource utilization logs show stable disk space and memory usage prior to cancellation (codeserver-ubi9-python-3.12 · linux/amd64 and codeserver-ubi9-python-3.12 · linux/arm64).

Suggested next steps

  • Re-run the cancelled workflow or check if a newer commit superseded this build.

@ide-developer ide-developer 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.

Thorough backport — aligns rhoai-2.25 GHA infra with main. Reviewed the full 42-file diff. Key areas and findings below.

1. ubuntu-26.04 migration (~25 workflows)

Mechanical runs-on replacements. Consistent with the crun/podman fix (opendatahub-io#4211 / actions/runner-images#14473). Non-podman workflows (issue-to-project, insta-merge, digest-updater, etc.) don't strictly need it but consistency across the repo is reasonable.

2. LVM overlay removal + /mnt layout

Deleting gha_lvm_overlay.sh (79-line LVM+btrfs+swap setup) in favor of sudo mkdir -p /mnt/containers/storage is a major simplification. The old approach was fragile (LVM resize, btrfs mount opts, swap carved from VG). The new layout trusts GitHub's promise of ≥15GiB on / plus whatever /mnt provides on two-volume machines.

Risk is ENOSPC on single-volume runners. Mitigated by: (a) conditional free-up-disk-space for the two largest ROCm targets, (b) the Dockerfile layer merge below.

3. ROCm Dockerfile layer merge (the clever part)

Moving de-vendor-torch.sh into the same RUN layer as uv pip install means the intermediate state (vendored ROCm .so + installed copies) is never committed to the image store. This directly reduces peak disk during podman commit, which is where ENOSPC was hitting. The user context is correct: de-vendor-torch.sh runs as USER 1001 — same user that installed the packages, so it has write access to remove the vendored copies from site-packages.

The heredoc RUN /bin/bash <<'EOF' syntax requires BuildKit, which is standard for both Podman 5.7+ (ubuntu-26.04) and Konflux builds.

All four ROCm Dockerfiles (jupyter + runtime, .rocm + .konflux.rocm) are updated consistently.

4. free-up-disk-space action rework

  • docker system prune -af replaces the old background docker image prune — more thorough and runs synchronously before builds.
  • Added apt-get clean + rm -rf /tmp/*.
  • The new self-test workflow (test-free-up-disk-space.yaml) is a nice addition — asserts ≥5GiB reclaimed and specific paths removed.

5. ci/logging_config.py backport

Fixes ModuleNotFoundError: ci.logging_config that monitor_resources.py was hitting. The _pretty_value_repr uses json.dumps(value, indent=2, default=str) — the default=str makes it safe for non-JSON-serializable values (datetime, Path, etc.).

6. software-versions.yaml simplification

Removed the TMPDIR env var and /var/tmp bind mount. On ubuntu-26.04 with proper storage.conf pointing to /mnt, this should work. Validated by the test plan.

7. Codeserver swap removal

The 16GB swap fallocate for codeserver npm builds is gone. This was added when codeserver builds were hitting OOM during parallel npm postinstall. If this resurfaces, it would manifest as npm segfaults or OOM kills during npm ci. Test plan covers this (codeserver build running).

8. Triage doc updates

Correctly removes the two fixed items (ModuleNotFoundError — backported; ROCm ENOSPC — layer merge).

LGTM. Pending the in-progress build results (codeserver + full ROCm matrix).

@openshift-ci

openshift-ci Bot commented Jul 30, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ide-developer
Once this PR has been reviewed and has the lgtm label, please assign daniellutz for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot removed the lgtm label Jul 30, 2026
@openshift-ci

openshift-ci Bot commented Jul 30, 2026

Copy link
Copy Markdown

New changes are detected. LGTM label has been removed.

@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown

Superseded by newer run: https://github.com/red-hat-data-services/notebooks/actions/runs/30547666857

CI status [antigravity]

Run: Build Notebooks (push) #305507923992/2 complete · 2 skipped
Last updated: 2026-07-30T14:15:38Z

Workflow completed with skipped jobs.

@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown

Superseded by newer run: https://github.com/red-hat-data-services/notebooks/actions/runs/30550798241

CI status [antigravity]

Run: Build Notebooks (pr) #305476668575/5 complete · 3 passed · 2 cancelled
Last updated: 2026-07-30T14:16:04Z after workflow update completed

Failures so far

Job Failed step Link
codeserver-ubi9-python-3.12 · linux/amd64 [rhoai] / build Build: make codeserver-ubi9-python-3.12 logs
codeserver-ubi9-python-3.12 · linux/arm64 [rhoai] / build Build: make codeserver-ubi9-python-3.12 logs

Likely root causes

  • The workflow run was cancelled (conclusion: cancelled), as explicitly stated in the failed job error contexts (##[error]The operation was canceled.). There is no evidence of an underlying code or resource failure (such as disk exhaustion or OOM), as memory and disk usage were stable (disk used ~33%–47%, memory around 14Gi/15Gi with active resource monitoring).

Suggested next steps

  • Re-trigger or re-run the cancelled workflow jobs (codeserver-ubi9-python-3.12 · linux/amd64 [rhoai] / build and codeserver-ubi9-python-3.12 · linux/arm64 [rhoai] / build) to verify completion under the updated disk and runner layout.

Fold de-vendor-torch.sh into the USER 1001 pip layer so the giant
vendored ROCm libs never land in a committed layer, cutting GHA
ENOSPC peak. Keep a thin root RUN for chmod/fix-permissions only.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jiridanek
jiridanek force-pushed the fix/rhoai-2.25-disk-layout-main branch from 4bce483 to e237975 Compare July 30, 2026 14:20
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown

Superseded by newer run: https://github.com/red-hat-data-services/notebooks/actions/runs/30552740500

CI status [antigravity]

Run: Build Notebooks (pr) #305507982415/5 complete · 1 passed · 4 cancelled
Last updated: 2026-07-30T14:21:40Z after workflow update completed

Failures so far

Job Failed step Link
codeserver-ubi9-python-3.12 · linux/amd64 [rhoai] / build Prefetch hermetic build dependencies logs
rocm-runtime-pytorch-ubi9-python-3.12 · linux/amd64 [rhoai] / build Build: make rocm-runtime-pytorch-ubi9-python-3.12 logs
rocm-jupyter-pytorch-ubi9-python-3.12 · linux/amd64 [rhoai] / build Build: make rocm-jupyter-pytorch-ubi9-python-3.12 logs
codeserver-ubi9-python-3.12 · linux/arm64 [rhoai] / build Build: make codeserver-ubi9-python-3.12 logs

Likely root causes

  • All failed jobs were explicitly cancelled (##[error]The operation was canceled.), likely due to workflow cancellation or timeout rather than an intrinsic build or test error.
  • Jobs related to codeserver and ROCm builders (codeserver-ubi9-python-3.12 · linux/amd64, codeserver-ubi9-python-3.12 · linux/arm64, and ROCm runtime/jupyter builds) were terminated mid-execution during dependency prefetch, base image pulls, or package downloads.

Suggested next steps

  • Re-run the workflow to verify whether the builds complete successfully without external cancellation.
  • Monitor resource consumption and execution times for ROCm and codeserver image builds to ensure they do not hit concurrency limits or timeouts under the updated GHA disk layout (/mnt).

v2.12.0 cannot parse BuildKit heredoc syntax (RUN <<'EOF' … EOF);
the parser treats content after the closing EOF as still inside the
RUN instruction (hadolint/hadolint#1137). Bump to v2.15.0 which
handles this correctly when a blank line follows the delimiter.

Suppress new rules that flag pre-existing patterns:
  DL3064 — false positive on rstudio SECRET_DIR (a path, not a secret)
  DL3066 — named USER directives (intentional in our images)
  SC3046 — source in bash RUN blocks (not POSIX sh)

(cherry picked from commit 89ac408)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jiridanek
jiridanek force-pushed the fix/rhoai-2.25-disk-layout-main branch from e237975 to d173498 Compare July 30, 2026 14:38
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown

Superseded by newer run: https://github.com/red-hat-data-services/notebooks/actions/runs/30551249055

CI status [antigravity]

Run: Build Notebooks (push) #305527405002/2 complete · 2 skipped
Last updated: 2026-07-30T14:39:20Z

Workflow completed with skipped jobs.

@jiridanek

Copy link
Copy Markdown
Member Author

GHA result: same-RUN de-vendor fixed ROCm pytorch ENOSPC

@coderabbitai — FYI follow-up data for the incremental port tracked here (baseline already on #2647).

Verdict

Both ROCm pytorch GHA builds are green on db6f9bbc40 (same-RUN de-vendor-torch.sh in the pip heredoc). The previous dispatch with free-up only (7f7a11a949) still hit 100% disk during layer commit.

Job Run / SHA Peak / used Min free Outcome
rocm-jupyter-pytorch 30547730472 db6f9bb 58% (~60 GiB free) 60.4 GiB success (~16 min build; image ~39.9 GB)
rocm-runtime-pytorch same 59% (~60 GiB free) 59.6 GiB success (~12 min build; image ~38.9 GB)
rocm-jupyter-pytorch 30543481926 7f7a11a (free-up only) 100% 0.0 GiB ENOSPC committing …/torch/lib/librocsparse.so
rocm-runtime-pytorch same 100% 0.3 GiB ENOSPC committing rocblas …_gfx90a.dat

Both attempts ran the restored free-up-disk-space action (~52 GiB → ~26 GiB used / ~119 GiB free before build). Free-up alone was not enough.

Why (root cause)

Podman commits a layer from the container filesystem after the RUN finishes.

  1. Split RUNs (failed): USER 1001 pip left multi‑tens‑of‑GiB vendored ROCm blobs under site-packages/torch/lib. Commit of that fat layer rewrote those blobs into storage (librocsparse.so / rocblas .dat) and climbed ~55% → 100% free→0 in ~6 min. de-vendor-torch.sh never ran — it was the next USER 0 RUN.
  2. Same RUN (green): pip + ./de-vendor-torch.sh + rm in one USER 1001 heredoc replace vendored copies with symlinks before commit. The committed layer never carries the giant blobs; peak stays ~58–59%. Thin root RUN only does chmod / fix-permissions.

So the ENOSPC was a layer-commit peak problem, not “runner too small after free-up” alone. Aligning de-vendor with the pip layer (as on ODH main) is what moved the needle; #2650 remains the place for fuller main ports (ensure-openshift-site-packages, umask, optional .py de-vendor).

@github-actions

Copy link
Copy Markdown

CI status [antigravity]

Run: Build Notebooks (pr) #305512490555/5 complete · 2 passed · 3 cancelled
Last updated: 2026-07-30T14:39:49Z after workflow update completed

Failures so far

Job Failed step Link
codeserver-ubi9-python-3.12 · linux/amd64 [rhoai] / build Build: make codeserver-ubi9-python-3.12 logs
codeserver-ubi9-python-3.12 · linux/arm64 [rhoai] / build Build: make codeserver-ubi9-python-3.12 logs
rocm-jupyter-pytorch-ubi9-python-3.12 · linux/amd64 [rhoai] / build Run OpenShift container tests (in PyTest) logs

Likely root causes

  • The workflow run was explicitly cancelled (conclusion: cancelled), terminating the codeserver-ubi9-python-3.12 and rocm-jupyter-pytorch-ubi9-python-3.12 build and test jobs before completion.

Suggested next steps

  • Re-run the cancelled workflow or PR check to complete the matrix build and container tests under the updated disk and runner layout.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

@jiridanek, thanks for the detailed validation. The before/after data clearly confirms that the fix is the same-layer ordering, not runner cleanup alone: de-vendoring must occur in the USER 1001 pip-install RUN before Podman snapshots the layer.

I’ll treat this as an invariant for these ROCm PyTorch Dockerfiles: do not separate uv pip install and de-vendor-torch.sh into committed layers. The reported ~60 GiB free-space floor across both successful builds is strong evidence that the current arrangement resolves the layer-commit ENOSPC risk. The remaining broader parity items appropriately stay scoped to #2650.

🐇 ✅


✏️ Learnings added
Learnt from: jiridanek
URL: https://github.com/red-hat-data-services/notebooks/pull/2647

Timestamp: 2026-07-30T14:40:03.812Z
Learning: For the ROCm PyTorch notebook and runtime Dockerfiles (`jupyter/rocm/pytorch/ubi9-python-3.12/Dockerfile.rocm`, `jupyter/rocm/pytorch/ubi9-python-3.12/Dockerfile.konflux.rocm`, `runtimes/rocm-pytorch/ubi9-python-3.12/Dockerfile.rocm`, and `runtimes/rocm-pytorch/ubi9-python-3.12/Dockerfile.konflux.rocm`), `de-vendor-torch.sh` must execute in the same non-root `RUN` layer as `uv pip install`. Podman commits filesystem changes after each `RUN`; separating them causes the multi-tens-of-GiB vendored ROCm libraries under `site-packages/torch/lib` to be committed first and can exhaust GitHub Actions disk space. Freeing runner disk space alone does not prevent this layer-commit ENOSPC.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

You are interacting with an AI system.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rhoai-2.25: backport main ROCm pytorch install layering (ensure-openshift / de-vendor-torch.py)

2 participants