Skip to content
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

build.py setting docker build args for secrets even when build-secret flag is not present #7992

Open
BenjaminBraunDev opened this issue Feb 6, 2025 · 2 comments
Assignees
Labels
build Issues pertaining to builds

Comments

@BenjaminBraunDev
Copy link

BenjaminBraunDev commented Feb 6, 2025

Description
While trying to build tritonserver with the build.py script, I am getting this error:

+ docker build --secret id=req,src= --build-arg VLLM_INDEX_URL= --build-arg PYTORCH_TRITON_URL= --build-arg BUILD_PUBLIC_VLLM=true -t tritonserver -f /home/benjaminbraun_google_com/server-fork-orca-header/build/Dockerfile .
[+] Building 0.0s (0/0)                                                                                                                                                              docker:default
ERROR: failed to stat req: stat req: no such file or directory
error: build failed

After looking into it, it looks like #7983 that was merged recently added a new build-secret flag

it is checked in main here

    secrets = dict(getattr(FLAGS, "build_secret", []))
    if secrets is not None:
        requirements = secrets.get("req", "")
        vllm_index_url = secrets.get("vllm_index_url", "")
        pytorch_triton_url = secrets.get("pytorch_triton_url", "")
        build_public_vllm = secrets.get("build_public_vllm", "true")
        log('Build Arg for BUILD_PUBLIC_VLLM: "{}"'.format(build_public_vllm))

The values are referenced to make a docker build command here.

        if secrets != "":
            finalargs += [
                f"--secret id=req,src={requirements}",
                f"--build-arg VLLM_INDEX_URL={vllm_index_url}",
                f"--build-arg PYTORCH_TRITON_URL={pytorch_triton_url}",
                f"--build-arg BUILD_PUBLIC_VLLM={build_public_vllm}",
            ]

The issue here is that is that secrets = dict(getattr(FLAGS, "build_secret", [])) will never set secrets to None since getattr defaults to [] and dict([]) returns an empty dictionary, which is not None. Therefore requirements, vllm_index_url, and pytorch_triton_url will be set to "".

Furthermore, secrets != "" will always be true since secrets is not a string, so these flags will always be put into docker build command regardless of whether they're set, resulting in the error.

Triton Information
What version of Triton are you using?
2.55.0dev

Are you using the Triton container or did you build it yourself?
I am attempting to build the container myself using build.py.

To Reproduce
I am running the following command to build from inside the server repo:

./build.py -v --no-container-interactive --enable-logging --enable-stats --enable-tracing \
              --enable-metrics --enable-gpu-metrics --enable-cpu-metrics \
              --filesystem=gcs \
              --endpoint=http --endpoint=grpc --endpoint=sagemaker --endpoint=vertex-ai \
              --backend=ensemble --enable-gpu --no-container-pull \
              --repoagent=checksum --cache=local --cache=redis

Expected behavior
I expected the build to succeed.

@BenjaminBraunDev BenjaminBraunDev changed the title build.py setting docker build args for secrets even when build_secret flag is not present build.py setting docker build args for secrets even when build-secret flag is not present Feb 6, 2025
@BenjaminBraunDev BenjaminBraunDev changed the title build.py setting docker build args for secrets even when build-secret flag is not present build.py setting docker build args for secrets even when build-secret flag is not present Feb 6, 2025
@BenjaminBraunDev
Copy link
Author

BenjaminBraunDev commented Feb 6, 2025

Fixing this should be as simple as changing both of the if statements to if secrets:, I just want to confirm that it's not due to an issue with my setup.

@BenjaminBraunDev
Copy link
Author

Created PR for fix: #7993

@rmccorm4 rmccorm4 added the build Issues pertaining to builds label Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues pertaining to builds
Development

No branches or pull requests

3 participants