Skip to content

Conversation

@Malmahrouqi3
Copy link
Contributor

@Malmahrouqi3 Malmahrouqi3 commented Dec 16, 2025

Description

Concerning #1081 and replacing #1080,

  • Docker Readme Update: intended to update the docker hub description on the main page. It is only triggered by merged PRs modifying .github/docker_readme.md which would take about ~10 s to execute. The test for it was by merging a branch with negligible changes which yielded this workflow run.

  • Containerization: added OpenMP variants (v5.1.0-v5.1.3) via simply the argument --gpu mp, along with upgrading python 3.10->3.14. Also, I manually pushed v5.1.3 for failing recently. The test was performed by ensuring all five containerization processes (cpu(amd64&arm64), gpu-acc-amd64, gpu-acc-arm64, gpu-mp-amd64, gpu-mp-arm64) take place and would be pushed neatly to docker hub. Expected behavior is similar to this run.

  • Test Docker Containers: intended to grab the latest cpu, gpu-acc, and gpu-mp containers and run them through all tests on Phoenix weekly which should match the pace of frequent MFC release posts. The test was confirmed to behave as anticipated in this workflow run of PR [Experimental PR] Self-Hosted Container Tests #1088.

  • Docs: updated relevant docs as needed.


PR Type

Enhancement


Description

  • Add OpenMP GPU variant support alongside existing OpenACC containers

  • Introduce weekly Docker container testing workflow on Phoenix cluster

  • Update Dockerfile with Python 3.14 and INTERFACE build argument

  • Create Docker Hub readme automation and update documentation


Diagram Walkthrough

flowchart LR
  A["Docker Build Matrix"] -->|"Add OpenMP interface"| B["GPU-MP Containers"]
  A -->|"Existing OpenACC"| C["GPU-ACC Containers"]
  A -->|"CPU builds"| D["CPU Containers"]
  B -->|"Weekly test"| E["Phoenix Test Workflow"]
  C -->|"Weekly test"| E
  D -->|"Weekly test"| E
  F["docker_readme.md"] -->|"Auto-sync"| G["Docker Hub Description"]
Loading

File Walkthrough

Relevant files
Enhancement
docker.yml
Extend build matrix with OpenMP GPU variants                         

.github/workflows/docker.yml

  • Add interface parameter to build matrix for OpenACC and OpenMP
    variants
  • Extend matrix to include gpu-mp configurations for both amd64 and
    arm64
  • Pass INTERFACE build argument to Dockerfile
  • Update manifest creation to handle separate gpu-acc and gpu-mp tags
  • Add comments to clarify CPU, GPU-ACC, and GPU-OMP manifest sections
+21/-7   
Dockerfile
Add Python 3.14 and INTERFACE build support                           

.github/Dockerfile

  • Upgrade Python from 3.10 to 3.14 with alternatives configuration
  • Add INTERFACE build argument for GPU parallelization selection
  • Add deadsnakes PPA for Python 3.14 availability
  • Pass INTERFACE variable to build and test commands for GPU targets
  • Set DEBIAN_FRONTEND to noninteractive for cleaner builds
+17/-7   
docker-readme.yml
Automate Docker Hub description updates                                   

.github/workflows/docker-readme.yml

  • Create new workflow triggered on merged PRs modifying docker_readme.md
  • Use peter-evans/dockerhub-description action to sync readme to Docker
    Hub
  • Runs on ubuntu-latest with ~10 second execution time
+24/-0   
docker-test.yml
Add weekly Docker container testing workflow                         

.github/workflows/docker-test.yml

  • Create weekly scheduled workflow running every Friday at midnight UTC
  • Test three container variants on Phoenix cluster: cpu, gpu-acc, gpu-mp
  • Execute container.sh script with device and interface parameters
  • Set 480-minute timeout for comprehensive test execution
  • Include matrix strategy for parallel testing across configurations
+44/-0   
container.sh
Add Phoenix container test execution script                           

.github/workflows/phoenix/container.sh

  • New script to pull Docker containers and run MFC tests on Phoenix
  • Conditionally select gpu-mp or standard gpu container based on
    interface
  • Configure Apptainer with GPU support and scratch directory binding
  • Run dry-run test followed by full test suite with GPU-specific thread
    count
  • Support both OpenACC and OpenMP GPU interfaces
+45/-0   
Documentation
docker_readme.md
Create Docker Hub readme file                                                       

.github/docker_readme.md

  • Create new Docker Hub readme with project badges and links
  • Include status badges for tests, contributors, Slack, license, and
    codecov
  • Add DOI reference and GitHub stars badge
  • Link to official documentation and Docker usage guide
+41/-0   
docker.md
Document OpenACC and OpenMP GPU variants                                 

docs/documentation/docker.md

  • Update base image descriptions to clarify OpenACC and OpenMP variants
  • Add OpenACC (v4.3.0-latest) and OpenMP (v5.1.0-latest) release notes
  • Expand tag structure documentation to include acc/mp distinction
  • Update example tags to show gpu-acc and gpu-mp variants
  • Clarify that gpu tag refers to OpenACC-supported version
+7/-3     


CodeAnt-AI Description

Publish and test CPU/GPU images with OpenACC and OpenMP variants; switch containers to Python 3.14

What Changed

  • Docker builds now produce distinct GPU images for OpenACC and OpenMP and include the interface in image tags so users can pull explicit acc or mp GPU variants
  • CI publishes multi-arch manifests for cpu, acc-gpu, and mp-gpu images and a scheduled workflow runs weekly container tests on Phoenix (cpu and selected GPU interfaces)
  • Container images use Python 3.14 as the default python3, and the Dockerfile installs the 3.14 runtime so containers run with Python 3.14
  • Added a script and workflow steps to pull and run built Singularity/Apptainer images on Phoenix and capture logs
  • Added a Docker Hub README file update workflow to push the repository readme to Docker Hub when the readme file changes

