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

🐞 Type mismatch with BuildArg in Docker build operations #13

Open
quanta42 opened this issue Feb 26, 2025 · 1 comment
Open

🐞 Type mismatch with BuildArg in Docker build operations #13

quanta42 opened this issue Feb 26, 2025 · 1 comment

Comments

@quanta42
Copy link

What is the issue?

@shykes I love the presentation you did with dagger and llm.

I tried building a prototype during innovation week at work but when attempting to build a Docker image with build arguments in both Go and Python SDKs, there's a type conversion error at the GraphQL layer.

Is there a workaround for this?

Dagger version

dagger v0.17.0-llm.2

Steps to reproduce

  • Create a Dockerfile that uses build arguments:
FROM ${NVIDIA_DOCKER_VERSION}
ARG NVIDIA_DRIVER_VERSION
ARG PYTORCH_VERSION
# ...other build args
  • Try to build using Go SDK
buildArgs := []dagger.BuildArg{
    {Name: "NVIDIA_DOCKER_VERSION", Value: "nvidia/cuda:12.4.1-runtime-ubuntu22.04"},
    {Name: "NVIDIA_DRIVER_VERSION", Value: "535.129.03"},
    {Name: "PYTORCH_VERSION", Value: "2.6.0"}
}

container := sourceDir.DockerBuild(dagger.DirectoryDockerBuildOpts{
    Dockerfile: "Dockerfile.advanced",
    BuildArgs: buildArgs,
})

Log output

error: parse selections: parse field "dockerBuild": init arg "buildArgs" value as dagql.DynamicOptional ([BuildArg!]) using dagql.DynamicOptional: assign input object "Name" as NVIDIA_DOCKER_VERSION (dagql.String): cannot assign dagql.String into field of type string
@shykes
Copy link
Collaborator

shykes commented Feb 27, 2025

cc @grouville @jedevc @vito any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants