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

Add cloudbuild configuration for automatic docker image builds #25

Merged
merged 6 commits into from
Jun 23, 2020

Conversation

ajslone
Copy link
Collaborator

@ajslone ajslone commented Jun 22, 2020

Please have a look. This adds a cloudbuild.json file that configures cloud build for our docker base images. This also adds a script to generate this file, and a configuration file for setting up our cloud builds.
The config file in the PR has the url set to a test value for validation before we enable this for automatic builds.

@ajslone ajslone requested a review from sritchie June 22, 2020 22:41
@codecov
Copy link

codecov bot commented Jun 22, 2020

Codecov Report

Merging #25 into master will decrease coverage by 0.03%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #25      +/-   ##
==========================================
- Coverage   45.78%   45.74%   -0.04%     
==========================================
  Files          17       17              
  Lines        2728     2728              
==========================================
- Hits         1249     1248       -1     
- Misses       1479     1480       +1     
Impacted Files Coverage Δ
caliban/gke/utils.py 72.69% <0.00%> (-0.39%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f45b0c5...4b7b43c. Read the comment docs.

Copy link
Collaborator

@sritchie sritchie left a comment

Choose a reason for hiding this comment

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

Nice, few comments!

cloudbuild.json Outdated Show resolved Hide resolved
dockerfiles/Dockerfile Show resolved Hide resolved
dockerfiles/Dockerfile Outdated Show resolved Hide resolved
dockerfiles/Dockerfile Outdated Show resolved Hide resolved
scripts/cloudbuild.py Outdated Show resolved Hide resolved
def tag(self) -> str:
'''returns tag for this spec'''
parts = []
if self.gpu_version is None: # cpu image
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we pull this logic out into a separate function, and return some enum value? It is always easier for me to read these conditionals when they're simply defining a mode. Then we can switch-case on the mode inside here (and anywhere else that needs it).

scripts/cloudbuild.py Outdated Show resolved Hide resolved
scripts/cloudbuild.py Outdated Show resolved Hide resolved
scripts/cloudbuild.py Show resolved Hide resolved
"py38" : ["PYTHON_VERSION=3.8", "MINICONDA_VERSION=py38_4.8.2"]
},
"images" : [
{"cpu" : "py37"},
Copy link
Collaborator

Choose a reason for hiding this comment

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

why is the python version a value, keyed by cpu here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Is the concern here that the 'cpu' key is misleading? Easy enough to rename this to 'python' if that helps.

Copy link
Collaborator Author

@ajslone ajslone left a comment

Choose a reason for hiding this comment

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

Updates for last review.

@sritchie sritchie changed the title Aslone/cloudbuild Add cloudbuild configuration for automatic docker image builds Jun 23, 2020
Copy link
Collaborator

@sritchie sritchie left a comment

Choose a reason for hiding this comment

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

One fix, then this is good!

# minicoda release archive is here: https://repo.anaconda.com/miniconda
# see the docs here for managing python versions with conda:
# https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-python.html
ARG MINICONDA_VERSION=py38_4.8.2
Copy link
Collaborator

Choose a reason for hiding this comment

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

needs to be py37

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch, will fix this.

@ajslone ajslone merged commit 7f34b4a into master Jun 23, 2020
@ajslone ajslone deleted the aslone/cloudbuild branch June 23, 2020 19:19
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.

2 participants