Skip to content

Use localhost registry when flyte endpoint is localhost#893

Merged
pingsutw merged 6 commits intomainfrom
local-registry
Apr 7, 2026
Merged

Use localhost registry when flyte endpoint is localhost#893
pingsutw merged 6 commits intomainfrom
local-registry

Conversation

@pingsutw
Copy link
Copy Markdown
Member

@pingsutw pingsutw commented Apr 2, 2026

Summary

  • When the configured Flyte endpoint contains localhost, automatically use localhost:30000 as the image registry instead of ghcr.io/flyteorg
  • Configure the buildx builder with --driver-opt network=host so the BuildKit daemon can reach localhost registries on the host machine
  • Adds _get_base_registry() function that checks the initialized config endpoint dynamically

Test plan

  • Verify default registry remains ghcr.io/flyteorg when endpoint is not localhost
  • Verify registry switches to localhost:30000 when endpoint contains localhost
  • Verify buildx builder can push to localhost registry in sandbox environment

pingsutw added 3 commits April 1, 2026 19:29
When the configured Flyte endpoint contains 'localhost', automatically
use localhost:30000 as the image registry instead of ghcr.io/flyteorg.
Also configure the buildx builder with host networking so it can reach
localhost registries on the host machine.

Signed-off-by: Kevin Su <pingsutw@apache.org>
Signed-off-by: Kevin Su <pingsutw@apache.org>
Signed-off-by: Kevin Su <pingsutw@apache.org>
@pingsutw pingsutw self-assigned this Apr 2, 2026
Comment thread src/flyte/_image.py
init_config = _get_init_config()
if init_config and init_config.client:
endpoint = init_config.client.endpoint
if endpoint and "localhost" in endpoint:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What if someone port forwards? Maybe an env var to disable this

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

They can use .clone() to override the registry. the original default registry (ghcr.io/flyteorg) doesn't work for them as well.

pingsutw added 3 commits April 7, 2026 10:23
docker manifest inspect doesn't work with OCI manifests pushed by
buildx to local/insecure registries. Switch to docker buildx imagetools
inspect which handles both Docker and OCI manifest formats correctly.

Also filter out attestation manifests from the platform list and handle
single-platform images without a manifest list.

Signed-off-by: Kevin Su <pingsutw@apache.org>
_ensure_buildx_builder now inspects the existing builder to verify it
has the network=host driver option. If the option is missing, the
builder is removed and recreated with the correct configuration.

Signed-off-by: Kevin Su <pingsutw@apache.org>
Signed-off-by: Kevin Su <pingsutw@apache.org>
@pingsutw pingsutw merged commit c4bdf57 into main Apr 7, 2026
31 checks passed
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.

3 participants