Skip to content
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

[CI] Cache ES snapshots on agents #132940

Merged
merged 8 commits into from
May 26, 2022

Conversation

brianseeders
Copy link
Contributor

@brianseeders brianseeders commented May 25, 2022

We have so many agents that run functional tests, downloading ES snapshots in all of them is a huge usage of bandwidth. We recently moved away from Cloud NAT for this reason. It was very expensive because of the bandwidth usage. It also costs a lot on the GCS bucket when we download them from other regions. This caches the snapshots in our agent images so that we don't need to download them most of the time.

  • Download ES snapshots for all current tracked versions during packer_cache
  • Copy the ES snapshot cache into the workspace before running functional tests
  • Use bazel remote cache during packer_cache bootstrap so that refreshing the cache image is faster
  • Trigger a new cache build after an ES snapshot is promoted

@brianseeders brianseeders marked this pull request as ready for review May 25, 2022 15:29
@brianseeders brianseeders requested a review from a team as a code owner May 25, 2022 15:29
@brianseeders brianseeders added release_note:skip Skip the PR/issue when compiling release notes Feature:CI Continuous integration v8.3.0 Team:Operations Team label for Operations Team labels May 25, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-operations (Team:Operations)

@brianseeders brianseeders added v8.2.2 auto-backport Deprecated - use backport:version if exact versions are needed labels May 25, 2022
@brianseeders
Copy link
Contributor Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #5 / analytics instrumented events from the server core-overall_status_changed should emit the initial "degraded" event with the context set to initializing

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@@ -35,7 +35,10 @@ async function upToDate(settingsPath: string) {

export async function setupRemoteCache(repoRootPath: string) {
// The remote cache is only for Elastic employees working locally (CI cache settings are handled elsewhere)
if (process.env.CI || !(await isElasticCommitter())) {
if (
process.env.FORCE_BOOTSTRAP_REMOTE_CACHE !== 'true' &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting side effect here gives third party devs an easy option to enable remote bazel caching without using a fake Elastic email, in case any of them are lurking about :)

Copy link
Contributor

@spalger spalger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bhavyarm
Copy link
Contributor

This didn't make 8.2.2 removing the label. Thanks @brianseeders

@brianseeders brianseeders merged commit 60226bc into elastic:main May 26, 2022
@brianseeders brianseeders deleted the es-snapshot-cache branch May 26, 2022 15:18
kibanamachine pushed a commit that referenced this pull request May 26, 2022
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.3

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request May 26, 2022
(cherry picked from commit 60226bc)

Co-authored-by: Brian Seeders <brian.seeders@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed Feature:CI Continuous integration release_note:skip Skip the PR/issue when compiling release notes Team:Operations Team label for Operations Team v8.3.0 v8.4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants