Skip to content

CLI(inspect-build): support V4/V5 headers, compression - #2985

Merged
levb merged 2 commits into
mainfrom
lev-compression-CLI
Jun 11, 2026
Merged

levb merged 2 commits into
mainfrom
lev-compression-CLI

Conversation

@levb

@levb levb commented Jun 11, 2026 •

Copy link
Copy Markdown
Contributor

100% VIBE CODED but appears to display everything correctly.

Single render pipeline (HEADER / IMAGE / MAPPINGS / BUILDS / DATA / HEATMAP / METADATA) with a human TTY dashboard and JSON output. HEATMAP shows per-2MiB-chunk compression and cold-fetch fanout, mirroring block.Chunker.locateChunk. JSON is header-dump style: frame tables embedded under builds[], self carries fetches per frame.

Flags: -build / -template / -storage / -memfile / -rootfs, -human / -json, -decimal, -expand=mappings,frames,metadata,all, -range=offset:size, -validate (fetch + decompress every frame via the production read path and verify checksum), -recursive (walk the ancestor chain). Pre-redesign tool preserved behind --old.

image

@cla-bot cla-bot Bot added the cla-signed label Jun 11, 2026
@codecov

codecov Bot commented Jun 11, 2026 •

Copy link
Copy Markdown

❌ 4 Tests Failed:

Tests completed Failed Passed Skipped
2833 4 2829 5
View the top 3 failed test(s) by shortest run time
github.com/e2b-dev/infra/packages/orchestrator/pkg/nfsproxy::TestRoundTrip
Stack Traces | 0.01s run time
=== RUN   TestRoundTrip
=== PAUSE TestRoundTrip
=== CONT  TestRoundTrip
2026-06-11T19:51:25.132Z	INFO	logger/logger.go:156	sandbox network map entry added	{"sandbox.id": "575050b0-ad1a-44f6-be4f-a6658d29e35d", "sandbox.lifecycle.id": "", "sandbox.ip": "10.0.0.138"}
    proxy_test.go:77: creating volume dir: .../001/team-5c264fb9-bcca-4a25-841f-4409702232fc/vol-de92be55-3b16-4ad4-a915-df498081069d
    proxy_test.go:78: creating volume dir: .../001/team-5c264fb9-bcca-4a25-841f-4409702232fc/vol-d8d179a4-de8a-4b39-a758-08cf16ae5e12
2026-06-11T19:51:25.133Z	INFO	logger/logger.go:156	sandbox network map entry added	{"sandbox.id": "38673e6e-1e13-400b-9ae8-2392e83c5433", "sandbox.lifecycle.id": "", "sandbox.ip": "127.0.0.1"}
    proxy_test.go:146: 
        	Error Trace:	.../pkg/nfsproxy/proxy_test.go:146
        	Error:      	Received unexpected error:
        	            	dial tcp :57846->127.0.0.1:45749: bind: address already in use
        	Test:       	TestRoundTrip
--- FAIL: TestRoundTrip (0.01s)
github.com/e2b-dev/infra/tests/integration/internal/tests/api/sandboxes::TestUpdateNetworkConfig/12_allow_internet_access_false_blocks_all
Stack Traces | 0.1s run time
=== RUN   TestUpdateNetworkConfig/12_allow_internet_access_false_blocks_all
Executing command curl in sandbox i50cxjxe2vea9xecs1b2k
    sandbox_network_update_test.go:355: Command [curl] output: event:{start:{pid:1390}}
    sandbox_network_update_test.go:355: 
        	Error Trace:	.../api/sandboxes/sandbox_network_out_test.go:78
        	            				.../api/sandboxes/sandbox_network_update_test.go:87
        	            				.../api/sandboxes/sandbox_network_update_test.go:355
        	Error:      	"failed to execute command curl in sandbox i50cxjxe2vea9xecs1b2k: invalid_argument: protocol error: incomplete envelope: unexpected EOF" does not contain "failed with exit code"
        	Test:       	TestUpdateNetworkConfig/12_allow_internet_access_false_blocks_all
        	Messages:   	Expected connection failure message
--- FAIL: TestUpdateNetworkConfig/12_allow_internet_access_false_blocks_all (0.10s)
github.com/e2b-dev/infra/tests/integration/internal/tests/envd::TestWorkdirPermissionDenied
Stack Traces | 1.47s run time
=== RUN   TestWorkdirPermissionDenied
=== PAUSE TestWorkdirPermissionDenied
=== CONT  TestWorkdirPermissionDenied
    process_test.go:253: Command [/bin/bash] output: event:{start:{pid:1256}}
    process_test.go:253: Command [/bin/bash] output: event:{end:{exited:true status:"exit status 0"}}
    process_test.go:253: Command [/bin/bash] completed successfully in sandbox ihusvhypyvdff1u8jzdah
