Skip to content

Commit 550f64b

Browse files
authored
build: Convert vLLM index url ARGS into docker secrets (#8197)
1 parent fa3361e commit 550f64b

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

build.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,12 +1481,12 @@ def dockerfile_prepare_container_linux(argmap, backends, enable_gpu, target_mach
14811481

14821482
if "vllm" in backends:
14831483
df += f"""
1484+
# Install required packages for vLLM models
14841485
ARG BUILD_PUBLIC_VLLM="true"
1485-
ARG VLLM_INDEX_URL
1486-
ARG PYTORCH_TRITON_URL
1487-
ARG NVPL_SLIM_URL
1488-
14891486
RUN --mount=type=secret,id=req,target=/run/secrets/requirements \\
1487+
--mount=type=secret,id=VLLM_INDEX_URL,env=VLLM_INDEX_URL \\
1488+
--mount=type=secret,id=PYTORCH_TRITON_URL,env=PYTORCH_TRITON_URL \\
1489+
--mount=type=secret,id=NVPL_SLIM_URL,env=NVPL_SLIM_URL \\
14901490
if [ "$BUILD_PUBLIC_VLLM" = "false" ]; then \\
14911491
if [ "$(uname -m)" = "x86_64" ]; then \\
14921492
pip3 install --no-cache-dir \\
@@ -1900,10 +1900,10 @@ def create_docker_build_script(script_name, container_install_dir, container_ci_
19001900
if secrets:
19011901
finalargs += [
19021902
f"--secret id=req,src={requirements}",
1903-
f"--build-arg VLLM_INDEX_URL={vllm_index_url}",
1904-
f"--build-arg PYTORCH_TRITON_URL={pytorch_triton_url}",
1903+
f"--secret id=VLLM_INDEX_URL",
1904+
f"--secret id=PYTORCH_TRITON_URL",
1905+
f"--secret id=NVPL_SLIM_URL",
19051906
f"--build-arg BUILD_PUBLIC_VLLM={build_public_vllm}",
1906-
f"--build-arg NVPL_SLIM_URL={nvpl_slim_url}",
19071907
]
19081908
finalargs += [
19091909
"-t",
@@ -2778,8 +2778,6 @@ def enable_all():
27782778
metavar=("key", "value"),
27792779
help="Add build secrets in the form of <key> <value>. These secrets are used during the build process for vllm. The secrets are passed to the Docker build step as `--secret id=<key>`. The following keys are expected and their purposes are described below:\n\n"
27802780
" - 'req': A file containing a list of dependencies for pip (e.g., requirements.txt).\n"
2781-
" - 'vllm_index_url': The index URL for the pip install.\n"
2782-
" - 'pytorch_triton_url': The location of the PyTorch wheel to download.\n"
27832781
" - 'build_public_vllm': A flag (default is 'true') indicating whether to build the public VLLM version.\n\n"
27842782
"Ensure that the required environment variables for these secrets are set before running the build.",
27852783
)
@@ -2901,9 +2899,6 @@ def enable_all():
29012899
secrets = dict(getattr(FLAGS, "build_secret", []))
29022900
if secrets:
29032901
requirements = secrets.get("req", "")
2904-
vllm_index_url = secrets.get("vllm_index_url", "")
2905-
pytorch_triton_url = secrets.get("pytorch_triton_url", "")
2906-
nvpl_slim_url = secrets.get("nvpl_slim_url", "")
29072902
build_public_vllm = secrets.get("build_public_vllm", "true")
29082903
log('Build Arg for BUILD_PUBLIC_VLLM: "{}"'.format(build_public_vllm))
29092904

0 commit comments

Comments
 (0)