-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·47 lines (38 loc) · 1.94 KB
/
setup.sh
File metadata and controls
executable file
·47 lines (38 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
# Exit immediately if a command exits with a non-zero status.
set -e
# Define the Conda environment name
CONDA_ENV_NAME="dispatchqa"
# Create or update the Conda environment
if conda env list | grep -q "^$CONDA_ENV_NAME "; then
echo "Updating Conda environment: $CONDA_ENV_NAME"
conda env update --name "$CONDA_ENV_NAME" --file environment.yaml --prune
else
echo "Creating Conda environment: $CONDA_ENV_NAME"
conda env create --name "$CONDA_ENV_NAME" --file environment.yaml
fi
echo "Activating Conda environment: $CONDA_ENV_NAME (Note: conda run will be used)"
# Ensure Conda's pip-installed uv is up-to-date (using pip to install/upgrade uv)
echo "Installing/Updating uv to the latest version available on PyPI..."
conda run -n "$CONDA_ENV_NAME" pip install --upgrade uv
echo "Verifying uv version..."
conda run -n "$CONDA_ENV_NAME" uv --version
# Install Python packages from pyproject.toml using uv into the active Conda environment
echo "Installing Python packages from pyproject.toml using uv, with constraints..."
# The UV_EXTRA_INDEX_URL is for packages that might not be on PyPI (like CPU-specific torch versions if not handled by constraints)
# However, with constraints file, this might be less critical if torch versions are pulled from PyPI by default.
# We will keep it for now as it doesn't harm.
LOG_FILE="uv_install_log.txt"
echo "Full uv install log will be in $LOG_FILE"
conda run -n "$CONDA_ENV_NAME" \
uv pip install \
--no-cache \
--force-reinstall \
-c constraints.txt \
-e . \
2>&1 | tee "$LOG_FILE"
echo "Checking installed torch and sglang versions..."
conda run -n "$CONDA_ENV_NAME" python -c "import torch; print(f'Installed torch version: {torch.__version__}'); import sglang; print(f'sglang version: {sglang.__version__}')"
echo "To activate the environment, run: conda activate $CONDA_ENV_NAME"
echo "Please check $LOG_FILE for installation details, especially regarding torch versions."
echo "✅ Setup complete!"