Impact

✅ Clearer GPU image choices (OpenACC vs OpenMP)
✅ Weekly container test coverage on Phoenix
✅ Containers run with Python 3.14 by default

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Summary by CodeRabbit

  • New Features

    • GPU containers now offer selectable OpenACC/OpenMP interface variants and images built with Python 3.14.
  • Documentation

    • Docker docs updated to describe acc/mp (OpenACC/OpenMP) tag variants and example tag lines.
  • Tests

    • Added scheduled container test workflow covering CPU and multiple GPU interface configurations.
  • Chores

    • Automated Docker Hub readme updates from repository README snippets.

✏️ Tip: You can customize this high-level summary in your review settings.

Copilot AI review requested due to automatic review settings December 16, 2025 15:48
@codeant-ai
Copy link

codeant-ai bot commented Dec 16, 2025

CodeAnt AI is reviewing your PR.


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 16, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Updates to Docker build infrastructure and CI: add Python 3.14, introduce GPU interface selector (acc/mp), propagate INTERFACE through builds/tests, add Docker Hub README auto-update workflow, scheduled Docker container tests, Apptainer container runner script, and documentation/tag updates.

Changes

Cohort / File(s) Summary
Dockerfile / build args
.github/Dockerfile
Add ARG INTERFACE and ENV INTERFACE, set DEBIAN_FRONTEND=noninteractive, install deadsnakes PPA and Python 3.14, use update-alternatives for python3, add OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1, and pass INTERFACE into GPU build/test invocations.
Docker workflows (matrix + manifests)
.github/workflows/docker.yml
Expand build matrix to include interface (cpu/none, gpu/acc, gpu/mp), propagate INTERFACE to build args and tags, split GPU manifests into acc/mp variants, and generate/push corresponding tags and latest aliases.
Docker test & README workflows
.github/workflows/docker-test.yml, .github/workflows/docker-readme.yml
Add scheduled container test workflow (matrix for gpu/acc, gpu/mp, cpu/none) and a PR-close-triggered workflow to update Docker Hub README using peter-evans/dockerhub-description.
Apptainer / runtime script
.github/workflows/phoenix/container.sh
New script to build/run Apptainer SIF from Docker images, detect GPU vs CPU, compute --gpu + acc/mp options, detect GPU count via nvidia-smi, scale test threads, and run ./mfc.sh test with appropriate flags.
Docs: Docker tags
docs/documentation/docker.md
Update tag descriptions and examples to document new OpenACC (acc) and OpenMP (mp) GPU interface variants and adjust wording/structure for release/tag lines.
Docker Hub README content
.github/docker_readme.md
New markdown snippet providing project banner, badges, DOI/stars, and links intended for Docker Hub description updates.

Sequence Diagram(s)

sequenceDiagram
    participant PR as Pull Request / Scheduler
    participant GA as GitHub Actions
    participant Builder as Docker Build (buildx)
    participant Registry as Docker Hub
    participant Runner as Apptainer / Test Runner

    PR->>GA: trigger workflows (docker.yml/docker-test.yml/docker-readme.yml)
    GA->>Builder: build images (args: INTERFACE, TARGET)
    Builder-->>Registry: push image tags (cpu, gpu-acc, gpu-mp)
    GA->>Registry: create/push manifests and latest aliases
    GA->>Runner: run container tests (pull image, detect GPUs, run mfc.sh)
    Runner->>GA: upload logs / exit status
    GA->>Registry: update README (on PR close) via dockerhub-description action
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Pay attention to tag/manifest naming and correctness across acc/mp variants in .github/workflows/docker.yml.
  • Verify INTERFACE propagation and usage in .github/Dockerfile and all GPU build/test invocation points.
  • Review GPU detection and thread-scaling logic in .github/workflows/phoenix/container.sh.
  • Check workflow triggers, secrets usage, and matrix configuration in .github/workflows/docker-test.yml and .github/workflows/docker-readme.yml.

Possibly related issues

Suggested labels

Review effort 2/5

Poem

🐰
I hopped through Dockerfiles and tags,
Tuned Python, GPUs, and flags,
acc and mp in line,
Auto-reads and tests on time,
Containers hum — carrots and flags 🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Containerization Enhancements' is vague and generic, lacking specific details about the main changes such as OpenMP variants, Python 3.14 upgrade, or Docker Hub automation. Consider a more descriptive title like 'Add OpenMP GPU containers, Docker testing, and Python 3.14 upgrade' to better convey the key changes.
✅ Passed checks (2 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The PR description provides comprehensive details on changes, motivation, testing approach, and includes supporting workflow run links, covering all major sections of the template.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@codeant-ai codeant-ai bot added the size:L This PR changes 100-499 lines, ignoring generated files label Dec 16, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances MFC's containerization infrastructure by adding OpenMP GPU support, updating Docker Hub documentation automation, and implementing weekly container testing. The changes enable building GPU containers with either OpenACC or OpenMP parallelization interfaces, upgrade the Python version from 3.10 to 3.14, and establish automated workflows for maintaining Docker Hub documentation and validating container functionality.

Key Changes:

  • Added OpenMP GPU variant support (v5.1.0-v5.1.3) alongside existing OpenACC variants via --gpu mp build argument
  • Implemented automated Docker Hub README updates triggered by changes to .github/docker_readme.md
  • Created weekly container testing workflow that validates cpu, gpu-acc, and gpu-mp containers on Phoenix cluster

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
docs/documentation/docker.md Updated documentation to reflect OpenMP GPU variants and clarified version-specific base image information
.github/workflows/phoenix/container.sh Added container testing script that pulls appropriate Docker images, builds MFC with correct interface flags, and runs tests
.github/workflows/docker.yml Extended matrix to build separate OpenACC and OpenMP GPU containers, added interface argument to build process
.github/workflows/docker-test.yml Created weekly scheduled workflow to test CPU, GPU-ACC, and GPU-MP containers on Phoenix
.github/workflows/docker-readme.yml Added workflow to automatically update Docker Hub description when README is modified
.github/docker_readme.md Created Docker Hub README with project badges and documentation references
.github/Dockerfile Added INTERFACE argument, upgraded Python to 3.14, configured interface-specific build commands

@qodo-code-review
Copy link
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

1081 - Partially compliant

Compliant requirements:

  • Auto-update Docker Hub repository description from GitHub Actions (via peter-evans/dockerhub-description) based on a repo markdown file
  • Add a weekly CI test workflow to validate Docker containers on self-hosted runners
  • Update docker.yml to support OpenMP (mp) GPU variants alongside OpenACC (acc)

Non-compliant requirements:

  • Test latest-cpu linux/arm64 on macos-latest runners

Requires further human verification:

  • Confirm the weekly workflow actually runs on the intended Phoenix/self-hosted resources with GPU access and sufficient quotas
  • Confirm the built/pushed tags and manifests match what downstream users pull (latest-gpu, latest-mp-gpu, etc.) and that they contain working binaries
  • Confirm prior release tags for GPU OMP/OpenMP are pushed as intended (the PR diff mainly shows matrix+manifest logic, not historical backfill)
⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Possible Issue

The manifest push for the OpenMP GPU image appears to reference an incorrect tag variable ($TAG--mp-gpu with a double hyphen). This likely causes the manifest push to fail and/or publish the wrong tag, breaking latest-mp-gpu consumers.

# GPU Manifest (OMP)
docker manifest create $REGISTRY:$TAG-mp-gpu $REGISTRY:$TAG-gpu-mp-ubuntu-22.04 $REGISTRY:$TAG-gpu-mp-ubuntu-22.04-arm
docker manifest create $REGISTRY:latest-mp-gpu $REGISTRY:$TAG-gpu-mp-ubuntu-22.04 $REGISTRY:$TAG-gpu-mp-ubuntu-22.04-arm
docker manifest push $REGISTRY:$TAG--mp-gpu
docker manifest push $REGISTRY:latest-mp-gpu
Possible Issue

Interface selection logic is inconsistent: it checks job_interface=omp but the workflow matrix passes mp. This will skip the intended OpenMP path (wrong container tag and missing mp build option), leading to testing the wrong image/config.

if [ "$job_interface" = "omp" ]; then
    apptainer build mfc:latest-$job_device.sif docker://sbryngelson/mfc:latest-mp-$job_device
else
    apptainer build mfc:latest-$job_device.sif docker://sbryngelson/mfc:latest-$job_device
fi

CONTAINER="mfc:latest-$job_device.sif"

NV_FLAG=""
[ "$job_device" = "gpu" ] && NV_FLAG="--nv"

# unset LD_PRELOAD

apptainer exec $NV_FLAG --fakeroot --writable-tmpfs \
  --bind "$SCRATCH_DIR":/scratch \
  --env job_slug="$job_slug" \
  --env job_device="$job_device" \
  "$CONTAINER" \
  bash -c 'cd /opt/MFC &&

build_opts=""
if [ "$job_device" = "gpu" ]; then
    build_opts="--gpu"
    if [ "$job_interface" = "omp" ]; then
      build_opts+=" mp"
    elif [ "$job_interface" = "acc" ]; then
      build_opts+=" acc"
    fi
Workflow Logic

The workflow triggers on pull_request: closed for changes to docker_readme.md but does not gate execution on the PR being merged. This can update Docker Hub descriptions from closed/unmerged PRs; add a merged check (e.g., if: github.event.pull_request.merged == true).

on:
  pull_request:
    types: [closed]
    paths:
      - '.github/docker_readme.md'

Comment on lines +12 to 34
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y software-properties-common wget && \
add-apt-repository ppa:deadsnakes/ppa

RUN apt-get update -y && \
if [ "$TARGET" != "gpu" ]; then \
apt-get install -y \
build-essential git make cmake gcc g++ gfortran bc\
python3 python3-venv python3-pip \
build-essential git make cmake gcc g++ gfortran bc \
python3.14 python3.14-venv \
openmpi-bin libopenmpi-dev libfftw3-dev \
mpich libmpich-dev; \
else \
apt-get install -y \
build-essential git make cmake bc\
python3 python3-venv python3-pip \
build-essential git make cmake bc \
python3.14 python3.14-venv \
libfftw3-dev \
openmpi-bin libopenmpi-dev; \
fi && \
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.14 1 && \
update-alternatives --set python3 /usr/bin/python3.14 && \
python3 --version && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion: Combine the two RUN instructions for apt-get operations into a single one to reduce Docker image layers and optimize image size. [general, importance: 6]

Suggested change
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y software-properties-common wget && \
add-apt-repository ppa:deadsnakes/ppa
RUN apt-get update -y && \
if [ "$TARGET" != "gpu" ]; then \
apt-get install -y \
build-essential git make cmake gcc g++ gfortran bc\
python3 python3-venv python3-pip \
build-essential git make cmake gcc g++ gfortran bc \
python3.14 python3.14-venv \
openmpi-bin libopenmpi-dev libfftw3-dev \
mpich libmpich-dev; \
else \
apt-get install -y \
build-essential git make cmake bc\
python3 python3-venv python3-pip \
build-essential git make cmake bc \
python3.14 python3.14-venv \
libfftw3-dev \
openmpi-bin libopenmpi-dev; \
fi && \
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.14 1 && \
update-alternatives --set python3 /usr/bin/python3.14 && \
python3 --version && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y software-properties-common wget && \
add-apt-repository ppa:deadsnakes/ppa && \
apt-get update -y && \
if [ "$TARGET" != "gpu" ]; then \
apt-get install -y \
build-essential git make cmake gcc g++ gfortran bc \
python3.14 python3.14-venv \
openmpi-bin libopenmpi-dev libfftw3-dev \
mpich libmpich-dev; \
else \
apt-get install -y \
build-essential git make cmake bc \
python3.14 python3.14-venv \
libfftw3-dev \
openmpi-bin libopenmpi-dev; \
fi && \
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.14 1 && \
update-alternatives --set python3 /usr/bin/python3.14 && \
python3 --version && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

@codeant-ai
Copy link

codeant-ai bot commented Dec 16, 2025

Nitpicks 🔍

🔒 No security issues identified
⚡ Recommended areas for review

  • Unquoted shell args / word-splitting
    Several command invocations interpolate variables directly into the apptainer exec command (e.g. $NV_FLAG and positional args). If those variables contain spaces or are empty this can lead to argument splitting, unexpected extra arguments or incorrect command invocation. This is both a correctness and safety risk (injection/incorrect flags).

  • Missing validation of required env vars
    Variables like SCRATCH_DIR, job_slug, and job_device are used directly (binds and envs). If any are unset/empty, apptainer/exec call or bind option can fail or behave unexpectedly. The script does not validate or provide safe defaults.

  • Fragile GPU detection
    The logic assumes nvidia-smi exists and that gpu_count is >= 1. If nvidia-smi is missing or returns 0 GPUs, the seq call will be invoked with a negative end (-1) and fail, possibly aborting the script or leaving device_opts and n_test_threads inconsistent.

  • GPU interface handling
    The new invocations pass --gpu $INTERFACE unguarded. If INTERFACE is empty or unset, the next token (-j) may be consumed as the interface argument, or --gpu may be passed without a proper value. This can produce incorrect command-line arguments to ./mfc.sh and cause build/test failures or unexpected behavior. Consider guarding inclusion of the interface argument or handling empty values explicitly.

  • Base image assumption
    The Dockerfile adds the deadsnakes PPA and uses apt-get/add-apt-repository, which only work on Debian/Ubuntu-derived images. If BASE_IMAGE is not Debian/Ubuntu (eg. alpine, scratch, or other distros), these RUN steps will fail. Ensure the CI/build passes a compatible BASE_IMAGE or gate these steps based on the base distribution.

ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y software-properties-common wget && \
add-apt-repository ppa:deadsnakes/ppa
Copy link

Choose a reason for hiding this comment

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

Suggestion: The separate RUN that installs software-properties-common and calls add-apt-repository leaves apt lists in that layer (increasing image size); combine the repository add/update and cleanup in the same RUN so package lists are removed and not persisted in a previous layer. [resource leak]

Severity Level: Minor ⚠️

Suggested change
add-apt-repository ppa:deadsnakes/ppa
add-apt-repository ppa:deadsnakes/ppa && \
apt-get update -y && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
Why it matters? ⭐

The separate RUN that adds the PPA leaves apt lists in that layer increasing
image size. Cleaning up apt lists in the same RUN (or combining with the
subsequent package-install RUN) prevents persisting package metadata into
an earlier layer and reduces final image size. The suggested change is a
valid optimization and doesn't alter runtime behavior.

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** .github/Dockerfile
**Line:** 15:15
**Comment:**
	*Resource Leak: The separate RUN that installs `software-properties-common` and calls `add-apt-repository` leaves apt lists in that layer (increasing image size); combine the repository add/update and cleanup in the same RUN so package lists are removed and not persisted in a previous layer.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.

cd /opt/MFC && \
if [ "$TARGET" = "gpu" ]; then \
./mfc.sh build --gpu -j $(nproc); \
./mfc.sh build --gpu $INTERFACE -j $(nproc); \
Copy link

Choose a reason for hiding this comment

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

Suggestion: Unquoted shell variable expansion for INTERFACE in the build command can cause word-splitting or command injection if the argument contains spaces or shell metacharacters; quote the variable to ensure it's treated as a single argument. [security]

Severity Level: Critical 🚨

Suggested change
./mfc.sh build --gpu $INTERFACE -j $(nproc); \
./mfc.sh build --gpu "$INTERFACE" -j $(nproc); \
Why it matters? ⭐

Quoting "$INTERFACE" in the build command prevents word-splitting and
limits accidental/intentional argument injection when the variable
contains spaces or shell metacharacters. This is a straightforward,
correct hardening for shell invocations and doesn't change logic.

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** .github/Dockerfile
**Line:** 52:52
**Comment:**
	*Security: Unquoted shell variable expansion for `INTERFACE` in the build command can cause word-splitting or command injection if the argument contains spaces or shell metacharacters; quote the variable to ensure it's treated as a single argument.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.

RUN cd /opt/MFC && \
if [ "$TARGET" = "gpu" ]; then \
./mfc.sh test -a --dry-run --gpu -j $(nproc); \
./mfc.sh test -a --dry-run --gpu $INTERFACE -j $(nproc); \
Copy link

Choose a reason for hiding this comment

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

Suggestion: Unquoted shell variable expansion for INTERFACE in the test command can cause word-splitting or command injection; quote the variable to pass it safely as a single argument to the script. [security]

Severity Level: Critical 🚨

Suggested change
./mfc.sh test -a --dry-run --gpu $INTERFACE -j $(nproc); \
./mfc.sh test -a --dry-run --gpu "$INTERFACE" -j $(nproc); \
Why it matters? ⭐

Same as the build invocation: quoting "$INTERFACE" ensures the test command
receives a single, literal argument and avoids subtle failures or command
injection vectors. It's a minimal, correct security improvement.

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** .github/Dockerfile
**Line:** 59:59
**Comment:**
	*Security: Unquoted shell variable expansion for `INTERFACE` in the test command can cause word-splitting or command injection; quote the variable to pass it safely as a single argument to the script.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.

Comment on lines +38 to +40
gpu_count=$(nvidia-smi -L | wc -l) # number of GPUs on node
gpu_ids=$(seq -s " " 0 $(($gpu_count-1))) # 0,1,2,...,gpu_count-1
device_opts="-g $gpu_ids"
Copy link

Choose a reason for hiding this comment

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

Suggestion: If nvidia-smi is missing or returns 0 GPUs, the current arithmetic and seq usage can produce invalid ranges or empty values and cause runtime errors; validate gpu_count is a positive integer before using it (and fall back to a safe default), and use shell arithmetic $((...)) instead of legacy expr for clarity. [possible bug]

Severity Level: Critical 🚨

Suggested change
gpu_count=$(nvidia-smi -L | wc -l) # number of GPUs on node
gpu_ids=$(seq -s " " 0 $(($gpu_count-1))) # 0,1,2,...,gpu_count-1
device_opts="-g $gpu_ids"
gpu_count=$(nvidia-smi -L 2>/dev/null | wc -l)
if [ -z "$gpu_count" ] || [ "$gpu_count" -le 0 ]; then
gpu_count=1
fi
gpu_ids=$(seq -s " " 0 $((gpu_count-1)))
device_opts="-g $gpu_ids"
n_test_threads=$((gpu_count * 2))
Why it matters? ⭐

Valid and useful. If nvidia-smi is missing or reports zero, the existing code can produce bad seq ranges or empty GPU lists. The suggested checks and switching to POSIX arithmetic reduce failures and make intent clearer.

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** .github/workflows/phoenix/container.sh
**Line:** 38:40
**Comment:**
	*Possible Bug: If `nvidia-smi` is missing or returns 0 GPUs, the current arithmetic and `seq` usage can produce invalid ranges or empty values and cause runtime errors; validate `gpu_count` is a positive integer before using it (and fall back to a safe default), and use shell arithmetic `$((...))` instead of legacy `expr` for clarity.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.

@codeant-ai
Copy link

codeant-ai bot commented Dec 16, 2025

CodeAnt AI finished reviewing your PR.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🧹 Nitpick comments (1)
.github/workflows/phoenix/container.sh (1)

39-41: Modernize arithmetic expressions.

The script uses old-style command substitution with backticks and expr.

Apply this diff for more modern bash syntax:

-    gpu_ids=$(seq -s " " 0 $(($gpu_count-1))) # 0,1,2,...,gpu_count-1
+    gpu_ids=$(seq -s " " 0 $((gpu_count-1))) # 0,1,2,...,gpu_count-1
     device_opts="-g $gpu_ids"
-    n_test_threads=`expr $gpu_count \* 2`
+    n_test_threads=$((gpu_count * 2))
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8ae42aa and c6e7bef.

📒 Files selected for processing (7)
  • .github/Dockerfile (3 hunks)
  • .github/docker_readme.md (1 hunks)
  • .github/workflows/docker-readme.yml (1 hunks)
  • .github/workflows/docker-test.yml (1 hunks)
  • .github/workflows/docker.yml (4 hunks)
  • .github/workflows/phoenix/container.sh (1 hunks)
  • docs/documentation/docker.md (1 hunks)
🧰 Additional context used
🧠 Learnings (5)
📚 Learning: 2025-11-24T21:50:46.909Z
Learnt from: CR
Repo: MFlowCode/MFC PR: 0
File: .cursor/rules/mfc-agent-rules.mdc:0-0
Timestamp: 2025-11-24T21:50:46.909Z
Learning: Read the full MFC codebase and documentation before changing code to understand the project context and architecture

Applied to files:

  • .github/docker_readme.md
📚 Learning: 2025-11-24T21:50:46.909Z
Learnt from: CR
Repo: MFlowCode/MFC PR: 0
File: .cursor/rules/mfc-agent-rules.mdc:0-0
Timestamp: 2025-11-24T21:50:46.909Z
Learning: Draft a step-by-step plan before making changes; build after each step using `./mfc.sh build -t pre_process simulation -j $(nproc)`

Applied to files:

  • .github/workflows/phoenix/container.sh
  • .github/Dockerfile
📚 Learning: 2025-11-24T21:50:46.909Z
Learnt from: CR
Repo: MFlowCode/MFC PR: 0
File: .cursor/rules/mfc-agent-rules.mdc:0-0
Timestamp: 2025-11-24T21:50:46.909Z
Learning: After each successful build step, run focused tests using `./mfc.sh test -j $(nproc) -f EA8FA07E -t 9E2CA336` instead of running all tests

Applied to files:

  • .github/workflows/phoenix/container.sh
  • .github/Dockerfile
📚 Learning: 2025-11-24T21:50:46.909Z
Learnt from: CR
Repo: MFlowCode/MFC PR: 0
File: .cursor/rules/mfc-agent-rules.mdc:0-0
Timestamp: 2025-11-24T21:50:46.909Z
Learning: Compile with Cray `ftn` or NVIDIA `nvfortran` for GPU offloading; also build CPU-only with GNU `gfortran` and Intel `ifx`/`ifort` for portability

Applied to files:

  • .github/workflows/phoenix/container.sh
  • docs/documentation/docker.md
  • .github/Dockerfile
📚 Learning: 2025-11-24T21:50:16.713Z
Learnt from: CR
Repo: MFlowCode/MFC PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T21:50:16.713Z
Learning: Applies to src/simulation/**/*.{fpp,f90} : Ensure GPU code compiles with Cray ftn, NVIDIA nvfortran, GNU gfortran, and Intel ifx/ifort compilers

Applied to files:

  • .github/workflows/phoenix/container.sh
🪛 actionlint (1.7.9)
.github/workflows/docker-test.yml

15-15: label "gt" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2025", "windows-2022", "windows-11-arm", "ubuntu-slim", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-24.04-arm", "ubuntu-22.04", "ubuntu-22.04-arm", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-26-xlarge", "macos-26", "macos-15-intel", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file

(runner-label)


19-19: label "gt" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2025", "windows-2022", "windows-11-arm", "ubuntu-slim", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-24.04-arm", "ubuntu-22.04", "ubuntu-22.04-arm", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-26-xlarge", "macos-26", "macos-15-intel", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file

(runner-label)


23-23: label "gt" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2025", "windows-2022", "windows-11-arm", "ubuntu-slim", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-24.04-arm", "ubuntu-22.04", "ubuntu-22.04-arm", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-26-xlarge", "macos-26", "macos-15-intel", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file

(runner-label)

🪛 markdownlint-cli2 (0.18.1)
.github/docker_readme.md

10-10: Images should have alternate text (alt text)

(MD045, no-alt-text)


13-13: Images should have alternate text (alt text)

(MD045, no-alt-text)


16-16: Images should have alternate text (alt text)

(MD045, no-alt-text)


19-19: Images should have alternate text (alt text)

(MD045, no-alt-text)


22-22: Images should have alternate text (alt text)

(MD045, no-alt-text)


25-25: Images should have alternate text (alt text)

(MD045, no-alt-text)


32-32: Images should have alternate text (alt text)

(MD045, no-alt-text)


35-35: Images should have alternate text (alt text)

(MD045, no-alt-text)

🪛 Shellcheck (0.11.0)
.github/workflows/phoenix/container.sh

[warning] 3-3: job_interface is referenced but not assigned.

(SC2154)


[warning] 4-4: job_device is referenced but not assigned.

(SC2154)


[warning] 18-18: job_slug is referenced but not assigned.

(SC2154)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (17)
  • GitHub Check: Github (ubuntu, mpi, debug, false)
  • GitHub Check: Github (ubuntu, mpi, debug, true)
  • GitHub Check: Oak Ridge | Frontier (cpu)
  • GitHub Check: Georgia Tech | Phoenix (cpu)
  • GitHub Check: Oak Ridge | Frontier (gpu-acc)
  • GitHub Check: Georgia Tech | Phoenix (gpu-acc)
  • GitHub Check: Github (macos, mpi, no-debug, false)
  • GitHub Check: Oak Ridge | Frontier (gpu-omp)
  • GitHub Check: Github (ubuntu, no-mpi, single, no-debug, false)
  • GitHub Check: Github (ubuntu, mpi, no-debug, false)
  • GitHub Check: Github (ubuntu, mpi, no-debug, true)
  • GitHub Check: Github (macos, mpi, debug, false)
  • GitHub Check: Georgia Tech | Phoenix (gpu-omp)
  • GitHub Check: Coverage Test on CodeCov
  • GitHub Check: Code Cleanliness Check
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: Build & Publish
🔇 Additional comments (6)
docs/documentation/docker.md (1)

151-171: LGTM!

The documentation clearly explains the new OpenACC/OpenMP distinctions and tag structure. The examples are helpful and align with the container build changes.

.github/workflows/docker.yml (1)

21-25: LGTM! Interface-based matrix expansion is well-structured.

The expanded matrix with interface field properly supports the new OpenACC/OpenMP distinction for GPU builds. The separation into distinct configurations (cpu/none, gpu/acc, gpu/mp) aligns well with the documentation and downstream workflows.

.github/Dockerfile (3)

5-5: LGTM! INTERFACE parameter properly propagated.

The INTERFACE build argument is correctly declared, propagated as an environment variable, and used in both build and test commands. This properly supports the OpenACC/OpenMP distinction introduced in this PR.

Also applies to: 42-42, 52-52, 59-59


37-37: Good addition of OpenMPI environment variable.

Adding OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 alongside the existing OMPI_ALLOW_RUN_AS_ROOT=1 properly suppresses OpenMPI warnings when running as root in containers.


21-21: Verify Python 3.14 is released and production-ready.

The Dockerfile upgrades to Python 3.14. Confirm this version is officially released and stable enough for your use case before merging, as Python 3.14's availability and production readiness cannot be determined without current information.

Also applies to: 27-27, 31-33

.github/workflows/docker-test.yml (1)

32-33: Node 16 forced in workflow is already ineffective.

The workflow forces Node 16 via ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION: node16, but actions/checkout@v4 (the only action in use) requires and will run on Node 20 regardless. The override has no effect on this action. Remove the unnecessary overrides if they're not needed for the self-hosted runner's other operations.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

4 issues found across 7 files

Prompt for AI agents (all 4 issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name=".github/docker_readme.md">

<violation number="1" location=".github/docker_readme.md:4">
P2: Missing closing `&lt;/p&gt;` tag for the paragraph element opened at line 29. This unclosed HTML tag could cause rendering issues on Docker Hub. Add `&lt;/p&gt;` after the closing `&lt;/a&gt;` tag and before the blank lines.</violation>
</file>

<file name=".github/workflows/docker-readme.yml">

<violation number="1" location=".github/workflows/docker-readme.yml:10">
P1: Missing merge check: This workflow will run for all closed PRs, not just merged ones. Add a condition to ensure it only runs when the PR is actually merged.</violation>
</file>

<file name=".github/workflows/docker.yml">

<violation number="1" location=".github/workflows/docker.yml:146">
P1: Typo: Double hyphen `--` in manifest push command. The manifest was created as `$TAG-mp-gpu` but the push references `$TAG--mp-gpu`, which will cause the workflow to fail.</violation>
</file>

<file name=".github/workflows/docker-test.yml">

<violation number="1" location=".github/workflows/docker-test.yml:22">
P1: Interface value mismatch: workflow passes `mp` but `container.sh` checks for `omp`. This will cause the OpenMP-specific logic to be skipped, resulting in incorrect container selection and build options.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

<p align="center">
<a href="http://mflowcode.github.io/">
<img src="https://mflowcode.github.io/res/banner.png" alt="MFC Banner" width="500"/>
</a>
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Dec 16, 2025

Choose a reason for hiding this comment

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

P2: Missing closing </p> tag for the paragraph element opened at line 29. This unclosed HTML tag could cause rendering issues on Docker Hub. Add </p> after the closing </a> tag and before the blank lines.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/docker_readme.md, line 4:

<comment>Missing closing `&lt;/p&gt;` tag for the paragraph element opened at line 29. This unclosed HTML tag could cause rendering issues on Docker Hub. Add `&lt;/p&gt;` after the closing `&lt;/a&gt;` tag and before the blank lines.</comment>

<file context>
@@ -0,0 +1,41 @@
+&lt;p align=&quot;center&quot;&gt;
+  &lt;a href=&quot;http://mflowcode.github.io/&quot;&gt;
+    &lt;img src=&quot;https://mflowcode.github.io/res/banner.png&quot; alt=&quot;MFC Banner&quot; width=&quot;500&quot;/&gt;
+  &lt;/a&gt;
+&lt;/p&gt;
+
</file context>
Fix with Cubic

- '.github/docker_readme.md'

jobs:
Container:
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Dec 16, 2025

Choose a reason for hiding this comment

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

P1: Missing merge check: This workflow will run for all closed PRs, not just merged ones. Add a condition to ensure it only runs when the PR is actually merged.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/docker-readme.yml, line 10:

<comment>Missing merge check: This workflow will run for all closed PRs, not just merged ones. Add a condition to ensure it only runs when the PR is actually merged.</comment>

<file context>
@@ -0,0 +1,24 @@
+      - &#39;.github/docker_readme.md&#39;
+
+jobs:
+  Container:
+    runs-on: ubuntu-latest
+    steps:
</file context>

✅ Addressed in 4c9a650

docker manifest create $REGISTRY:$TAG-mp-gpu $REGISTRY:$TAG-gpu-mp-ubuntu-22.04 $REGISTRY:$TAG-gpu-mp-ubuntu-22.04-arm
docker manifest create $REGISTRY:latest-mp-gpu $REGISTRY:$TAG-gpu-mp-ubuntu-22.04 $REGISTRY:$TAG-gpu-mp-ubuntu-22.04-arm
docker manifest push $REGISTRY:$TAG--mp-gpu
docker manifest push $REGISTRY:latest-mp-gpu
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Dec 16, 2025

Choose a reason for hiding this comment

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

P1: Typo: Double hyphen -- in manifest push command. The manifest was created as $TAG-mp-gpu but the push references $TAG--mp-gpu, which will cause the workflow to fail.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/docker.yml, line 146:

<comment>Typo: Double hyphen `--` in manifest push command. The manifest was created as `$TAG-mp-gpu` but the push references `$TAG--mp-gpu`, which will cause the workflow to fail.</comment>

<file context>
@@ -125,8 +130,17 @@ jobs:
+          docker manifest create $REGISTRY:$TAG-mp-gpu $REGISTRY:$TAG-gpu-mp-ubuntu-22.04 $REGISTRY:$TAG-gpu-mp-ubuntu-22.04-arm
+          docker manifest create $REGISTRY:latest-mp-gpu $REGISTRY:$TAG-gpu-mp-ubuntu-22.04 $REGISTRY:$TAG-gpu-mp-ubuntu-22.04-arm
+          docker manifest push $REGISTRY:$TAG--mp-gpu
+          docker manifest push $REGISTRY:latest-mp-gpu
</file context>

✅ Addressed in 4c9a650

- lbl: 'gt'
cluster_name: 'Georgia Tech | Phoenix'
device: 'gpu'
interface: 'mp'
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Dec 16, 2025

Choose a reason for hiding this comment

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

P1: Interface value mismatch: workflow passes mp but container.sh checks for omp. This will cause the OpenMP-specific logic to be skipped, resulting in incorrect container selection and build options.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/docker-test.yml, line 22:

<comment>Interface value mismatch: workflow passes `mp` but `container.sh` checks for `omp`. This will cause the OpenMP-specific logic to be skipped, resulting in incorrect container selection and build options.</comment>

<file context>
@@ -0,0 +1,44 @@
+          - lbl: &#39;gt&#39;
+            cluster_name: &#39;Georgia Tech | Phoenix&#39;
+            device: &#39;gpu&#39;
+            interface: &#39;mp&#39;
+          - lbl: &#39;gt&#39;
+            cluster_name: &#39;Georgia Tech | Phoenix&#39;
</file context>
Fix with Cubic

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (4)
.github/workflows/docker.yml (1)

136-146: Tag naming inconsistency between ACC and MP variants.

ACC manifests use $TAG-gpu / latest-gpu, while MP manifests use $TAG-mp-gpu / latest-mp-gpu. This asymmetry could cause confusion—users might expect latest-gpu-acc and latest-gpu-mp as a parallel scheme.

If backward compatibility with existing gpu tags is required, this is acceptable. Otherwise, consider standardizing to $TAG-gpu-acc / latest-gpu-acc for ACC as well.

.github/workflows/phoenix/container.sh (3)

1-7: Add error handling and document expected environment variables.

The script lacks set -e (or set -euo pipefail) to fail fast on errors. If apptainer build fails, subsequent commands will run against a missing/broken image.

Additionally, job_interface and job_device are expected as environment variables from the calling workflow but should be validated.

Apply this diff:

 #!/bin/bash
+set -euo pipefail
+
+# Expected environment variables from calling workflow:
+# job_device: cpu or gpu
+# job_interface: none, acc, or mp
+# job_slug: test identifier
+# SCRATCH_DIR: scratch directory path
+
+: "${job_device:?job_device is required}"
+: "${job_interface:?job_interface is required}"
 
 if [ "$job_interface" = "mp" ]; then

16-20: Critical: job_interface not passed into the container.

The apptainer exec command passes job_slug and job_device via --env, but job_interface is missing. The inner script (lines 26-30) references $job_interface which will be empty/unset inside the container, causing the GPU interface selection to fail silently.

Apply this diff:

 apptainer exec $NV_FLAG --fakeroot --writable-tmpfs \
   --bind "$SCRATCH_DIR":/scratch \
   --env job_slug="$job_slug" \
   --env job_device="$job_device" \
+  --env job_interface="$job_interface" \
   "$CONTAINER" \

37-42: Add validation for GPU detection to prevent runtime errors.

If nvidia-smi is unavailable or returns 0 GPUs, the seq command will produce invalid ranges (e.g., seq 0 -1) and expr will fail. This could cause cryptic failures on nodes without expected GPU configuration.

Apply this diff:

 if [ "$job_device" = "gpu" ]; then
-    gpu_count=$(nvidia-smi -L | wc -l)        # number of GPUs on node
-    gpu_ids=$(seq -s " " 0 $(($gpu_count-1))) # 0,1,2,...,gpu_count-1
+    gpu_count=$(nvidia-smi -L 2>/dev/null | wc -l) || gpu_count=0
+    if [ "$gpu_count" -le 0 ]; then
+        echo "Error: No GPUs detected" >&2
+        exit 1
+    fi
+    gpu_ids=$(seq -s " " 0 $((gpu_count - 1)))
     device_opts="-g $gpu_ids"
-    n_test_threads=`expr $gpu_count \* 2`
+    n_test_threads=$((gpu_count * 2))
 fi
🧹 Nitpick comments (1)
.github/workflows/phoenix/container.sh (1)

44-45: $device_opts may be unset for CPU runs causing potential issues.

When job_device is cpu, the device_opts variable is never initialized, and its unquoted expansion on line 44 could cause issues with set -u if adopted. Initialize it to an empty string.

Add initialization before the conditional:

 n_test_threads=8
+device_opts=""
 
 if [ "$job_device" = "gpu" ]; then
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c6e7bef and 964ddb9.

📒 Files selected for processing (3)
  • .github/workflows/docker-readme.yml (1 hunks)
  • .github/workflows/docker.yml (4 hunks)
  • .github/workflows/phoenix/container.sh (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/docker-readme.yml
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-11-24T21:50:46.909Z
Learnt from: CR
Repo: MFlowCode/MFC PR: 0
File: .cursor/rules/mfc-agent-rules.mdc:0-0
Timestamp: 2025-11-24T21:50:46.909Z
Learning: Draft a step-by-step plan before making changes; build after each step using `./mfc.sh build -t pre_process simulation -j $(nproc)`

Applied to files:

  • .github/workflows/phoenix/container.sh
📚 Learning: 2025-11-24T21:50:46.909Z
Learnt from: CR
Repo: MFlowCode/MFC PR: 0
File: .cursor/rules/mfc-agent-rules.mdc:0-0
Timestamp: 2025-11-24T21:50:46.909Z
Learning: After each successful build step, run focused tests using `./mfc.sh test -j $(nproc) -f EA8FA07E -t 9E2CA336` instead of running all tests

Applied to files:

  • .github/workflows/phoenix/container.sh
📚 Learning: 2025-11-24T21:50:46.909Z
Learnt from: CR
Repo: MFlowCode/MFC PR: 0
File: .cursor/rules/mfc-agent-rules.mdc:0-0
Timestamp: 2025-11-24T21:50:46.909Z
Learning: Compile with Cray `ftn` or NVIDIA `nvfortran` for GPU offloading; also build CPU-only with GNU `gfortran` and Intel `ifx`/`ifort` for portability

Applied to files:

  • .github/workflows/phoenix/container.sh
🪛 Shellcheck (0.11.0)
.github/workflows/phoenix/container.sh

[warning] 3-3: job_interface is referenced but not assigned.

(SC2154)


[warning] 4-4: job_device is referenced but not assigned.

(SC2154)


[warning] 18-18: job_slug is referenced but not assigned.

(SC2154)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
  • GitHub Check: Code Cleanliness Check
  • GitHub Check: Github (macos, mpi, no-debug, false)
  • GitHub Check: Github (ubuntu, mpi, debug, false)
  • GitHub Check: Github (macos, mpi, debug, false)
  • GitHub Check: Oak Ridge | Frontier (gpu-acc)
  • GitHub Check: Github (ubuntu, mpi, no-debug, true)
  • GitHub Check: Github (ubuntu, mpi, no-debug, false)
  • GitHub Check: Github (ubuntu, no-mpi, single, no-debug, false)
  • GitHub Check: Github (ubuntu, mpi, debug, true)
  • GitHub Check: Coverage Test on CodeCov
  • GitHub Check: Build & Publish
🔇 Additional comments (3)
.github/workflows/docker.yml (3)

21-25: LGTM! Matrix configuration correctly defines GPU interface variants.

The matrix properly introduces the interface parameter distinguishing between acc (OpenACC) and mp (OpenMP) GPU variants alongside the CPU configuration.


87-96: LGTM! INTERFACE build argument properly propagated for CPU builds.

The INTERFACE variable is correctly passed to the Dockerfile.


106-116: LGTM! GPU build correctly includes interface in tags.

The tag format $TAG-gpu-$interface-$runner (e.g., v5.1.3-gpu-acc-ubuntu-22.04) clearly identifies the variant.

@codecov
Copy link

codecov bot commented Dec 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 44.08%. Comparing base (8ae42aa) to head (964ddb9).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1092   +/-   ##
=======================================
  Coverage   44.08%   44.08%           
=======================================
  Files          71       71           
  Lines       20332    20332           
  Branches     1981     1981           
=======================================
  Hits         8963     8963           
  Misses      10236    10236           
  Partials     1133     1133           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Malmahrouqi3
Copy link
Contributor Author

due to inactivity

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

Labels

Review effort 4/5 size:L This PR changes 100-499 lines, ignoring generated files

Development

Successfully merging this pull request may close these issues.

1 participant