Skip to content

Conversation

@xingyaoww
Copy link
Collaborator

@xingyaoww xingyaoww commented Nov 18, 2025

Summary

This PR implements simple, intuitive version tags for agent-server Docker images on release, making it easier for users to pull specific versions.

Changes

Modified Docker Build System

  • Changed versioned_tag property to versioned_tags: Now returns a list of strings instead of a single string
  • Updated tag format: Changed from v{SDK_VERSION}_{BASE_IMAGE_SLUG} to {SDK_VERSION}-{TAG} for each custom tag
  • Removed base_image_slug dependency: Versioned tags no longer include the complex base image slug
  • Removed "v" prefix: Version tags now use 1.2.0-python instead of v1.2.0-python for consistency

Updated Integration Points

  • all_tags property: Now iterates over versioned_tags list instead of appending a single tag
  • GitHub Actions outputs: Changed from versioned_tag to versioned_tags_csv (comma-separated list)

Added Comprehensive Tests

Added 9 new test cases covering:

  • Single and multiple custom tags
  • Empty custom tag lists
  • Integration with all_tags property
  • Architecture suffix handling
  • Target suffix handling
  • Enable/disable flag behavior
  • Version format validation

Before vs After

Before (current behavior)

ghcr.io/openhands/agent-server:v1.2.0_python-nodejs-python3.12-nodejs22

After (new behavior)

ghcr.io/openhands/agent-server:1.2.0-python
ghcr.io/openhands/agent-server:1.2.0-java
ghcr.io/openhands/agent-server:1.2.0-golang

Benefits

  1. Simpler image tags: Users can easily remember and use tags like 1.2.0-python
  2. Common conventions: Aligns with standard Docker tagging practices
  3. Better UX: Clearer which version they're using without parsing complex slugs
  4. Multiple variants: Each custom tag gets its own versioned tag

Testing

All tests pass, including:

  • Existing docker build tests (21 tests total)
  • New versioned tags functionality tests
  • Pre-commit hooks (pyright, ruff, pycodestyle)

Example Usage

After this change, users can pull specific versions with:

docker pull ghcr.io/openhands/agent-server:1.2.0-python
docker pull ghcr.io/openhands/agent-server:1.2.0-java
docker pull ghcr.io/openhands/agent-server:1.2.0-golang

Fixes #1195

@xingyaoww can click here to continue refining the PR


Agent Server images for this PR

GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server

Variants & Base Images

Variant Architectures Base Image Docs / Tags
java amd64, arm64 eclipse-temurin:17-jdk Link
python amd64, arm64 nikolaik/python-nodejs:python3.12-nodejs22 Link
golang amd64, arm64 golang:1.21-bookworm Link

Pull (multi-arch manifest)

# Each variant is a multi-arch manifest supporting both amd64 and arm64
docker pull ghcr.io/openhands/agent-server:b642962-python

Run

docker run -it --rm \
  -p 8000:8000 \
  --name agent-server-b642962-python \
  ghcr.io/openhands/agent-server:b642962-python

All tags pushed for this build

ghcr.io/openhands/agent-server:b642962-golang-amd64
ghcr.io/openhands/agent-server:b642962-golang_tag_1.21-bookworm-amd64
ghcr.io/openhands/agent-server:b642962-golang-arm64
ghcr.io/openhands/agent-server:b642962-golang_tag_1.21-bookworm-arm64
ghcr.io/openhands/agent-server:b642962-java-amd64
ghcr.io/openhands/agent-server:b642962-eclipse-temurin_tag_17-jdk-amd64
ghcr.io/openhands/agent-server:b642962-java-arm64
ghcr.io/openhands/agent-server:b642962-eclipse-temurin_tag_17-jdk-arm64
ghcr.io/openhands/agent-server:b642962-python-amd64
ghcr.io/openhands/agent-server:b642962-nikolaik_s_python-nodejs_tag_python3.12-nodejs22-amd64
ghcr.io/openhands/agent-server:b642962-python-arm64
ghcr.io/openhands/agent-server:b642962-nikolaik_s_python-nodejs_tag_python3.12-nodejs22-arm64
ghcr.io/openhands/agent-server:b642962-golang
ghcr.io/openhands/agent-server:b642962-java
ghcr.io/openhands/agent-server:b642962-python

About Multi-Architecture Support

  • Each variant tag (e.g., b642962-python) is a multi-arch manifest supporting both amd64 and arm64
  • Docker automatically pulls the correct architecture for your platform
  • Individual architecture tags (e.g., b642962-python-amd64) are also available if needed

