fix: combine k8s proxy test images to eliminate duplicate interpreter layers#1138
Open
agentydragon wants to merge 1 commit intodevelfrom
Open
fix: combine k8s proxy test images to eliminate duplicate interpreter layers#1138agentydragon wants to merge 1 commit intodevelfrom
agentydragon wants to merge 1 commit intodevelfrom
Conversation
… layers py_image_layer embeds the binary name in runfiles paths, so separate binaries produce different layer digests for identical Python content. mock_k8s_server and k8s_test_client each had a 112 MB interpreter layer with different hashes — loaded twice by docker, never deduplicated. Combine both scripts into a single aspect_py_binary with a dispatcher (k8s_proxy_test_tools.py) that routes via K8S_PROXY_TEST_ROLE env var. One image, one docker load, one interpreter layer. Before: 3 docker loads (99 + 145 + 144 = 388 MB), test time 45.3s After: 2 docker loads (99 + 155 = 254 MB), test time 35.8s Also set size="medium" (300s) for safe headroom — the default size="small" (60s) was causing intermittent timeouts on slower RBE workers (passing runs at 56s, timeout at 60.1s). https://claude.ai/code/session_01ANqoTWWCxF71H5Aq2DqwnT
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Combine mock_k8s_server and k8s_test_client into a single container image to eliminate duplicate Docker layer loads.
Root cause
py_image_layerembeds the binary name in runfiles paths (mock_k8s_server_bin.runfiles/...vsk8s_test_client_bin.runfiles/...), producing different layer digests for the identical Python 3.13 interpreter (~112 MB each). Docker loads this content twice — confirmed by comparing diffIDs in the OCI image configs.Changes
k8s_proxy_test_tools.pydispatcher: routes to mock_k8s_server or k8s_proxy_test_client based onK8S_PROXY_TEST_ROLEenv varaspect_py_binarywith both scripts + all depssize="medium"(300s) — defaultsize="small"(60s) was causing intermittent timeouts (passing at 56s, timeout at 60.1s)Measurements
Test plan
bazel test --nocache_test_results //devinfra/claude/hook_daemon/session_start:test_k8s_proxy_integrationpasses on RBE (35.8s)https://claude.ai/code/session_01ANqoTWWCxF71H5Aq2DqwnT