Conversation
hiroTamada
left a comment
There was a problem hiding this comment.
Looks good.
I personally dont like how we need to specify registry url. Should this be optional/default?
For hypeman run we try internal registry first and docker.io if registry name is not specified?
I agree. also it would be best if "hypeman push .." "hypeman pull ..." "hypeman run ..." are always consistent in whatever the user puts for the image name there. e.g. if I push by some name and that works then I should be able to run by that same name and it's running the image I just pushed |
DX Fixes Applied (ac17646)Addressed the consistency concerns raised by @sjmiller609. Here's what was wrong and what's fixed: Problem: Push / Run naming mismatchWhen you pushed an image via Fixes1. Strip registry host prefix on push (registry.go) The registry's manifest PUT handler was prepending
2. Backward-compat fallback in GetImage (images/manager.go) Added a fallback: if the normalized name isn't found, also try prepending the internal registry URL. This handles images that were stored with the old 3. Build Build results now return 4. Registry auth accepts user JWTs (middleware/oapi_auth.go)
5. Regenerated oapi code + added The Verified DX flowStill open
|
This comment has been minimized.
This comment has been minimized.
Build VM Networking Fixed (b2f5d1b)The build system now works end-to-end. Here's what was broken and what's fixed: Root cause: builder VMs couldn't reach the host registryThe builder VM was configured with
Fixes1. Registry URL rewriting for VMs (providers.go)
2. Proper BuildKit config in builder agent (builder_agent/main.go) Added 3. Multi-tenant iptables isolation (bridge.go) Changed iptables comments from generic 4. Registry auth path pattern fix (oapi_auth.go) Fixed 5. VM subnet auth fallback (oapi_auth.go)
Verified e2e flowBugbot responses
|
This comment has been minimized.
This comment has been minimized.
6f307c7 to
5dca4b0
Compare
✱ Stainless preview buildsThis PR will update the Edit this comment to update it. It will appear in the SDK's changelogs. ✅ hypeman-typescript studio · code · diff
✅ hypeman-go studio · code · diff
This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push. |
|
Rebased onto main + addressed bugbot comment Bugbot: "Repo parsing breaks reserved path names"This is now a non-issue after rebasing. The base branch already switched from a regex to Rebase summaryRebased onto
All conflicts resolved carefully to preserve both sides' functionality. Builds and vets clean. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Bugbot Autofix prepared fixes for 2 of the 2 bugs found in the latest run.
Or push these changes by commenting: Preview (c3527c7dd6)diff --git a/lib/builds/manager.go b/lib/builds/manager.go
--- a/lib/builds/manager.go
+++ b/lib/builds/manager.go
@@ -622,14 +622,15 @@
if tag == "" {
tag = "latest"
}
- imageRef = req.ImageName
if _, err := m.imageManager.ImportLocalImage(buildCtx, repo, tag, result.ImageDigest); err != nil {
m.logger.Warn("failed to re-tag image", "build_id", id, "image_name", req.ImageName, "error", err)
// Don't fail the build - the image is still accessible via builds/{id}
} else {
m.logger.Info("re-tagged build image", "build_id", id, "from", buildRepo, "to", repo)
+ imageRef = req.ImageName
// Wait for the re-tagged image to be ready
- if err := m.waitForImageReady(buildCtx, repo); err != nil {
+ retaggedRef := repo + ":" + tag
+ if err := m.waitForImageReady(buildCtx, retaggedRef); err != nil {
m.logger.Warn("re-tagged image conversion timed out", "build_id", id, "image_name", req.ImageName, "error", err)
}
} |
Allows callers to specify a custom image name for build output. When set,
the image is pushed to {registry}/{image_name} instead of the default
{registry}/builds/{id} path. Propagated through CreateBuildRequest,
BuildConfig, builder agent, API multipart parsing, and OpenAPI spec.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Strip registry host prefix when storing pushed images so names are consistent between push and run (e.g., push "myapp" → stored as "docker.io/library/myapp:latest" → run "myapp" finds it) - Add fallback in GetImage to try internal registry prefix for backward compatibility with previously stored images - Build image_ref now returns short name (e.g., "mybuiltapp") instead of "localhost:8081/mybuiltapp" so it can be used directly with `run` - Allow regular user JWT tokens for registry /v2/ endpoints (enables `hypeman push` from CLI without special registry tokens) - Regenerate oapi code to include image_name field - Add `make run` target for running without live reload Co-authored-by: Cursor <cursoragent@cursor.com>
- Rewrite registry URL from localhost to gateway IP (10.101.0.1:8081) when configuring builder VMs, since localhost inside a VM refers to the VM itself, not the host - Add setupBuildKitConfig to builder agent: writes buildkitd.toml with http=true for the internal registry (fixes HTTPS connection failures) - Set DOCKER_CONFIG env var explicitly for buildctl to find credentials in rootlesskit user namespace - Fix registryPathPattern to support repository names with 3+ path segments (e.g., a/b/c) - addresses bugbot deep path concern - Pass subnet CIDR to JwtAuth middleware so VM IP-based auth fallback matches the actual configured subnet (was hardcoded to 10.102.x.x) - Use bridge-name-scoped iptables comments (e.g., hypeman-nat-vmbr-rgarcia) to prevent multi-tenant instances from overwriting each other's rules Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
- Fix registry_test.go: look up images by short repo name (without host prefix) to match how the registry stores them after the path-based storage change - Remove credential helper from builder_agent: auth is now handled server-side via anonymous guest tokens from the token endpoint - Token endpoint issues guest tokens for all anonymous scoped requests, enabling BuildKit mirror pulls and build pushes without client-side credentials - Update token tests to reflect new guest token behavior Co-authored-by: Cursor <cursoragent@cursor.com>
…name token scoping
- Revert token.go: remove guest tokens, restore original auth-required behavior
- Revert builder_agent: restore original Docker config.json auth setup (JWT as Basic auth)
- Revert token/auth tests to match original behavior
- Fix token scoping: always include builds/{id} in token (builder's push destination),
plus image_name repo when set
- Fix post-build flow: wait for builds/{id} then re-tag to image_name via ImportLocalImage
- Add extractImageTag helper for parsing tags from image names
The root cause was two bugs in the image_name implementation:
1. The registry JWT only granted push to image_name, but builder pushes to builds/{id}
2. waitForImageReady looked for image_name, but the image was stored as builds/{id}
Co-authored-by: Cursor <cursoragent@cursor.com>
…pers Remove stripImageTag and extractImageTag in favor of images.ParseNormalizedRef which already handles repo/tag splitting. Also drop speculative image_name repo from JWT since the builder never accesses it. Co-authored-by: Cursor <cursoragent@cursor.com>
… for readiness check
- Move `imageRef = req.ImageName` inside the success branch of
ImportLocalImage so metadata falls back to builds/{id} on failure
- Use `repo:tag` instead of just `repo` when calling waitForImageReady
so tagged images (e.g. myapp:v1.0) are checked correctly
Co-authored-by: Cursor <cursoragent@cursor.com>
…fallback - Remove --network=host from builder image docker build (not needed) - Remove registryURL fallback in images.GetImage — we don't need backward-compat lookups with host-prefixed names since this isn't in prod yet - Remove registryURL parameter from images.NewManager - Remove user JWT fallback for registry auth in middleware — main branch doesn't have it and it was added speculatively - Add back removed comment about WWW-Authenticate telling clients where to get a token - Fix comment about ImageName token behavior Co-authored-by: Cursor <cursoragent@cursor.com>
Tests were using the old pattern of registry-host-prefixed refs
(e.g., "localhost:5000/builds/{id}") but waitForImageReady now
takes the short repo name directly (e.g., "builds/{id}").
Co-authored-by: Cursor <cursoragent@cursor.com>
…en oapi - Remove unnecessary `var err error` in getImageByRef, use := instead - Revert lib/middleware/oapi_auth.go to main (no functional changes needed) - Regenerate lib/oapi/oapi.go to include image_name field after rebase Co-authored-by: Cursor <cursoragent@cursor.com>
51c86e7 to
e4389a3
Compare

Summary
image_nameparameter to the build system, allowing callers to specify a custom image name for build outputimage_nameis set, images are pushed to{registry}/{image_name}instead of the default{registry}/builds/{id}CreateBuildRequest,BuildConfig, builder agent output ref, API multipart form parsing, registry token scoping, and OpenAPI specTest plan
image_name— verify existingbuilds/{id}behavior unchangedimage_name=myapp— verify image pushed to{registry}/myapp🤖 Generated with Claude Code
Note
Medium Risk
Touches build output publication and registry/image reference normalization, which can affect build-to-run workflows and image availability. Networking iptables rule changes also carry some operational risk if rule matching/cleanup behaves unexpectedly on hosts with existing rules.
Overview
Builds can now accept an optional
image_nameand the system will re-tag the completed build output to that name. The API parsesimage_namefrom multipart form data, propagates it throughCreateBuildRequest/BuildConfig, and after the builder pushes tobuilds/{id}the server optionally callsImportLocalImageto create the requested tag and updates build metadataImageRefaccordingly.Registry/image handling is adjusted to use short repo names (no host prefix): the registry conversion trigger now keys images by
pathRepoonly,waitForImageReadytakes a short ref, and registry-related tests were updated. Separately, networking iptables rule comments are made bridge-specific (with legacy cleanup) to avoid collisions across multiple deployments, andProvideBuildManagerrewriteslocalhost/127.0.0.1registry URLs to the subnet gateway for builder VM reachability; amake runtarget was added for non-hot-reload execution.Written by Cursor Bugbot for commit e4389a3. This will update automatically on new commits. Configure here.