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 chromedriver #196614

Merged
merged 4 commits into from
Oct 22, 2024
Merged

[ci] Cache chromedriver #196614

merged 4 commits into from
Oct 22, 2024

Conversation

jbudz
Copy link
Member

@jbudz jbudz commented Oct 16, 2024

Chromedriver is currently downloaded at runtime on each agent. We know the expected version of Chrome at image build time, and can re-use the matching driver already installed instead.

This sets XDG_CACHE_HOME to $HOME/.cache to persist the chromedriver installation. Details on the specification can be found at https://specifications.freedesktop.org/basedir-spec/latest/. Other packages, including cypress, playwright, bazelisk and yarn also respect this environment variable, but are already falling back to the $HOME/.cache directory.

This also removes CHROMEDRIVER_FORCE_DOWNLOAD, which I believe is an artifact of legacy code: https://github.com/elastic/kibana/blob/6.7/.ci/packer_cache.sh#L17-L26. At one point node_modules was initially loaded from an archive to speed up bootstrap times. The intent was to redownload chromedriver because the Chrome version on the agent image was upgraded independently of the bootstrap cache, potentially causing version mismatches. The impact of re-downloading was also less significant, as there was less parallelization in favor of large machines running parallel jobs.

Chromedriver is currently downloaded at runtime on each agent.  We know
the expected version of Chrome at image build time, and can install the
matching driver at the same time instead.

This sets XDG_CACHE_HOME to $HOME/.cache.  Details on the specification
can be found at
https://specifications.freedesktop.org/basedir-spec/latest/.

Other binaries, including cypress, playwright, bazelisk and yarn respect
this environment variable, but are already falling back to the .cache
directory.
@jbudz jbudz added Team:Operations Team label for Operations Team release_note:skip Skip the PR/issue when compiling release notes backport:all-open Backport to all branches that could still receive a release labels Oct 16, 2024
@jbudz
Copy link
Member Author

jbudz commented Oct 17, 2024

buildkite test this

@jbudz
Copy link
Member Author

jbudz commented Oct 17, 2024

buildkite test this

@jbudz jbudz marked this pull request as ready for review October 17, 2024 15:59
@jbudz jbudz requested a review from a team as a code owner October 17, 2024 15:59
@elasticmachine
Copy link
Contributor

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

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

✅ unchanged

History

@jbudz jbudz merged commit b89941f into elastic:main Oct 22, 2024
23 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 7.17, 8.15, 8.16, 8.x

https://github.com/elastic/kibana/actions/runs/11460648392

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 22, 2024
Chromedriver is currently downloaded at runtime on each agent. We know
the expected version of Chrome at image build time, and can re-use the
matching driver already installed instead.

This sets `XDG_CACHE_HOME` to `$HOME/.cache` to persist the chromedriver
installation. Details on the specification can be found at
https://specifications.freedesktop.org/basedir-spec/latest/. Other
packages, including cypress, playwright, bazelisk and yarn also respect
this environment variable, but are already falling back to the
`$HOME/.cache` directory.

This also removes `CHROMEDRIVER_FORCE_DOWNLOAD`, which I believe is an
artifact of legacy code:
https://github.com/elastic/kibana/blob/6.7/.ci/packer_cache.sh#L17-L26.
At one point node_modules was initially loaded from an archive to speed
up bootstrap times. The intent was to redownload chromedriver because
the Chrome version on the agent image was upgraded independently of the
bootstrap cache, potentially causing version mismatches. The impact of
re-downloading was also less significant, as there was less
parallelization in favor of large machines running parallel jobs.

(cherry picked from commit b89941f)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 22, 2024
Chromedriver is currently downloaded at runtime on each agent. We know
the expected version of Chrome at image build time, and can re-use the
matching driver already installed instead.

This sets `XDG_CACHE_HOME` to `$HOME/.cache` to persist the chromedriver
installation. Details on the specification can be found at
https://specifications.freedesktop.org/basedir-spec/latest/. Other
packages, including cypress, playwright, bazelisk and yarn also respect
this environment variable, but are already falling back to the
`$HOME/.cache` directory.

This also removes `CHROMEDRIVER_FORCE_DOWNLOAD`, which I believe is an
artifact of legacy code:
https://github.com/elastic/kibana/blob/6.7/.ci/packer_cache.sh#L17-L26.
At one point node_modules was initially loaded from an archive to speed
up bootstrap times. The intent was to redownload chromedriver because
the Chrome version on the agent image was upgraded independently of the
bootstrap cache, potentially causing version mismatches. The impact of
re-downloading was also less significant, as there was less
parallelization in favor of large machines running parallel jobs.

(cherry picked from commit b89941f)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 22, 2024
Chromedriver is currently downloaded at runtime on each agent. We know
the expected version of Chrome at image build time, and can re-use the
matching driver already installed instead.

This sets `XDG_CACHE_HOME` to `$HOME/.cache` to persist the chromedriver
installation. Details on the specification can be found at
https://specifications.freedesktop.org/basedir-spec/latest/. Other
packages, including cypress, playwright, bazelisk and yarn also respect
this environment variable, but are already falling back to the
`$HOME/.cache` directory.

This also removes `CHROMEDRIVER_FORCE_DOWNLOAD`, which I believe is an
artifact of legacy code:
https://github.com/elastic/kibana/blob/6.7/.ci/packer_cache.sh#L17-L26.
At one point node_modules was initially loaded from an archive to speed
up bootstrap times. The intent was to redownload chromedriver because
the Chrome version on the agent image was upgraded independently of the
bootstrap cache, potentially causing version mismatches. The impact of
re-downloading was also less significant, as there was less
parallelization in favor of large machines running parallel jobs.

(cherry picked from commit b89941f)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 22, 2024
Chromedriver is currently downloaded at runtime on each agent. We know
the expected version of Chrome at image build time, and can re-use the
matching driver already installed instead.

This sets `XDG_CACHE_HOME` to `$HOME/.cache` to persist the chromedriver
installation. Details on the specification can be found at
https://specifications.freedesktop.org/basedir-spec/latest/. Other
packages, including cypress, playwright, bazelisk and yarn also respect
this environment variable, but are already falling back to the
`$HOME/.cache` directory.

This also removes `CHROMEDRIVER_FORCE_DOWNLOAD`, which I believe is an
artifact of legacy code:
https://github.com/elastic/kibana/blob/6.7/.ci/packer_cache.sh#L17-L26.
At one point node_modules was initially loaded from an archive to speed
up bootstrap times. The intent was to redownload chromedriver because
the Chrome version on the agent image was upgraded independently of the
bootstrap cache, potentially causing version mismatches. The impact of
re-downloading was also less significant, as there was less
parallelization in favor of large machines running parallel jobs.

(cherry picked from commit b89941f)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
7.17
8.15
8.16
8.x

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

Questions ?

Please refer to the Backport tool documentation

jbudz added a commit that referenced this pull request Oct 22, 2024
@jbudz jbudz added the reverted label Oct 22, 2024
@jbudz
Copy link
Member Author

jbudz commented Oct 22, 2024

This ends up breaking bazel. It's already cached in the same folder but this addition also ends up moving the BUILD.bazel files to .cache which is pointing to the wrong folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:all-open Backport to all branches that could still receive a release release_note:skip Skip the PR/issue when compiling release notes reverted Team:Operations Team label for Operations Team v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants