-
Notifications
You must be signed in to change notification settings - Fork 66
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
[WIP] Add minimal container for building docs #92
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Ryan Northey <[email protected]>
Signed-off-by: Ryan Northey <[email protected]>
Signed-off-by: Ryan Northey <[email protected]>
Signed-off-by: Ryan Northey <[email protected]>
Signed-off-by: Ryan Northey <[email protected]>
Related to #90, something we can do is build a image without C++ toolchains (i.e. only bazel and python), for RBE build front end, for RBE jobs all C++ build/linking is happening remote so it work in all RBE CI. That will be similar to what I did for GetEnvoy:
I'm not a fan of warming bazel / pip caches in docker build phase for several reasons:
|
the problem is that while removing the compiler makes the image smaller (as does using the official apt/debs from llvm), it doesnt make it any quicker to run build docs. waiting 15 minutes to render small changes in docs is not a viable workflow for anyone focused on editing docs (3.5 mins is still pretty slow) warming the caches afaict doesnt prevent newer versions being installed - certainly at least in the pip case - it just prevents you from downloading and recompiling deps that dont change very often, on every single build |
the other option is to not warm the cache and then mount the caches in the image before running. this has the advantage of keeping the image small, but it makes using it a load more complicated, and on first run - or lacking the proper mounts - very slow to use |
We do mount in CI and default |
@phlax how did you run build docs? In my local box the after the second time the docs build is pretty quick:
A clean build in our CI (this doesn't include time to pull image, but include setting up bazel / pip cache) is about 5mins: https://app.circleci.com/pipelines/github/envoyproxy/envoy/31052/workflows/2c8a0668-0cba-4659-9609-d6f9acfd10a5/jobs/370762 |
yep, as said, running the build inside that container works - its just a very large image
im afraid i cant access that. if its faster to compile i would guess that the build must be making use of the extra cores with circleci xlarge here are timings on travis for 3 runs of building docs using the existing image and then using the image built in this pr using
|
@phlax Right, so if you want to make a smaller image, don't warm bazel / pip cache because they are useless when /build is mounted. We don't really care travis perfomance because that's not where docs build are usually run. Instead, if the goal is building a smaller image, do what I described in #92 (comment), and it can be used not only docs CI but all RBE based CI, i.e. release/gcc/asan/tsan, so the image is also tested. This helps your travis performance as well, why not? |
I attempted to do a local build of docs - and it turned out to be a lot more complex than simply running
./docs/build.sh
from the root of the envoy repoI then tried with the
envoyproxy/envoy-build
image used inci
. This worked but the image is 3.6GB and the average run to build the docs took around 15 mins.To try and make this simpler and less resource-painful, i created this recipe which creates the environment required for building the docs only.
The image works by either mounting an envoy repo in the host to
/source
or by setting theENVOY_REPO
env var for the container, in which case it will fetch the repo at startupThe bare image for the env was around 670MB - but as it was fetching/building bazel and pip deps on each run it still took around 15 mins.
I therefore made the recipe run the docs build script once during image build. This makes the image slightly larger ~1.66GB but the runtime for building docs with the resultant image is reduced to around 3.5mins
I have left the travis script in the PR. If you are interested in taking this code in principle i will remove it and hook up azure pipelines.