Skip to content
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

Merged
merged 9 commits into from Jul 25, 2019

Conversation

bakhtin
Copy link
Contributor

@bakhtin bakhtin commented Jul 10, 2019

Signed-off-by: Artyom Bakhtin a@bakhtin.net

Description of the Change

  • Replace older Dockerfile with VCPKG-supported one;
  • Refactor CI scripts to support building newer Docker images:
    • Rework Docker :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.
    • Docker image is now pulled prior building an image locally. If there are no changes (both in Dockerfile or in files added with ADD instruction) an image will be built using local cache. That is important since we want to consider changes in vcpkg directory
  • Disable old CI: removed .jenkinsci directory and Jenkinsfile

Benefits

Uniform dependency management across different supported platforms

Possible Drawbacks

None

@bakhtin bakhtin force-pushed the feature/vcpkg-dockerfile branch 2 times, most recently from 86b13e2 to 3235c47 Compare July 11, 2019 12:36
@bakhtin bakhtin changed the title [WIP] Support for VCPKG-based Dockerfile on CI Support for VCPKG-based Dockerfile on CI Jul 11, 2019
@bakhtin bakhtin marked this pull request as ready for review July 11, 2019 13:17
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")
Copy link
Contributor

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.

Copy link
Contributor Author

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} .")

Copy link
Contributor

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?

Copy link
Contributor Author

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

@bakhtin
Copy link
Contributor Author

bakhtin commented Jul 24, 2019

TODO for self: Rename Jenkinsfile-new to Jenkinsfile prior merging.

bakhtin and others added 6 commits July 24, 2019 12:27
  - 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>
Signed-off-by: Artyom Bakhtin <a@bakhtin.net>
Signed-off-by: Artyom Bakhtin <a@bakhtin.net>
@bakhtin bakhtin merged commit f9d6fcd into hyperledger:master Jul 25, 2019
@bakhtin bakhtin deleted the feature/vcpkg-dockerfile branch July 25, 2019 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants