Skip to content

Feat/refactor deploy#48

Merged
alez007 merged 4 commits intomainfrom
feat/refactor-deploy
Apr 30, 2026
Merged

Feat/refactor deploy#48
alez007 merged 4 commits intomainfrom
feat/refactor-deploy

Conversation

@alez007
Copy link
Copy Markdown
Owner

@alez007 alez007 commented Apr 30, 2026

  1. Created a new package modelship/deploy.
  2. Moved the deployment-related logic from mship_deploy.py into smaller, focused modules inside the new package:
    • modelship/deploy/config.py: Handles loading and parsing the config and resolving plugin wheels.
    • modelship/deploy/serve_utils.py: Centralises Ray and Serve operations (e.g. connect_ray, start_serve, cleanup routines).
    • modelship/deploy/strategy.py: Contains the actual deploy plan computations (compute_deploy_plan) and the main deployment loop (run_deploy_loop).
  3. Relocated the newly created actor_options.py into this package as well (modelship/deploy/actor_options.py).

Alex M added 3 commits April 30, 2026 20:05
Extract actor options and caching logic from mship_deploy.py into modelship/actor_options.py.
Extract CLI parsing arguments logic into modelship/utils/cli.py.
Rename start.py to mship_deploy.py and update associated tests and references.
Moves config, strategy, and utilities for the Ray serve lifecycle out of mship_deploy.py into a cohesive package:
- modelship/deploy/config.py
- modelship/deploy/serve_utils.py
- modelship/deploy/strategy.py
- modelship/deploy/actor_options.py

Updates mship_deploy.py and test files to reflect these imports.
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the deployment logic by replacing the monolithic start.py with a new entry point, mship_deploy.py, and modularizing its functionality into the modelship/deploy/ directory. The changes include updating documentation, Docker configurations, and tests to reflect the new structure. A critical issue was identified in modelship/deploy/serve_utils.py where direct access to environment variables causes a KeyError during default startup. Additionally, the use of signal.pause() in the main entry point limits cross-platform compatibility.

Comment thread modelship/deploy/serve_utils.py Outdated
Comment thread mship_deploy.py
Only access RAY_CLUSTER_ADDRESS and RAY_REDIS_PORT from os.environ when
MSHIP_USE_EXISTING_RAY_CLUSTER is set to 'true'. This prevents a KeyError
on startup when running in the default 'auto' cluster mode without these
variables defined.
@alez007 alez007 merged commit 7ec3ac2 into main Apr 30, 2026
2 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.

1 participant