-
Notifications
You must be signed in to change notification settings - Fork 42
Remote registry cache for docker build #174
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Andrew Feldman <[email protected]>
Signed-off-by: Andrew Feldman <[email protected]>
Signed-off-by: Andrew Feldman <[email protected]>
Signed-off-by: Andrew Feldman <[email protected]>
Signed-off-by: Andrew Feldman <[email protected]>
Signed-off-by: Andrew Feldman <[email protected]>
Signed-off-by: Andrew Feldman <[email protected]>
Signed-off-by: Andrew Feldman <[email protected]>
Signed-off-by: Andrew Feldman <[email protected]>
Signed-off-by: Andrew Feldman <[email protected]>
I have succeeded in getting However I have not yet demonstrated build-time savings. With a completely empty remote cache, the build time was 46min - about twice as long as the current build time, due to the time needed to push all of the layers to the remote cache. This is not necessarily bad or unexpected: https://buildkite.com/vllm/ci/builds/32642#019986ef-3aa4-4865-aa56-5844310e119c However, the subsequent build - in which a one-command modification to the vLLM source had been made - still took about 33min, so on the order of the typical build time. https://buildkite.com/vllm/ci/builds/32648#01998725-e681-4b77-961b-563059c0413a We would hope that since only the vLLM source was modified, we would get cache hits for all image layers not associated with the vLLM source. Instead, here is a breakdown of which layers were and were not able to exploit cache in the "subsequent" image build linked above, broken down by each build stage (along with the time needed to build layers which had cache misses): [base 1/11] - pull [build 1/8] - CACHED [vllm-base 1/21] - performed FROM [test 1/7] - performed ADD 0.7s Note that test 5/7 - test 7/7 move the precompiled vLLM package into the image's python install and then copy in the source. In principle these are the only layers which should have had cache misses. It is TODO to figure out why that is not the case. Together the steps above take about 12min. Additionally, the following docker image build steps took a significant amount of time:
|
This PR attempts to speed up docker build operations during PR regression test runs. The speedup comes by exploiting layer caching in a remote registry cache (there is already caching at image granularity.)
This PR should address vllm-project/vllm#25004 and contribute to addressing vllm-project/vllm#23588
In the process, I am hopeful that by increasing layer reuse between builds, this PR will indirectly increase the utilization of worker-local layer caches during unit test
docker pull
operations (since a given worker should see a lot of repeated layer pulls across consecutive unit tests), thereby lowering individual unit test startup times as described in vllm-project/vllm#24779Key changes:
docker buildx build
instead ofdocker build
(to enable registry caching)docker buildx
builder instance which usesdocker-container
backend (to enable registry caching)--cache-from
and--cache-to
for remote registry caching as shown below, withmode=max
to ensure that layers from intermediate build stages are cached: