Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
4955761
feat(cache): introduce a Cacher interface
bchalios May 13, 2026
32e9696
feat(memfd): parse memfd from Firecracker when present
bchalios May 13, 2026
17bffdf
feat(memfd): use memfd to export sandbox memory
bchalios May 14, 2026
631fefc
test(memfd): add unit tests for memfd functionality
bchalios May 14, 2026
6d430ef
feat(memfd): add feature flag for memfd
bchalios Apr 29, 2026
66be8a2
refactor(memfd): minimize diff and split copy chunk from block size
ValentaTomas May 17, 2026
2bbbf3a
chore: auto-commit generated changes
github-actions[bot] May 17, 2026
2504ef4
fix(memfd): drop double-close of memfd in exportMemoryFromMemfd
ValentaTomas May 17, 2026
89671a3
refactor(memfd): embed *Cache, drop chunk loop, slim tests
ValentaTomas May 17, 2026
3eea952
refactor(memfd): eager mmap in NewFromFd, drop size param
ValentaTomas May 17, 2026
083df44
refactor(memfd): drop double-close sentinels from Memfd.Close
ValentaTomas May 17, 2026
aa242ce
refactor(memfd): pass dirty bitmap to NewCacheFromMemfd
ValentaTomas May 17, 2026
23f5d96
feat(memfd): add sandbox-type LD attribute and target UseMemFdFlag
ValentaTomas May 17, 2026
bdbd7bb
refactor(block): rename Cacher interface to DiffSource
ValentaTomas May 17, 2026
2771526
refactor(memfd): minor simplifications
ValentaTomas May 17, 2026
a13ccca
refactor(memfd): drop unused MemfdCache/DiffSource scaffolding
ValentaTomas May 17, 2026
18ee751
feat(memfd): gate UseMemFdFlag behind FC ≥ 1.14
ValentaTomas May 17, 2026
e6786d6
feat(cache): allow memory files with various block sizes
bchalios May 7, 2026
4bf8e4d
feat(cache): add Cache deduplication logic
bchalios May 14, 2026
139ced1
feat(cache): wire deduplication logic
bchalios May 15, 2026
c70aeac
fix(memfd-test): resolve leftover merge-conflict markers
ValentaTomas May 19, 2026
64b374e
chore: trim verbose comments
ValentaTomas May 19, 2026
8685b2a
refactor: declare dedup BlockSize on the deduped header itself
ValentaTomas May 19, 2026
45646c1
refactor: unify dedup core, fix uuid.Nil read invariant
ValentaTomas May 19, 2026
332a21a
chore: simplify ExportMemory and trim helper docs
ValentaTomas May 19, 2026
432cfe3
perf: iterate ranges (not bits) when expanding original Empty
ValentaTomas May 19, 2026
9783d35
test: consolidate dedup tests via runDedup helper
ValentaTomas May 19, 2026
6fa3f87
fix: revert Metadata.BlockSize override; validate at PageSize
ValentaTomas May 19, 2026
e847ef9
fix: route FC page size from FC, not from header BlockSize
ValentaTomas May 19, 2026
eed8c8c
fix(memory): deterministic dedup output path
ValentaTomas May 19, 2026
4c5e8f9
fix: child Metadata.BlockSize takes finer of parent and diff
ValentaTomas May 19, 2026
3ad311c
Merge origin/main into feat/compact-diff
ValentaTomas May 20, 2026
ee6c187
fix(lint): nlreturn + drop redundant uint64 cast
ValentaTomas May 20, 2026
0f17456
test: drop AllPagesMatch (subsumed by ZeroMatchingPagesGoIntoEmpty)
ValentaTomas May 20, 2026
4e326a7
chore: tighten dedup-related docs
ValentaTomas May 20, 2026
01bfaa4
chore: keep main's flag docs to minimize diff
ValentaTomas May 20, 2026
e060efc
chore: keep main's uffd doc comments verbatim
ValentaTomas May 20, 2026
29d2119
chore: drop MixedPages test (covered by ContiguousDirtyBlocks); tight…
ValentaTomas May 20, 2026
f15e9e0
ci: retrigger (nfsproxy DNS flake)
ValentaTomas May 20, 2026
c34fd2c
fix(dedup-flag): pass sandbox LD context for per-team targeting
ValentaTomas May 20, 2026
83f7f23
perf(dedup): skip base.ReadAt for uuid.Nil parent blocks
ValentaTomas May 20, 2026
1c3968b
feat(dedup): report base-cache hit ratio during dedup runs
ValentaTomas May 20, 2026
d1bd3f3
feat(dedup): add memfile-diff-dedup-best-effort flag
ValentaTomas May 20, 2026
ad0bfcd
perf(dedup): batch per-block page writes via pwritev
ValentaTomas May 20, 2026
804c8d6
chore: auto-commit generated changes
github-actions[bot] May 20, 2026
7cc6230
chore: drop unused writeAll (replaced by pwritevAll)
ValentaTomas May 20, 2026
d7364e2
fix(lint): nlreturn, intrange, testifylint
ValentaTomas May 20, 2026
81ce699
fix(uffd): per-instance pagePool sized to actual pageSize
ValentaTomas May 20, 2026
af24d57
refactor(uffd): derive page size from regions only
ValentaTomas May 20, 2026
c0e3708
fix(metadata): keep parent BlockSize, validate mappings at PageSize
ValentaTomas May 20, 2026
84fd4f1
fix(upload): validate frame size against the new diff's block size
ValentaTomas May 20, 2026
b1bb27d
fix(upload): fall back to header block size when diff is empty
ValentaTomas May 20, 2026
1752a5f
fix(upload): validate frame size against merged Metadata.BlockSize
ValentaTomas May 20, 2026
059d255
refactor: simplify dedup config, page pool, and cache stats
ValentaTomas May 20, 2026
0a3fe2d
fix(dedup): plug two correctness bugs surfaced by Nikita Kalyazin
ValentaTomas May 20, 2026
8e79501
perf(dedup): two-phase bulk pwritev across the whole dedup walk
ValentaTomas May 20, 2026
7c74834
fix(chunker): satisfy modernize lint (use min)
ValentaTomas May 20, 2026
79fd011
fix(template): forward IsCached from Storage to underlying build.File
ValentaTomas May 20, 2026
cc23f45
feat(dedup): optional O_DIRECT path under flag
ValentaTomas May 20, 2026
9f1d504
revert(dedup): drop the bulk-pwritev defer-to-end pass
ValentaTomas May 20, 2026
0dd32d8
chore(dedup): trim verbose comments
ValentaTomas May 20, 2026
83fa715
fix(uffd): treat short ReadAt as a retriable error in faultPage
ValentaTomas May 20, 2026
61861e2
perf(dedup): drop baseBuf, slice base zero-copy per page
ValentaTomas May 20, 2026
89cb911
chore(dedup): trace per-phase timing + parallelism note
ValentaTomas May 20, 2026
b7f770e
perf(dedup): accumulate iovs across the walk and drain in bulk
ValentaTomas May 20, 2026
3de544d
chore(dedup,uffd): drop redundant IsZero, fix early-return lint
ValentaTomas May 20, 2026
3d2a4b7
chore(dedup): tighten dedup-related comments and revert unrelated edits
ValentaTomas May 20, 2026
bded07d
perf(dedup): classify into bitmaps in phase 1, materialize iovs in drain
ValentaTomas May 20, 2026
ab3836c
feat(metrics): record dedup savings on snapshot.diff histograms
ValentaTomas May 20, 2026
f1cfa4e
Merge origin/main into feat/compact-diff
ValentaTomas May 20, 2026
a6678e4
fix(metrics): satisfy modernize lint with max()
ValentaTomas May 20, 2026
ff6cc0d
chore(dedup): tighten comments and tests
ValentaTomas May 20, 2026
18302df
chore(dedup): trim metric and test docstrings
ValentaTomas May 20, 2026
cacf43a
chore: auto-commit generated changes
github-actions[bot] May 20, 2026
388be9b
feat(metrics): tag dedup samples with dedup_best_effort
ValentaTomas May 20, 2026
e60cfb4
refactor(metrics): collapse dedup attrs into kind ∈ {none, dedup, bes…
ValentaTomas May 20, 2026
03d7448
ci: retrigger flaky goproxy network failure
ValentaTomas May 20, 2026
6ff7e88
Merge branch 'main' into feat/compact-diff
ValentaTomas May 21, 2026
14d4b7e
Merge remote-tracking branch 'origin/main' into feat/compact-diff
ValentaTomas May 21, 2026
6674c57
Reduce duplicate cache lookup helpers
ValentaTomas May 22, 2026
9017e0c
Merge remote-tracking branch 'origin/main' into HEAD
ValentaTomas May 22, 2026
9a06f5f
Address dedup review feedback
ValentaTomas May 22, 2026
fef9278
Exercise memfile dedup in integration tests
ValentaTomas May 22, 2026
1b0fc4e
chore: auto-commit generated changes
github-actions[bot] May 22, 2026
ebc1936
Exercise dedup variants in integration tests
ValentaTomas May 23, 2026
fa130e4
Handle empty pwritev batches
ValentaTomas May 23, 2026
9f9bcc2
Trim unused integration flag override
ValentaTomas May 23, 2026
7746ac7
Route zero dedup pages to Empty
ValentaTomas May 23, 2026
6887222
Fix dedup lint spacing
ValentaTomas May 23, 2026
76e9d6b
Minimize dedup test wiring
ValentaTomas May 23, 2026
ba28b2e
Stream dedup dirty page writes
ValentaTomas May 23, 2026
22991cc
Wake zero-filled faults on WP failure
ValentaTomas May 24, 2026
0ecb16e
Fix userfaultfd lint spacing
ValentaTomas May 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/actions/start-services/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ inputs:
description: "Number of frame encode workers"
required: false
default: ""
dedup_mode:
description: "Memfile dedup mode"
required: false
default: "default"

runs:
using: "composite"
Expand Down Expand Up @@ -129,6 +133,7 @@ runs:
COMPRESS_TYPE: ${{ inputs.compress_type }}
COMPRESS_LEVEL: ${{ inputs.compress_level }}
COMPRESS_FRAME_ENCODE_WORKERS: ${{ inputs.compress_workers }}
TESTS_MEMFILE_DIFF_DEDUP_MODE: ${{ inputs.dedup_mode }}
E2B_DEBUG: "true"
run: |
mkdir -p $SHARED_CHUNK_CACHE_PATH
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,19 @@ jobs:
compress_type: ""
compress_level: ""
compress_workers: ""
dedup_mode: "default"
- name: zstd1
compress_enabled: "true"
compress_type: "zstd"
compress_level: "1"
compress_workers: "8"
dedup_mode: "best_effort"
- name: lz4
compress_enabled: "true"
compress_type: "lz4"
compress_level: "0"
compress_workers: "8"
dedup_mode: "direct_io"
env:
# Surfaced as env so upload steps can gate on presence (skipped on fork PRs).
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Expand Down Expand Up @@ -64,6 +67,7 @@ jobs:
compress_type: ${{ matrix.compress_type }}
compress_level: ${{ matrix.compress_level }}
compress_workers: ${{ matrix.compress_workers }}
dedup_mode: ${{ matrix.dedup_mode }}

- name: Run Integration Tests
env:
Expand Down
19 changes: 19 additions & 0 deletions packages/orchestrator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,41 @@ package main

import (
"context"
"os"

"github.com/launchdarkly/go-sdk-common/v3/ldvalue"

"github.com/e2b-dev/infra/packages/orchestrator/pkg/factories"
"github.com/e2b-dev/infra/packages/orchestrator/pkg/tcpfirewall"
"github.com/e2b-dev/infra/packages/orchestrator/pkg/version"
"github.com/e2b-dev/infra/packages/shared/pkg/featureflags"
)

var commitSHA string

func main() {
applyTestFlagOverrides()

factories.Run(factories.Options{
Version: version.Version,
CommitSHA: commitSHA,
EgressFactory: defaultEgressFactory,
})
}

func applyTestFlagOverrides() {
mode := os.Getenv("TESTS_MEMFILE_DIFF_DEDUP_MODE")
if mode == "" {
return
}

featureflags.OverrideJSONFlag(featureflags.MemfileDiffDedupFlag, ldvalue.FromJSONMarshal(map[string]any{
"enabled": true,
"bestEffort": mode == "best_effort",
"directIO": mode == "direct_io",
}))
}

func defaultEgressFactory(_ context.Context, deps *factories.Deps) (*factories.EgressSetup, error) {
fw := tcpfirewall.New(
deps.Logger,
Expand Down
Loading
Loading