Stream backup archive directly to S3 to reduce ephemeral storage#4263
Draft
Stream backup archive directly to S3 to reduce ephemeral storage#4263
Conversation
Agent-Logs-Url: https://github.com/sillsdev/TheCombine/sessions/aa2742e4-8a85-48c9-82a2-3d3d7ee75063 Co-authored-by: imnasnainaec <6411521+imnasnainaec@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Reduce ephemeral storage used by backup job
Stream backup archive directly to S3 to reduce ephemeral storage
Apr 10, 2026
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.
The daily backup job was consuming ~14 GB of node ephemeral storage because the tar.gz archive was written to local disk in full before being uploaded to S3 — making peak usage roughly
raw_files + archive_size.Changes
aws_backup.py: Addpush_stream(dest)— launchesaws s3 cp - s3://...as a subprocess and returns thePopenhandle for callers to stream data viastdin.combine_backup.py: Replace localtarfile.open(file, "x:gz")+aws.push(file)withtarfile.open(fileobj=upload_proc.stdin, mode="w:gz"), piping the archive directly to S3 as it is built. The archive is never materialized on disk.Peak ephemeral storage drops from roughly
max(db_dump, backend_files) + archive_sizeto justmax(db_dump, backend_files).This change is