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
Support for VCPKG-based Dockerfile on CI #159
Conversation
86b13e2
to
3235c47
Compare
sh("docker pull ${env.DOCKER_REGISTRY_BASENAME}:${imageName} || true") | ||
randDir = sh(script: "cat /dev/urandom | tr -dc 'a-zA-Z0-9' | head -c 10", returnStdout: true).trim() | ||
currentDockerfile = utils.getUrl(currentDockerfileURL, "/tmp/${randDir}/currentDockerfile", true) | ||
referenceDockerfile = utils.getUrl(referenceDockerfileURL, "/tmp/${randDir}/referenceDockerfile") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we push new Dockerfile to master, will it build docker image?
because currentDockerfile
and referenceDockerfile
will be same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, because we always build Docker image regardless of the changes in Dockerfiles:
iC = docker.build("${env.DOCKER_REGISTRY_BASENAME}:${randDir}-${BUILD_NUMBER}", "${buildOptions} -f ${currentDockerfile} .") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will significantly increase build time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will not since we pull an image first. And in most cases we get 100% cache hit
TODO for self: Rename |
- Replace older Dockerfile with VCPKG-supported one; - Refactor CI scripts to support building newer Docker images Signed-off-by: Artyom Bakhtin <a@bakhtin.net>
Signed-off-by: Artyom Bakhtin <a@bakhtin.net>
Signed-off-by: Artyom Bakhtin <a@bakhtin.net>
Signed-off-by: Artyom Bakhtin <a@bakhtin.net>
Signed-off-by: Andrei Lebedev <lebdron@gmail.com>
Signed-off-by: Andrei Lebedev <lebdron@gmail.com>
97418e8
to
b469af4
Compare
Signed-off-by: Artyom Bakhtin <a@bakhtin.net>
Signed-off-by: Artyom Bakhtin <a@bakhtin.net>
Signed-off-by: Artyom Bakhtin a@bakhtin.net
Description of the Change
:develop-build
image building strategy. It previously covers the scenario of running several parallel builds on the same agent. This is not true anymore since a build agent spins up exclusively for each build. Thus, the step that checks for differences between current and previous Docker files is no longer required. Previously, it saved some time if multiple builds with analogous changes had been being built on the same agent due to caching.We now only check for changes compared to 'reference' Docker file -- the file in the
master
branch of the repo. That is to disable build cache for such scenarios to avoid installing system packages from stale APT repositories.ADD
instruction) an image will be built using local cache. That is important since we want to consider changes invcpkg
directory.jenkinsci
directory andJenkinsfile
Benefits
Uniform dependency management across different supported platforms
Possible Drawbacks
None