Skip to content

Apptainer, phoronix fixes, GH action cleanup - #1132

Merged
arjunsuresh merged 21 commits into
mlcommons:mainfrom
amd:main
Nov 6, 2026
Merged

arjunsuresh merged 21 commits into
mlcommons:mainfrom
amd:main

Conversation

@amd-arsuresh

Copy link
Copy Markdown
Contributor

🧾 PR Checklist

📁 File Hygiene & Output Handling

  • No unintended files (e.g., logs, cache, temp files, pycache, output folders) are committed

📝 Comments & Communication

  • Proper inline comments are added to explain important or non-obvious changes
  • PR title and description clearly state what the PR does and why
  • Related issues (if any) are properly referenced (Fixes #, Related to #, etc.)

🛡️ Safety & Security

  • No secrets or credentials are committed
  • Paths, shell commands, and environment handling are safe and portable

@amd-arsuresh
amd-arsuresh requested a review from a team as a code owner November 5, 2026 20:30
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅

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.

🟡 Changes recommended

The generated Apptainer setup follows symlinks outside the container rootfs, allowing bind-point creation to modify host paths, potentially as root.

8 open issues
What changed in this PR

AI review requested by the user, covering the nine changed files and relevant supporting code. This is input to human review, not a substitute for it.

This PR improves Apptainer container setup and Phoronix benchmark automation. It addresses those workflows, but remaining safety and correctness issues should be resolved before merging.

Changes:

  • Adds build-time bind handling, expands container repository selection, and introduces an AppArmor profile.
  • Reuses suitable system PHP installations and isolates Phoronix configuration and results for unattended runs.
  • Adds FFTW version detection and refreshes the script index timestamp.

Suggested path to merge:

  1. Address the inline review comments.
  2. Validate affected bind configurations, supported package managers, and both Phoronix execution modes.
File Description
script/​run-apptainer-container/​customize.py Selects image repositories independently of fakeroot.
script/​README.md Refreshes the last-updated timestamp.
script/​get-phoronix-test-suite/​run.sh Adds system-PHP reuse for portable installation.
script/​get-generic-sys-util/​meta.yaml Adds FFTW version detection and output declaration.
script/​get-apptainer/​install-ubuntu.sh Adds an AppArmor user-namespace allowance.
script/​build-apptainerfile/​meta.yaml Maps bind input to the container environment.
script/​build-apptainerfile/​customize.py Generates bind destinations during image setup.
script/​build-apptainer-image/​customize.py Forwards bind mounts to image builds.
script/​benchmark-program-phoronix/​run.sh Isolates PTS configuration and redirects benchmark input.

Review effort: Balanced

Comment thread script/build-apptainerfile/customize.py Resolved
Comment thread script/build-apptainerfile/customize.py Resolved
# Input mapping
input_mapping:
base_image: MLC_APPTAINER_IMAGE_BASE
bind: MLC_APPTAINER_BIND_MOUNTS
Comment thread script/get-apptainer/install-ubuntu.sh Resolved
Comment thread script/get-generic-sys-util/meta.yaml Resolved
Comment thread script/get-phoronix-test-suite/run.sh Resolved
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

⚠️ This PR modifies automation/ — the frozen engine copy

The MLC script automation engine now lives in mlcflow and ships bundled with it. The copy in this repo is kept only as a fallback for mlcflow <= 1.2.9, and is ignored entirely by mlcflow >= 1.3.0.

A change here will not reach anyone running a current mlcflow. Engine changes belong in a PR against mlcflow — see automation/README.md.

This is a warning, not a block: fixes aimed at the fallback copy are still legitimate while it ships.

…hdata cap for rgat, sox-ng version detection; drop build_bind option

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.

🟡 Changes recommended

Unresolved critical issues omit requested Apptainer mounts during definition generation and cause FFTW detection to fail on supported non-Debian systems.

6 open issues
2 previously missed issues

In code that hasn't changed since last review

Medium severity Quote bind specifications containing spaces

script/​build-apptainer-image/​customize.py:88

A bind such as /mnt/compiler builds:/toolchain passes the existence check but is split into multiple arguments when script/build-apptainer-image/run.sh:5 evaluates the assembled command. Apptainer receives a truncated bind source and an extra positional argument instead of the requested mount. Fix: Shell-quote each complete bind specification before adding it to build_opts.

Medium severity Normalize the FFTW version output key

script/​get-generic-sys-util/​meta.yaml:571

script/get-generic-sys-util/customize.py:131,158 derives the version key directly from MLC_SYS_UTIL_NAME.upper(), producing MLC_LIBFFTW3-DEV_VERSION rather than the declared MLC_LIBFFTW3_DEV_VERSION. The exact-key filtering in automation/script/module.py:5997–5998 therefore omits the detected version from the returned/cache environment. Fix: Normalize the internal utility name and matching state key to libfftw3_dev, retaining the package names; the replacement also includes the package-manager probe correction noted above.

4 resolved since last review

Review effort: Balanced

Comment on lines +287 to +288
bind_dests = get_bind_destinations(
env.get('MLC_APPTAINER_BIND_MOUNTS', []))
Comment thread script/get-generic-sys-util/meta.yaml Resolved

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.

🟡 Changes recommended

Unresolved critical issues allow bind specifications to execute host-side shell commands and permit installation to overwrite administrator-managed AppArmor profiles with unconfined policy.

7 open issues
1 previously missed issue

In code that hasn't changed since last review

High severity Preserve existing AppArmor restrictions when enabling user namespaces

script/​get-apptainer/​install-ubuntu.sh:16

This truncates an existing AppArmor profile and replaces it with an unconfined one whenever the file lacks a literal userns, line. An administrator-maintained confined profile, or a profile granting user namespaces through an include, satisfies that condition too, so installing Apptainer can silently discard its restrictions and change its executable attachments. Preserve the existing profile and add only the required ABI/userns permission, or require explicit opt-in before replacing administrator policy.

1 resolved since last review

Review effort: Balanced

Comment thread script/build-apptainerfile/customize.py Resolved

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.

🔵 Needs a closer look

The PHP reuse probe can select an installation missing mandatory PTS extensions and bypass the usable fallback, while the FFTW version-key mismatch prevents the detected version from being exported or cached.

5 open issues
2 resolved since last review

Review effort: Balanced

…dev: per-PM version probe and env key fix; apptainer AppArmor profile covers CLI

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.

🔵 Needs a closer look

Human assessment is needed to evaluate non-root cache permissions, bind-source handling, and Phoronix dependency and portability regressions across deployment environments.

2 open issues
3 resolved since last review

Review effort: Balanced

# Conflicts:
#	.github/workflows/run_tests_on_modified_meta_with_secrets.yml
#	automation/script/apptainer.py
@arjunsuresh arjunsuresh changed the title Apptainer, phoronix fixes Apptainer, phoronix fixes, GH action cleanup Nov 6, 2026
@arjunsuresh
arjunsuresh merged commit 6b341f7 into mlcommons:main Nov 6, 2026
156 of 160 checks passed
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