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

Skip docker push if image exists remotely #36

Merged
merged 14 commits into from
Jul 13, 2020
Merged

Conversation

sritchie
Copy link
Collaborator

This PR:

  • adds a good # of tests to caliban.util.auth and caliban.docker.push. 100% coverage on the latter, woohoo!
  • Adds the ability to check if an image exists on GCR... and if it does, to SKIP the docker push. This saves some nice time during submission.

I'll point this PR back at master once we merge #32; but this is based on the project refactor, so it looks cleanest when I point there for now.

@sritchie sritchie requested a review from ajslone July 13, 2020 15:16
@codecov
Copy link

codecov bot commented Jul 13, 2020

Codecov Report

Merging #36 into master will increase coverage by 0.51%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #36      +/-   ##
==========================================
+ Coverage   47.60%   48.12%   +0.51%     
==========================================
  Files          27       27              
  Lines        2836     2849      +13     
==========================================
+ Hits         1350     1371      +21     
+ Misses       1486     1478       -8     
Impacted Files Coverage Δ
caliban/platform/cloud/core.py 23.23% <ø> (-1.15%) ⬇️
caliban/docker/push.py 100.00% <100.00%> (+40.00%) ⬆️
caliban/util/auth.py 66.66% <100.00%> (+26.66%) ⬆️
caliban/util/fs.py 70.78% <0.00%> (-1.13%) ⬇️

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 6edb9b5...d49dddb. Read the comment docs.

Base automatically changed from sritchie/restructure to master July 13, 2020 17:37
Copy link
Collaborator

@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.

LGTM, just a couple of questions. This is a nice upgrade which users will notice immediately.


def _image_tag_for_project(project_id: str, image_id: str) -> str:

Copy link
Collaborator

Choose a reason for hiding this comment

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

would having a tag parameter here that defaults to latest be more flexible than just include_tag? We don't really tag things differently now, but perhaps in the future.


"""
image_tag = _image_tag_for_project(project_id, image_id, include_tag=False)
cmd = [
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we pass the --project flag here to the gcloud command, as we have the project_id handy?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

NIce!

@sritchie sritchie merged commit 762c052 into master Jul 13, 2020
@sritchie sritchie deleted the sritchie/skip_push branch July 13, 2020 20:12
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

2 participants