BIGTOP-3801: Add maven cache volume for docker provisioner #999
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of PR
This PR adds an option that adds a docker volume and mounts
.m2during the build.Adding this option, users could reduce the build time by skipping some download processes.
Detail
or
With this option, bigtop create docker volume that named
bigtop-mvn-cache-$OSif not exists and mount it on/var/lib/jenkins/.m2in the provisioner container. If the volume has already existed, bigtop reuse it.If users set the option
false, bigtop try to remove the volume and build without the cache.If users does not set any option for this, bigtop do nothing for mounting the volume (Same behavior with before).
How was this patch tested?
I checked on Ubuntu 22.04/x86 host machine.
1st build with the cache option.
Check the volume.
$ docker volume ls DRIVER VOLUME NAME local bigtop-mvn-cache-ubuntu-20.04 $ docker run -it --rm -v bigtop-mvn-cache-ubuntu-20.04:/root/.m2 ubuntu:20.04 ls -l /root/.m2/ total 4 drwxr-xr-x 46 1000 1000 4096 Sep 2 06:40 repository2nd build with the cache option
Set the option false
Check the deletion
Set no option
For code changes: