feat: compress job logs above a threshold before uploading it as an artifact #253
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.
https://github.com/renderedtext/tasks/issues/6930
Issue
Since the artifacts API does not support multipart uploads yet, uploading the job logs as an artifact is not possible if the amount of job logs produced is bigger than the amount of data the artifact storage backend can take. For example, when using S3 as the backend for artifact storage, we are limited to 5GB files.
Solution
If the file is above a certain threshold, we compress it before uploading it as an artifact. The default threshold is 100M, but it can be configured with the
SEMAPHORE_AGENT_LOGS_COMPRESSION_SIZE
environment variable.