Skip to content

Add missing apptainer dispatch path for mlca / mlc apptainer run - #254

Merged
arjunsuresh merged 10 commits into
devfrom
copilot/support-mlca-mlc-apptainer-run
Jul 4, 2026
Merged

Add missing apptainer dispatch path for mlca / mlc apptainer run#254
arjunsuresh merged 10 commits into
devfrom
copilot/support-mlca-mlc-apptainer-run

Conversation

Copilot AI commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

mlca support was incomplete because ScriptAction lacked a concrete apptainer dispatch path, so mlc apptainer run was not wired equivalently to docker flow. This PR adds the missing routing in mlcflow and aligns help text/docs for the action.

✅ PR Checklist

  • Target branch is dev

📌 Note: PRs must be raised against dev. Do not commit directly to main.

  • What changed
    • CLI → action wiring
      • Added ScriptAction.apptainer() / apptainer_run() delegation to call_script_module_function("apptainer", run_args).
    • Automation dispatch
      • Added explicit elif function_name == "apptainer" branch in call_script_module_function(...) to invoke automation_instance.apptainer(run_args).
    • Docs/help alignment
      • Updated script action listings/help text to include apptainer support.
    • Regression coverage
      • Added focused unit test for apptainer delegation path.
# script_action.py
elif function_name == "apptainer":
    result = automation_instance.apptainer(run_args)

def apptainer_run(self, run_args):
    return self.call_script_module_function("apptainer", run_args)

✅ Testing & CI

  • Have tested the changes in my local environment, else have properly conveyed in the PR description
  • The change includes a GitHub Action to test the script(if it is possible to be added).
  • No existing GitHub Actions are failing because of this change.

📚 Documentation

  • README or help docs are updated for new features or changes.
  • CLI help messages are meaningful and complete.

📁 File Hygiene & Output Handling

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

🛡️ Safety & Security

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

🙌 Contribution Hygiene

  • PR title and description are concise and clearly state the purpose of the change.
  • Related issues (if any) are properly referenced using Fixes # or Closes #.
  • All reviewer feedback has been addressed.

@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown

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

@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown

🤖 AI PR Review Summary\n\nThis PR adds support for an 'apptainer' action to the script target in the MLCFlow CLI. It updates the CLI help table, extends the ScriptAction class with apptainer and apptainer_run methods that delegate to a script module function, and includes a unit test to verify the delegation. The changes are low risk, primarily additive, and follow the existing design pattern used for the 'docker' action. No major design issues detected.

@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown

🤖 AI PR Review Summary\n\nThis PR adds support for a new 'apptainer' action in the script target of the MLCFlow CLI. It updates the CLI help table, extends the ScriptAction class with apptainer and apptainer_run methods that delegate to a script module function, and adds a unit test to verify this delegation. The changes are low risk as they follow the existing pattern used for the 'docker' action, but the new functionality depends on the presence and correctness of the 'apptainer' script module which is not shown here.

Copilot AI changed the title [WIP] Support mlca - mlc apptainer run like mlc docker run Add missing apptainer dispatch path for mlca / mlc apptainer run Jul 4, 2026
Copilot AI requested a review from arjunsuresh July 4, 2026 11:25
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown

🤖 AI PR Review Summary\n\nThis PR adds support for an 'apptainer' action to the ScriptAction class, enabling scripts to be run inside an Apptainer containerized environment. It updates the CLI help table, integrates the new action into the dispatch logic, and provides a dedicated method with documentation. A new unit test verifies that the apptainer action correctly delegates to the script module function. The changes are low risk, mostly additive, and follow existing design patterns. However, the new action's implementation relies on the presence of an 'apptainer' script module function, which should be verified separately.

@arjunsuresh arjunsuresh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@copilot can you add a github action test too like we have for mlc docker script?

Copilot AI commented Jul 4, 2026

Copy link
Copy Markdown
Contributor Author

@copilot can you add a github action test too like we have for mlc docker script?

Added a dedicated GitHub Actions workflow for apptainer coverage in commit beb2735 (.github/workflows/test-mlc-apptainer-core.yml). It runs the apptainer delegation unit test and CLI help-path smoke checks for mlca, mlc apptainer script, and mlc apptainer-run script.

Copilot AI requested a review from arjunsuresh July 4, 2026 11:35
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown

🤖 AI PR Review Summary\n\nAdds support for 'apptainer' as a new script action in the mlc CLI, including command help updates, implementation in script_action.py, and a dedicated unit test. Also introduces a GitHub Actions workflow to run tests on Python 3.9 and 3.14. Risks are minimal but include ensuring the new 'apptainer' action integrates correctly with existing script handling and that the CI workflow triggers as expected. Design is consistent with existing patterns, but the new workflow's Python 3.14 usage may require validation for compatibility.

@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown

🤖 AI PR Review Summary\n\nAdds Apptainer support to the MLCFlow CLI and script actions, including new subcommands and delegation methods. Introduces a GitHub Actions workflow to test Apptainer-related functionality on Python 3.9 and 3.14. Adds unit tests for the Apptainer script action delegation. Risks include potential inconsistencies in CLI argument parsing and the need to ensure Apptainer integration does not break existing workflows. The design extends existing patterns for Docker and other container runtimes, maintaining consistency.

@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown

🤖 AI PR Review Summary\n\nAdds support for 'apptainer' and 'apptainer-run' actions in the mlc CLI and ScriptAction class, including new unit tests and a dedicated GitHub Actions workflow for testing these features. The changes introduce new commands and extend existing parsing and dispatch logic. Risks include potential integration issues with the new 'apptainer' commands and ensuring the new tests cover all edge cases. The design is consistent with existing patterns but requires validation of the new workflow and command handling.

@arjunsuresh
arjunsuresh marked this pull request as ready for review July 4, 2026 14:40
@arjunsuresh
arjunsuresh requested a review from a team as a code owner July 4, 2026 14:40
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown

🤖 AI PR Review Summary\n\nAdds support for 'apptainer' and 'apptainer-run' actions in the mlc CLI and ScriptAction class, including CLI parser updates, action dispatch, and documentation. Introduces a new GitHub Actions workflow to test the Apptainer-related functionality on Python 3.9 and 3.14. Adds a unit test for the apptainer action delegation. Updates version to 1.2.5. Risks are low but include ensuring the new apptainer commands integrate correctly with existing CLI and script execution flows. Design is consistent with existing patterns but requires careful validation of the new workflow and CLI changes.

@arjunsuresh
arjunsuresh changed the base branch from main to dev July 4, 2026 14:41
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown

🤖 AI PR Review Summary\n\nAdds support for 'apptainer' and 'apptainer-run' actions to the mlcflow CLI and ScriptAction class, enabling running scripts inside Apptainer containers. Introduces a new GitHub Actions workflow to test these features on Python 3.9 and 3.14. Includes a unit test for the new apptainer action delegation. Risks are low but include potential CLI parsing conflicts and ensuring the new actions integrate smoothly with existing command logic.

@arjunsuresh
arjunsuresh merged commit 284a32b into dev Jul 4, 2026
63 checks passed
@arjunsuresh
arjunsuresh deleted the copilot/support-mlca-mlc-apptainer-run branch July 4, 2026 14:42
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support mlca - mlc apptainer run like mlc docker run

2 participants