[8.18] (backport #9133) Cache binaries downloaded for packaging locally#9906
Merged
[8.18] (backport #9133) Cache binaries downloaded for packaging locally#9906
Conversation
* Add an env variable to keep the download archive * Only download artifacts which aren't present * Document the KEEP_ARCHIVE env variable * Update README.md Co-authored-by: Panos Koutsovasilis <panos.koutsovasilis@elastic.co> * fixup! Only download artifacts which aren't present --------- Co-authored-by: Panos Koutsovasilis <panos.koutsovasilis@elastic.co> (cherry picked from commit 6aed8b1)
3 tasks
Contributor
|
Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane) |
swiatekm
approved these changes
Sep 12, 2025
|
Contributor
💚 Build Succeeded
cc @swiatekm |
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.





What does this PR do?
It makes it possible to avoid re-downloading binaries on each
mage packageinvocation. It does this by:KEEP_ARCHIVEenvironment variable, which, when set, prevents deletion of the binary archive in the drop path: 0e63536If-Modified-Sinceheader based on the modification time of the existing file. If this returns a Not Modified code, we skip the download: a7ec517The environment variable is introduced to avoid potentially breaking the CI and unified builds. We need to more carefully verify that it won't before enabling it by default.
Why is it important?
Redownloading binaries wastes time and makes agent difficult to work with on slow internet connections.
Checklist
[ ] I have made corresponding changes to the documentation[ ] I have made corresponding change to the default configuration files[ ] I have added tests that prove my fix is effective or that my feature works[ ] I have added an entry in./changelog/fragmentsusing the changelog tool[ ] I have added an integration test or an E2E testHow to test this PR locally
Run
EXTERNAL=true SNAPSHOT=true DEV=true KEEP_ARCHIVE=true mage packagetwice. The second time should be faster.Related issues
This is an automatic backport of pull request #9133 done by [Mergify](https://mergify.com).