- Modified versioned_tag property to versioned_tags returning a list
- Changed format from v{SDK_VERSION}_{BASE_IMAGE_SLUG} to {SDK_VERSION}-{TAG}
- Generate simple tags like 1.2.0-python, 1.2.0-java, 1.2.0-golang
- Updated all_tags property to iterate over versioned_tags list
- Updated GitHub Actions output to use versioned_tags_csv instead of versioned_tag
- Added comprehensive tests for the new versioned tags functionality

This makes Docker image tags more intuitive and aligns with common Docker
tagging conventions. Users can now pull images with simple version tags:
  ghcr.io/openhands/agent-server:1.2.0-python
  ghcr.io/openhands/agent-server:1.2.0-java
  ghcr.io/openhands/agent-server:1.2.0-golang

Fixes #1195

Co-authored-by: openhands <[email protected]>
@github-actions
Copy link
Contributor

Coverage

Coverage Report •
FileStmtsMissCoverMissing
openhands-agent-server/openhands/agent_server/docker
   build.py35925828%69, 72–73, 87, 92, 96–98, 102, 107, 124–129, 132, 155, 157, 165, 167–168, 170–174, 176, 180, 183, 186–189, 191–193, 195, 197, 199, 201, 205–206, 221, 223–224, 226–227, 230–231, 233, 235–236, 239, 242–243, 247–248, 268–269, 273–274, 278–279, 283–284, 297, 299–307, 364, 369–371, 375, 379, 387, 391, 395–399, 401, 405–406, 409–410, 412–414, 416–420, 423–425, 432–434, 436–440, 442, 446–449, 451, 455–456, 460–461, 464, 467–468, 471, 473–478, 480, 484–492, 497–501, 505, 513–515, 523–526, 528–529, 531–532, 534, 545–546, 548, 550–551, 554–556, 558, 560, 568, 572–574, 580, 584, 594–595, 597, 599, 604, 608, 610–618, 620–621, 623–626, 633–634, 639, 642, 647, 652, 657, 663, 668, 675–676, 681, 686, 692, 697, 706, 709–715, 718–720, 723, 736–744, 747–748, 752–755, 757, 766, 777, 780, 794–804, 806–807, 811
TOTAL12137556154% 

fh.write("EOF\n")

_write_gha_outputs(opts.image, opts.short_sha, opts.versioned_tag, tags)
_write_gha_outputs(opts.image, opts.short_sha, opts.versioned_tags, tags)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@OpenHands please check in this repo if our image building workflow servers.yml will enable these version tags on "git tags"

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm on it! xingyaoww can track my progress at all-hands.dev

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on my analysis of the repository, here's the answer to your question:

Summary: Version Tags on Git Tags - Current State

Question: Will the image building workflow server.yml enable version tags on git tags?

Answer: The workflow partially supports versioned tags, but has a critical gap that prevents the feature from working correctly.

What Currently Works ✅

  1. Trigger: The workflow triggers correctly on any git tag push (line 7-8)
  2. Build Detection: The build job detects git tags and enables the --versioned-tag flag (lines 242-244)
  3. Architecture-Specific Images: Individual architecture images ARE pushed with version tags:
    • ghcr.io/openhands/agent-server:1.2.0-python-amd64
    • ghcr.io/openhands/agent-server:1.2.0-python-arm64
    • etc.

Critical Gap ❌

The merge-manifests job does NOT create multi-arch manifests for versioned tags.

Currently, the merge-manifests job only creates multi-arch manifests for:

  • SHA-based tags: b642962-python
  • Latest tags (main branch): latest-python

It does NOT create the intended simple version tags:

  • 1.2.0-pythonMISSING
  • 1.2.0-javaMISSING
  • 1.2.0-golangMISSING

Impact

Users cannot pull images using the simple version tags described in your PR:

# This will NOT work (manifest doesn't exist):
docker pull ghcr.io/openhands/agent-server:1.2.0-python

# Users would need to specify architecture explicitly:
docker pull ghcr.io/openhands/agent-server:1.2.0-python-amd64

Required Fix

The merge-manifests job (lines 355-406) needs to be updated to:

  1. Detect when triggered by a git tag
  2. Extract the SDK version from build artifacts (versioned_tags_csv is available in GITHUB_OUTPUT)
  3. Create multi-arch manifests for each versioned tag

The build.py script already generates and outputs versioned_tags_csv, but this information needs to be:

  • Saved to the build-info artifacts (currently only tags is saved, not versioned_tags)
  • Used by the merge-manifests job to create the versioned multi-arch manifests

In summary: The versioned tags feature is incomplete. It pushes architecture-specific images but doesn't create the multi-arch manifests needed for users to pull images with simple version tags like 1.2.0-python.

View full conversation

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

Successfully merging this pull request may close these issues.

Add simple version tags (e.g., 1.2.0-python) to agent-server Docker images on release

3 participants