Skip to content

Fix Docker sidecar volume names for registry refs with ports#87

Draft
jasonkeung wants to merge 1 commit into
mainfrom
oz/fix-sidecar-volume-name-registry-port
Draft

Fix Docker sidecar volume names for registry refs with ports#87
jasonkeung wants to merge 1 commit into
mainfrom
oz/fix-sidecar-volume-name-registry-port

Conversation

@jasonkeung

Copy link
Copy Markdown
Contributor

Description

The Docker backend derives sidecar volume names from the image repository name but only replaces / characters. Image refs whose registry host includes a port (e.g. localhost:5000/warp-agent:pr120) keep the : and volume creation fails:

create localhost:5000-warp-agent-cdd2970ebf33: "localhost:5000-warp-agent-cdd2970ebf33" includes
invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed

This replaces every character outside [a-zA-Z0-9_.-] when building the volume name, and adds unit tests covering port-qualified registry refs.

Context

Found while validating warpdotdev/warp-agent-docker#120 end-to-end against a local docker-backend Oz stack (warp-server/script/oz-local --worker-backend docker), where locally built sidecar images are served from a localhost:5000 registry. Any self-hosted worker pulling sidecars from a port-qualified private registry would hit the same failure.

Validation

  • go test ./internal/worker/ -run TestSanitizeVolumeName passes.
  • E2E: with this fix, tasks using localhost:5000/warp-agent:pr120 as the sidecar image create the volume localhost-5000-warp-agent-cdd2970ebf33 and run to completion on the docker backend.

Conversation: https://staging.warp.dev/conversation/b7db9360-e563-44c7-b2b2-a6c30dbc7645
Run: https://oz.staging.warp.dev/runs/019ebca1-59ed-7e05-8fa2-042278a8e219

This PR was generated with Oz.

The docker backend derives sidecar volume names from the image repo name,
but only replaced '/' characters. Image refs that include a registry host
with a port (e.g. localhost:5000/warp-agent:tag) kept the ':' and failed
volume creation with:

  "localhost:5000-warp-agent-<digest>" includes invalid characters for a
  local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed

Replace every character outside [a-zA-Z0-9_.-] instead, and add unit tests
covering port-qualified registry refs.

Found while validating warp-agent-docker#120 against a local docker-backend
oz stack using a localhost:5000 registry for locally built sidecar images.

Co-Authored-By: Oz <oz-agent@warp.dev>
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.

2 participants