Unify mlcd and mlca: docker_X fallback, apptainer meta key, schema validation - #313
Conversation
…lidation (#312) Co-authored-by: arjunsuresh <4791823+arjunsuresh@users.noreply.github.com>
|
@copilot call the test in the github action. Are we ensuring |
Co-authored-by: arjunsuresh <4791823+arjunsuresh@users.noreply.github.com>
Done in commit
|
|
MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅ |
VerdictThe PR sets out to do three things: make 🔴 High severityThe
|
|
@copilot can you address the concerns in the last comment? |
…coverage Co-authored-by: arjunsuresh <4791823+arjunsuresh@users.noreply.github.com>
All concerns from the AI review have been addressed. Key fixes in the latest commit: 🔴 High fixes:
🟠 Medium fixes:
🟡 Low fixes:
|
Verdict
Verified fixed🔴 🔴 🟠 Shallow 🟠 🟠 CI trigger gap — 🟡 All four Lows — 🟠 Medium severity (remaining)The suite still passes with the fix removed
Mutation test on a copy of Fix: one test that calls the real function is enough to close this: def test_apptainer_meta_reaches_run_state(self):
# import update_state_from_meta from automation/script/module.py the same
# way test_init_run_state_seeds_apptainer_key already loads the module
run_state = sa.init_run_state(None)
update_state_from_meta(
{'docker': {'base_image': 'ubuntu:22.04'},
'apptainer': {'base_image': 'docker://ubuntu:20.04'}},
env={}, state={}, const={}, const_state={}, run_state=run_state, i={})
self.assertEqual(run_state['apptainer']['base_image'], 'docker://ubuntu:20.04')The module is already loaded once in this file, so hoisting that loader to a module-level helper (or 🟡 Low severity
|
Addresses three gaps between
mlcdandmlca: shared CLI options,docker_Xflags not working for Apptainer, and no way to set Apptainer-specific overrides inmeta.yaml.Changes
--docker_Xas fallbacks formlca(all three apptainer entry points)apptainer_X→docker_X→ meta settings → defaultapptainer_anddocker_key prefixes are pruned from the forwarded run commanddocker_noregenerate,docker_rebuild,docker_mounts,docker_run_cmd_prefix,docker_verbose/docker_v,docker_silent/docker_s,docker_run_overrideapptainer:key in scriptmeta.yamlScripts can now declare Apptainer-specific overrides that merge over
docker:settings:module.py:run_state['apptainer']is populated frommeta.get('apptainer', {})alongside the existingrun_state['docker']apptainer.py: effective settings built as{**docker_settings, **apptainer_override}Schema validation
mlc/meta_schema.pyandautomation/script/meta_schema.py:apptainerkey added to all schema dicts; validated againstDOCKER_SCHEMA(same allowed keys asdocker)Documentation
apptainer_rundocstring updated to enumerate all flags and explain thedocker_Xfallback behaviour✅ PR Checklist
✅ Testing & CI
📚 Documentation
📁 File Hygiene & Output Handling
🛡️ Safety & Security
🙌 Contribution Hygiene
Fixes #orCloses #.