browser-tools-orb
browser-tools-orb copied to clipboard
Lack of clarity regarding installation caching
Orb version
1.3.0
What happened
It's not clear to me if browser/tool installations provided by this orb are cached, or whether it is possible to cache them.
All examples of using this orb in a config.yml never wrap it in restore
/save_cache
stanzas:
steps:
- browser-tools/install-chrome
- checkout
...
Usually placed at the top of a set of steps, rather than interleaved with cache stanzas.
Is it possible to cache installs of browsers (specifically Chrome for my requirements)? Would it be as simple as (e.g. for apt-based Linuxes) to have something like:
steps:
- restore_cache:
name: Restore cache
keys:
- v1-my-cache-{{ checksum "yarn.lock" }}
- browser-tools/install-chrome
- save_cache
name: Save cache
key: v1-my-cache-{{ checksum "yarn.lock" }}
paths:
- /usr/bin/google-chrome
...
Thanks!
+1 It would be great to have a way to use cached Chrome instead of waiting 15-19 seconds to install it every time we run Ci build.
Probably we would have to cache based on the Chrome version somehow instead of using {{ checksum "yarn.lock" }}
.
At a quick glance, seems like moving part of the installation_check()
before the install could remedy some of this.
Awesome idea! Meanwhile you can just put this into a docker image like so:
FROM scratch
# build args
ARG ORB_VERSION=v1.4.0
ARG ORB_PARAM_CHANNEL=stable
ARG ORB_PARAM_CHROME_VERSION=latest
ARG ORB_PARAM_DRIVER_INSTALL_DIR=~/chromedriver
# install chrome and chromedriver
RUN bash <(curl -sL https://raw.githubusercontent.com/CircleCI-Public/browser-tools-orb/$ORB_VERSION/src/scripts/install-chrome.sh)
RUN bash <(curl -sL https://raw.githubusercontent.com/CircleCI-Public/browser-tools-orb/$ORB_VERSION/src/scripts/install-chromedriver.sh)
reviewing
We are currently facing install times of 6-10 minutes in every run (for install-chrome), as there is no cache (and it seems the current download rate from http://archive.ubuntu.com/ubuntu is capped at <100kB/s). A cache would really help avoid flaky download rates.