-
Notifications
You must be signed in to change notification settings - Fork 178
Write to cache when building a template #1133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
d141efb
to
f8f1a6f
Compare
68ece42
to
5130329
Compare
} | ||
|
||
totalSize := stat.Size() | ||
var wg sync.WaitGroup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about using errorgroup instead which has included concurrency limit by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
errgroup will cancel the context and goroutines if an error is encountered, which we don't want. If a single chunk fails for some reason, we still want all of the rest of the chunks to write to disk.
@djeebus Let's split to PR preparing for this change (refactor) and adding the caching behavior. |
2b47e2d
to
5e6fc67
Compare
OK, I've removed all the nice-to-haves, the rest will go in other PRs. |
# Conflicts: # packages/orchestrator/internal/template/build/builder.go
There is currently a mismatch between reading/writing whole files and reading/writing chunked files. We need to do things:
|
This is blocked by #1361 ; will refactor after that gets merged. |
Note
Adds optional NFS-backed caching when building templates and implements write-through local caching in storage, wiring flags and usage across orchestrator components with updated tests/mocks.
featureFlags
intobuild.NewBuilder
and template server; use envSHARED_CHUNK_CACHE_PATH
.feature_flags.BuildingFeatureFlagName
is enabled, wrap template storage withstorage.NewCachedProvider
for build reads/writes.templateStorage
.packages/shared/pkg/storage
):CachedFileObjectProvider.WriteFromFileSystem
andWrite
now populate local chunk cache while writing to remote.Delete
andDeleteObjectsWithPrefix
.BuildingFeatureFlagName
(use NFS for building templates).packages/shared/pkg/storage
..mockery.yaml
to generate storage mocks inpackages/shared/pkg/storage
.Written by Cursor Bugbot for commit b6a786c. This will update automatically on new commits. Configure here.