Executing command /bin/bash in sandbox ihusvhypyvdff1u8jzdah
    process_test.go:256: Command [/bin/bash] output: event:{start:{pid:1258}}
    process_test.go:257: 
        	Error Trace:	.../tests/envd/process_test.go:257
        	Error:      	Received unexpected error:
        	            	failed to execute command /bin/bash in sandbox ihusvhypyvdff1u8jzdah: invalid_argument: protocol error: incomplete envelope: unexpected EOF
        	Test:       	TestWorkdirPermissionDenied
        	Messages:   	Directory should exist
--- FAIL: TestWorkdirPermissionDenied (1.47s)
github.com/e2b-dev/infra/tests/integration/internal/tests/api/sandboxes::TestUpdateNetworkConfig
Stack Traces | 196s run time
=== RUN   TestUpdateNetworkConfig
=== PAUSE TestUpdateNetworkConfig
=== CONT  TestUpdateNetworkConfig
--- FAIL: TestUpdateNetworkConfig (196.33s)
View the full list of 2 ❄️ flaky test(s)
github.com/e2b-dev/infra/tests/integration/internal/tests/orchestrator::TestSandboxMemoryIntegrity

Flake rate in main: 52.45% (Passed 1027 times, Failed 1133 times)

Stack Traces | 70.8s run time
=== RUN   TestSandboxMemoryIntegrity
=== PAUSE TestSandboxMemoryIntegrity
=== CONT  TestSandboxMemoryIntegrity
    sandbox_memory_integrity_test.go:27: Build completed successfully
--- FAIL: TestSandboxMemoryIntegrity (70.77s)
github.com/e2b-dev/infra/tests/integration/internal/tests/orchestrator::TestSandboxMemoryIntegrity/tmpfs_hash

Flake rate in main: 52.45% (Passed 1017 times, Failed 1122 times)

Stack Traces | 200s run time
=== RUN   TestSandboxMemoryIntegrity/tmpfs_hash
=== PAUSE TestSandboxMemoryIntegrity/tmpfs_hash
=== CONT  TestSandboxMemoryIntegrity/tmpfs_hash
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{start:{pid:1252}}
Executing command bash in sandbox i8jo120vqkfn1tsbi8fmh (user: root)
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stdout:"Total memory: 985 MB\nUsed memory before tmpfs mount: 188 MB\nFree memory before tmpfs mount: 796 MB\n"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stdout:"Memory to use in integrity test (60% of free, min 64MB): 477 MB\n"}}
Executing command bash in sandbox iq7tqu0j6r1gxzhy7ctgc (user: root)
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"477+0 records in\n477+0 records out\n500170752 bytes (500 MB, 477 MiB) copied, 2.40284 s, 208 MB/s\n"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"\tCommand being timed: \"dd if=/dev/urandom of=/mnt/testfile bs=1M count=477\"\n\tUser time (seconds): 0.00\n\tSystem time (seconds): 2.35\n\tPercent of CPU this job got: 97%\n\tElapsed (wall clock) time (h:mm:ss or m:ss): 0:02.41\n\tAverage shared text size (kbytes): 0\n\tAverage unshared data size (kbytes): 0\n\tAverage stack size (kbytes): 0\n\tAverage total size (kbytes): 0\n\tMaximum resident set size (kbytes): 2700\n\tAverage resident set size (kbytes): 0\n\tMajor (requiring I/O) page faults: 3\n\tMinor (reclaiming a frame) page faults: 345\n\tVoluntary context switches: 4\n\tInvoluntary context switches: 11\n\tSwaps: 0\n\tFile system inputs: 176\n\tFile system outputs: 0\n\tSocket messages sent: 0\n\tSocket messages received: 0\n\tSignals delivered: 0\n\tPage size (bytes): 4096\n\tExit status: 0\n"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stdout:"Used memory after tmpfs mount and file fill: 670 MB\n"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{end:{exited:true status:"exit status 0"}}
    sandbox_memory_integrity_test.go:70: Command [bash] completed successfully in sandbox i8gk5wwqfr2ujgmyb34ar
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
    sandbox_memory_integrity_test.go:80: Command [bash] output: event:{start:{pid:1269}}
Executing command bash in sandbox iq7tqu0j6r1gxzhy7ctgc (user: root)
    sandbox_memory_integrity_test.go:80: Command [bash] output: event:{data:{stdout:"fe4eb90e2153ef872eddb431f1eea32a22a845d4c5b4b4351c1574126c35592e\n"}}
    sandbox_memory_integrity_test.go:80: Command [bash] output: event:{end:{exited:true status:"exit status 0"}}
    sandbox_memory_integrity_test.go:80: Command [bash] completed successfully in sandbox i8gk5wwqfr2ujgmyb34ar
    sandbox_memory_integrity_test.go:80: Command [bash] output: event:{start:{pid:1272}}
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
Executing command bash in sandbox i8gk5wwqfr2ujgmyb34ar (user: root)
    sandbox_memory_integrity_test.go:110: 
        	Error Trace:	.../tests/orchestrator/sandbox_memory_integrity_test.go:81
        	            				.../hostedtoolcache/go/1.26.3.../src/runtime/asm_amd64.s:1771
        	Error:      	Received unexpected error:
        	            	failed to execute command bash in sandbox i8gk5wwqfr2ujgmyb34ar: unavailable: HTTP status 502 Bad Gateway
    sandbox_memory_integrity_test.go:110: 
        	Error Trace:	.../tests/orchestrator/sandbox_memory_integrity_test.go:78
        	            				.../tests/orchestrator/sandbox_memory_integrity_test.go:110
        	Error:      	Condition never satisfied
        	Test:       	TestSandboxMemoryIntegrity/tmpfs_hash
--- FAIL: TestSandboxMemoryIntegrity/tmpfs_hash (199.85s)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

In packages/orchestrator/cmd/inspect-build/validate.go, the seekable object returned by OpenSeekable is leaked if subsequent initialization steps in openChunker fail before the chunker is successfully created. A deferred cleanup block should be introduced to close the object on any initialization failure.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread packages/orchestrator/cmd/inspect-build/validate.go
Single render pipeline (HEADER / IMAGE / MAPPINGS / BUILDS / DATA / HEATMAP
/ METADATA) with a human TTY dashboard and JSON output. HEATMAP shows
per-2MiB-chunk compression and cold-fetch fanout, mirroring
block.Chunker.locateChunk. JSON is header-dump style: frame tables embedded
under builds[], self carries fetches per frame.

Flags: -build / -template / -storage / -memfile / -rootfs, -human / -json,
-decimal, -expand=mappings,frames,metadata,all, -range=offset:size,
-validate (fetch + decompress every frame via the production read path and
verify checksum), -recursive (walk the ancestor chain). The pre-redesign
header-dump tool is preserved in main.go behind --old; the new dispatcher
lives at the top of main() and the new entry point is runInspect() in
inspect.go.
@levb
levb force-pushed the lev-compression-CLI branch from b347d28 to def98b7 Compare June 11, 2026 18:14
@levb levb changed the title inspect-build: support V4/V5 headers, compression CLI(inspect-build): support V4/V5 headers, compression Jun 11, 2026
@levb
levb marked this pull request as ready for review June 11, 2026 18:17

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: def98b7444

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread packages/orchestrator/cmd/inspect-build/validate.go Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9e4cf50205

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread packages/orchestrator/cmd/inspect-build/validate.go
@levb
levb enabled auto-merge (squash) June 11, 2026 19:58
ValentaTomas added a commit that referenced this pull request Jun 11, 2026
## Summary

`TestRoundTrip` in `pkg/nfsproxy` fails intermittently with `bind:
address already in use` (e.g. on [PR
#2985](https://github.com/e2b-dev/infra/actions/runs/27373170636/job/80890489083)).
The `go-nfs-client` library binds a random ephemeral local port when
dialing and only retries `EADDRINUSE` collisions for privileged dials,
so non-privileged dials flake on port collisions. Retry the dials in the
test on `EADDRINUSE`.
@levb
levb merged commit 86508ba into main Jun 11, 2026
96 of 98 checks passed
@levb
levb deleted the lev-compression-CLI branch June 11, 2026 20:41
ValentaTomas added a commit that referenced this pull request Jun 11, 2026
Main is broken: #2919 moved the upstream `Seekable` out of
`block.NewChunker` and into `Chunker.Slice` (as a `storage.RangeOpener`
param), and #2985 merged alongside it without picking up the new
signatures, so `cmd/inspect-build` fails to compile (see [this
run](https://github.com/e2b-dev/infra/actions/runs/27380475452/job/80915690448)).

Updates `validate.go` to the new API: `openChunker` now also returns the
storage object, which is passed to each `Slice` call — mirroring the
production read path in `storage_diff.go`.
Piwriw pushed a commit to Piwriw/infra that referenced this pull request Jun 12, 2026
## Summary

`TestRoundTrip` in `pkg/nfsproxy` fails intermittently with `bind:
address already in use` (e.g. on [PR
e2b-dev#2985](https://github.com/e2b-dev/infra/actions/runs/27373170636/job/80890489083)).
The `go-nfs-client` library binds a random ephemeral local port when
dialing and only retries `EADDRINUSE` collisions for privileged dials,
so non-privileged dials flake on port collisions. Retry the dials in the
test on `EADDRINUSE`.
Piwriw pushed a commit to Piwriw/infra that referenced this pull request Jun 12, 2026
Piwriw pushed a commit to Piwriw/infra that referenced this pull request Jun 12, 2026
…ev#2989)

Main is broken: e2b-dev#2919 moved the upstream `Seekable` out of
`block.NewChunker` and into `Chunker.Slice` (as a `storage.RangeOpener`
param), and e2b-dev#2985 merged alongside it without picking up the new
signatures, so `cmd/inspect-build` fails to compile (see [this
run](https://github.com/e2b-dev/infra/actions/runs/27380475452/job/80915690448)).

Updates `validate.go` to the new API: `openChunker` now also returns the
storage object, which is passed to each `Slice` call — mirroring the
production read path in `storage_diff.go`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants