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

Update docker build script to optionally publish images to DockerHub #283

Merged
merged 8 commits into from
Sep 3, 2017

Conversation

dcrankshaw
Copy link
Contributor

@dcrankshaw dcrankshaw commented Sep 2, 2017

This script cleans up the bin/build_docker_images.sh script and adds the ability to publish the images to DockerHub. The interface is the same, so it shouldn't break our existing Jenkins setup.

This script creates two tags for each image:

  1. The git SHA.
  2. The version (read from VERSION.txt)

With the publish option, both tags will be pushed to Dockerhub.

Closes #275.

TODOs after the PR is merged:

  • Deactivate the automated builds on DockerHub and run this script with the --publish option as a post-commit job in Jenkins.
  • Remove the separate ./bin/build_docke_imagesin Jenkins from the Clipper and Clipper-PRB jobs. This PR adds that call to the./bin/run_ci.sh` script, so we don't need to call it separately in Jenkins.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Clipper-PRB/690/
Test FAILed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Clipper-PRB/691/
Test FAILed.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Clipper-PRB/692/
Test PASSed.


# Build the Clipper Docker images.
build_images () {
# True and false indicate whether or not to public the image. We public public images.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Can we use an alternative to the verb usage of public? "make the image public" is easier to understand.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops. That's the result of a botched find/replace. Should read "True and false indicate whether or not to publish the image. We publish public images."

@@ -1,4 +1,4 @@
ARG CODE_VERSION=develop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing that we're removing these default arguments because the images build script, in conjunction with VERSION.txt are intended to be the point of control for image versioning?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly. And removing the default makes sure that the build fails if we forget a build arg instead of silently building with "develop"

@@ -1,3 +1,5 @@
# This ARG isn't used but prevents warnings in the build script
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also add this note to RPCDockerfile and ClipperLibBaseDockerfile ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

# This script builds all the public Docker images that the Clipper project distributes
# and pushes them to Docker hub.
# Each image is pushed with the tag <image_name>:version
# In addition, if the version is "develop", each image will also be
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is accurate. We're always tagging images with a git hash, regardless of version. What's the reasoning behind only tagging of the version is "develop"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I wrote the comment before I wrote the script. Will update the wording to be consistent.

Copy link
Contributor

@Corey-Zumar Corey-Zumar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Clipper-PRB/694/
Test FAILed.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Clipper-PRB/695/
Test PASSed.

@Corey-Zumar Corey-Zumar merged commit e596126 into ucbrise:develop Sep 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants