You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(cache): add immediate upload mode for external interruption resilience
Add LEEWAY_CACHE_UPLOAD_IMMEDIATE environment variable to enable uploading
packages to remote cache immediately after each successful build, rather than
waiting until the end of the entire build process.
This addresses scenarios where builds are interrupted externally (CI timeouts,
manual cancellation, SIGTERM/SIGKILL) before the final upload phase, causing
loss of all successfully built packages.
Changes:
- Add LEEWAY_CACHE_UPLOAD_IMMEDIATE environment variable (default: false)
- Implement immediate per-package upload in RegisterNewlyBuilt()
- Track uploaded packages to prevent duplicates
- Skip already-uploaded packages in final batch upload
- Add uploadPackageImmediately() method with error handling
- Document new environment variable in README
Trade-offs:
- Immediate mode: More network calls but survives interruptions
- Default mode: Single batch upload, more efficient but vulnerable to interrupts
Usage:
export LEEWAY_CACHE_UPLOAD_IMMEDIATE=true
leeway build your-package
Co-authored-by: Ona <no-reply@ona.com>
Copy file name to clipboardExpand all lines: README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -491,6 +491,7 @@ variables have an effect on leeway:
491
491
For details on configuring AWS credentials see https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html
492
492
- `LEEWAY_CACHE_DIR`: Location of the local build cache. The directory does not have to exist yet.
493
493
- `LEEWAY_BUILD_DIR`: Working location of leeway (i.e. where the actual builds happen). This location will see heavy I/O which makes it advisable to place this on a fast SSD or in RAM.
494
+
- `LEEWAY_CACHE_UPLOAD_IMMEDIATE`: When set to "true", packages are uploaded to remote cache immediately after successful build, rather than waiting until the end of the entire build. This is useful when builds may be interrupted externally (e.g., CI timeouts, manual cancellation) to ensure partial results are cached. Defaults to "false".
494
495
- `LEEWAY_YARN_MUTEX`: Configures the mutex flag leeway will pass to yarn. Defaults to "network". See https://yarnpkg.com/lang/en/docs/cli/#toc-concurrency-and-mutex for possible values.
495
496
- `LEEWAY_EXPERIMENTAL`: Enables exprimental features
0 commit comments