Repository navigation
fix(modal): install open_altergo_engine into the image - #1
Merged
Merged
Conversation
The Modal image installed the heavy ML stack and copied the repo, but never installed the cloud/engine package. Both provisioned jobs shell out to training scripts that import it: - train_personal.py -> open_altergo_engine.model_assets, .datamodule.data_module.DataModule, and via personalization -> .lightning.ModelModule - prepare_dataset.py -> .datamodule.transforms, .preparation.detectors.* So prepare/train crashed immediately with `ModuleNotFoundError: No module named 'open_altergo_engine'`. Install the engine from the copied source after add_local_dir. pip_install only accepts package specifiers, so install from the in-image path via run_commands. Verified inside the built image: open_altergo_engine, DataModule, model_assets, and the engine CLI all import/run, alongside the full torch/mediapipe/opencv/lightning stack. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Modal image in
cloud/modal/app.pyinstalled the heavy ML stack (torch, mediapipe, opencv, pytorch-lightning, …) and copied the repo, but never installed thecloud/enginepackage. Both provisioned jobs shell out to training scripts that import it:train_personal.py→open_altergo_engine.model_assets,.datamodule.data_module.DataModule, and viapersonalization→.lightning.ModelModuleprepare_dataset.py→.datamodule.transforms,.preparation.detectors.*Result:
modal run cloud/modal/app.py::prepare/::traincrashed immediately withModuleNotFoundError: No module named 'open_altergo_engine'.Fix
Install the engine from the copied source after
add_local_dir.Image.pip_installonly accepts package specifiers, so install from the in-image path viarun_commands:Verification
Built the exact image
prepare/trainuse and ran a smoke function inside it. After the fix:import open_altergo_engineopen_altergo_engine.datamodule.data_module.DataModuleopen_altergo_engine.model_assets+ engine CLI (-m open_altergo_engine.model_assets)training/train_personal.py,training/prepare_dataset.pypresent(Engine wheel builds clean at 83 KB; its
pyproject.tomldeclares no runtime deps, so the heavy stack already in the image covers everything.)🤖 Generated with Claude Code