-
Notifications
You must be signed in to change notification settings - Fork 140
[CICD] replace souce install with whl install #1121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
42c2a84
7334d27
8723117
aadfb23
b5fc6fe
03a49bf
d609051
f6b1abb
fb42ecb
0dc97c7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -88,14 +88,44 @@ ENV LD_LIBRARY_PATH="${CUDA_HOME}/lib64:/usr/local/lib:/usr/local/mpi/lib:/usr/l | |
|
|
||
| WORKDIR /workspace | ||
|
|
||
| # ============================================================================= | ||
| # ENV STAGE - Ensure uv/conda/pip environments | ||
| # ============================================================================= | ||
| FROM base AS env | ||
|
|
||
| ARG PKG_MGR | ||
| ARG FLAGSCALE_HOME=/opt/flagscale | ||
| ARG PYTHON_VERSION=3.12 | ||
|
|
||
| RUN . /etc/profile.d/flagscale-env.sh && \ | ||
| if [ "$PKG_MGR" = "uv" ]; then \ | ||
| if [ ! -f "${FLAGSCALE_HOME}/venv/bin/python3" ]; then \ | ||
| echo "[ENV] Creating uv venv at ${FLAGSCALE_HOME}/venv (python=${PYTHON_VERSION})"; \ | ||
| "$HOME/.local/bin/uv" venv "${FLAGSCALE_HOME}/venv" --python "${PYTHON_VERSION}"; \ | ||
| else \ | ||
| echo "[ENV] Found uv venv at ${FLAGSCALE_HOME}/venv"; \ | ||
| fi; \ | ||
| elif [ "$PKG_MGR" = "conda" ]; then \ | ||
| CONDA_ENV_NAME=flagscale-train; \ | ||
| if [ -d "${FLAGSCALE_CONDA}/envs/${CONDA_ENV_NAME}" ]; then \ | ||
| echo "[ENV] Found conda env ${CONDA_ENV_NAME} at ${FLAGSCALE_CONDA}/envs/${CONDA_ENV_NAME}"; \ | ||
| else \ | ||
| echo "[ENV] Creating conda env ${CONDA_ENV_NAME} (python=${PYTHON_VERSION})"; \ | ||
| env CONDA_NO_PLUGINS=true ANACONDA_ACCEPT_TOS=yes "${FLAGSCALE_CONDA}/bin/conda" create -y -n "${CONDA_ENV_NAME}" "python=${PYTHON_VERSION}"; \ | ||
| fi; \ | ||
| else \ | ||
| echo "[ENV] Using system pip (no dedicated env to create)"; \ | ||
| fi | ||
|
|
||
| # ============================================================================= | ||
| # DEPS STAGE - Install dependencies using install folder | ||
| # ============================================================================= | ||
| FROM base AS deps | ||
| FROM env AS deps | ||
|
|
||
| ARG PYTORCH_INDEX | ||
| ARG PKG_MGR | ||
| ARG FLAGSCALE_HOME=/opt/flagscale | ||
| ARG PYTHON_VERSION=3.12 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is actually not configurable, because the packages we are installing later on are all about python3.12. Right? |
||
|
|
||
| # PyPI index URLs (re-declare to use in this stage) | ||
| ARG PIP_INDEX_URL | ||
|
|
@@ -151,13 +181,14 @@ WORKDIR /workspace/FlagScale | |
| CMD ["/bin/bash"] | ||
|
|
||
| # ============================================================================= | ||
| # RELEASE STAGE - Production image (uses same base for consistency) | ||
| # RELEASE STAGE - Production image (uses same env for consistency) | ||
| # ============================================================================= | ||
| FROM base AS release | ||
| FROM env AS release | ||
|
|
||
| ARG PYTORCH_INDEX | ||
| ARG PKG_MGR | ||
| ARG FLAGSCALE_HOME=/opt/flagscale | ||
| ARG PYTHON_VERSION=3.12 | ||
|
|
||
| # PyPI index URLs | ||
| ARG PIP_INDEX_URL | ||
|
|
@@ -181,6 +212,8 @@ RUN --mount=type=cache,target=/root/.cache/uv \ | |
| chmod +x /workspace/tools/install/*.sh && \ | ||
| chmod +x /workspace/tools/install/utils/*.sh && \ | ||
| chmod +x /workspace/tools/install/cuda/*.sh && \ | ||
| ( [ "$PKG_MGR" != "uv" ] || [ -f "${FLAGSCALE_HOME}/venv/bin/python3" ] ) || \ | ||
| ( mkdir -p "${FLAGSCALE_HOME}" && "$HOME/.local/bin/uv" venv "${FLAGSCALE_HOME}/venv" --python "${PYTHON_VERSION}" ) && \ | ||
| cd /workspace && \ | ||
| if [ "$PKG_MGR" = "uv" ]; then \ | ||
| UV_EXTRA_INDEX_URL=${PYTORCH_INDEX} \ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| # Inference-specific dependencies | ||
|
|
||
| -r ./base.txt | ||
| vllm @ https://resource.flagos.net/repository/flagos-pypi-hosted/packages/vllm/0.11.0%2Bfl.0.1.cu124/vllm-0.11.0%2Bfl.0.1.cu124-cp312-cp312-linux_x86_64.whl | ||
| transformers==4.57.6 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| # Training-specific dependencies | ||
|
|
||
| -r ./base.txt | ||
| megatron_core @ https://resource.flagos.net/repository/flagos-pypi-hosted/packages/megatron-core/0.16.0rc0/megatron_core-0.16.0rc0-cp312-cp312-linux_x86_64.whl | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where does this megatron_core come from? |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the point to have conda or miniconda inside a container?
For miniconda, the base installation is approximately 250 MB to 900 MB, while for venv, the footprint is typically 5-10 MB.
Are we planning to install multiple Python versions in the same container image or something?