feat: Add recipe-based one-click model deployment system
Introduces a YAML recipe system for simplified model deployment: - run-recipe.py: Main script handling build, download, and launch - run-recipe.sh: Bash wrapper for dependency management - recipes/: Pre-configured recipes for common models - glm-4.7-flash-awq.yaml: GLM-4.7-Flash with AWQ quantization - glm-4.7-nvfp4.yaml: GLM-4.7 with NVFP4 (cluster-only) - minimax-m2-awq.yaml: MiniMax M2 with AWQ - openai-gpt-oss-120b.yaml: OpenAI GPT-OSS 120B with MXFP4 Key features: - Auto-discover cluster nodes with --discover, saves to .env - Load nodes from .env automatically on subsequent runs - cluster_only flag for models requiring multi-node setup - build_args field for Dockerfile selection (--pre-tf, --exp-mxfp4) - Solo mode auto-strips --distributed-executor-backend ray - --setup flag for full build + download + run workflow - --dry-run to preview execution without running Usage: ./run-recipe.sh --discover # Find and save cluster nodes ./run-recipe.sh glm-4.7-flash-awq --solo --setup ./run-recipe.sh glm-4.7-nvfp4 --setup # Uses nodes from .env
This commit is contained in:
42
run-recipe.sh
Executable file
42
run-recipe.sh
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# run-recipe.sh - Wrapper for run-recipe.py
|
||||
#
|
||||
# Ensures Python dependencies are available and runs the recipe runner.
|
||||
#
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
RECIPE_SCRIPT="$SCRIPT_DIR/run-recipe.py"
|
||||
|
||||
# Check for Python 3.10+
|
||||
if command -v python3 &>/dev/null; then
|
||||
PYTHON=python3
|
||||
elif command -v python &>/dev/null; then
|
||||
PYTHON=python
|
||||
else
|
||||
echo "Error: Python 3 not found. Please install Python 3.10 or later."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Verify version
|
||||
PY_VERSION=$($PYTHON -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')
|
||||
PY_MAJOR=$($PYTHON -c 'import sys; print(sys.version_info.major)')
|
||||
PY_MINOR=$($PYTHON -c 'import sys; print(sys.version_info.minor)')
|
||||
|
||||
if [[ "$PY_MAJOR" -lt 3 ]] || [[ "$PY_MAJOR" -eq 3 && "$PY_MINOR" -lt 10 ]]; then
|
||||
echo "Error: Python 3.10+ required, found $PY_VERSION"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check for PyYAML and install if missing
|
||||
if ! $PYTHON -c "import yaml" 2>/dev/null; then
|
||||
echo "Installing PyYAML..."
|
||||
$PYTHON -m pip install --quiet pyyaml
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "Error: Failed to install PyYAML. Try: pip install pyyaml"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Run the recipe script
|
||||
exec $PYTHON "$RECIPE_SCRIPT" "$@"
|
||||
Reference in New Issue
Block a user