Skip to content

adkgo v2.1.0 uses incompatible Go builder version #1196

Description

@Antupis

🔴 Required Information

Describe the Bug:
adkgo v2.1.0 deploy agentengine generates an InlineSource Dockerfile using golang:1.25, but google.golang.org/adk/v2 v2.1.0 declares Go 1.26.5 in its go.mod.

The generated Dockerfile is defined here:

As a result, a Go ADK v2.1.0 application that builds successfully with Go 1.26.5 fails during the managed Agent Engine source-image build.

Steps to Reproduce:

  1. Create a Go agent using google.golang.org/adk/v2 v2.1.0.
  2. Ensure its go.mod contains:
    go 1.26.5
    
    require google.golang.org/adk/v2 v2.1.0
  3. Confirm the project builds locally:
    go mod tidy
    go test ./...
    go vet ./...
    go build ./...
  4. Deploy it using the pinned v2.1.0 CLI:
    go run google.golang.org/adk/v2/cmd/adkgo@v2.1.0 deploy agentengine
    --entry_point_path=./main.go
    --name=adk-go-v2-inline-test
    --project_name="$GOOGLE_CLOUD_PROJECT"
    --region=europe-west1
    --source_dir=.
  5. The source archive uploads successfully, but the managed build fails:
    Sending CreateReasoningEngine request...
    Waiting for operation to complete...

Error: operation failed: rpc error: code = InvalidArgument desc = Build failed.
The issue might be caused by incorrect code, requirements.txt file or other dependencies.
6. Inspect the Dockerfile generated by adkgo. It contains:
FROM golang:1.25 as builder
WORKDIR /app
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build ...
Expected Behavior:
adkgo v2.1.0 deploy agentengine should generate a builder image compatible with the Go version required by ADK v2.1.0, allowing a locally valid ADK Go v2.1.0 application to deploy successfully.
For example:
FROM golang:1.26.5 AS builder
Alternatively, the builder Go version could be derived from the application or ADK module requirements rather than being hardcoded.
Observed Behavior:
The generated Dockerfile hardcodes:
FROM golang:1.25 as builder
The managed Agent Engine image build subsequently fails with:
Error: operation failed: rpc error: code = InvalidArgument desc = Build failed.
The issue might be caused by incorrect code, requirements.txt file or other dependencies.
The same source passes go test, go vet, and go build with Go 1.26.5.
Environment Details:

  • ADK Library Version: google.golang.org/adk/v2 v2.1.0
  • OS: Linux, arm64
  • Go Version: go1.26.5 linux/arm64
  • Deployment region: europe-west1
  • Deployment command: go run google.golang.org/adk/v2/cmd/adkgo@v2.1.0 deploy agentengine

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions