-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Try to import docker images before falling back to building #3891
Try to import docker images before falling back to building #3891
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
@googlebot I signed it! |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
@tstromberg Just fixed the failing test and added the debug log! |
6871453
to
8cc15a8
Compare
@arlyon I think it's best to make it opt-in or to make it possible to get the current behaviour back. I've always found it super important in a fully local mode to be able to never connect to a remote registry. For example, you are in a train, with no network, assuming all the layers where already downloaded, you are able to iterate quickly without reaching out to the network. |
9fc4706
to
77bf521
Compare
You're right. For now I implemented it as a config option under local builds. Notice that this either imports or doesn't (it doesn't distinguish between only importing from local docker daemon and a remote registry) build:
artifacts:
- image: arlyon/workout-server
context: ./server/
- image: arlyon/workout-learn
context: ./learn/
local:
tryImportMissing: true
push: true Input welcome! |
@@ -191,6 +191,10 @@ type LocalBuild struct { | |||
// connects to a remote cluster. | |||
Push *bool `yaml:"push,omitempty"` | |||
|
|||
// TryImportMissing should attempt to import this artifact from | |||
// Docker (either locally or a remote registry) if not in cache. | |||
TryImportMissing bool `yaml:"tryImportMissing,omitempty"` |
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.
Can you please make this a pointer like other?
And then you would need to set to it false in defaultToLocalBuild
in pkg/skaffold/schemadefaults/
@arlyon are you still working on this? |
@arlyon this PR is getting a bit stale but I'd love to help you get it in. let me know if you need any help with it! i'm still seeing a test failing on a data race in the cache somewhere, can you check that out? |
Hey, haven't been using skaffold at my day job recently but I have some time today so I'll rebase and see if I can get the requested changes in today. |
Codecov Report
@@ Coverage Diff @@
## master #3891 +/- ##
=======================================
Coverage 73.81% 73.82%
=======================================
Files 347 347
Lines 13758 13799 +41
=======================================
+ Hits 10156 10187 +31
- Misses 2970 2977 +7
- Partials 632 635 +3
Continue to review full report at Codecov.
|
I have updated with the requested changes and fixed the potential data race issues by introducing a RWMutex. |
You can rebase on master now. A new schema version has already been created. That should help with the tests |
f8a0707
to
8757b78
Compare
Hate to ping because I know you're all busy but would appreciate a merge @gsquared94 @tejal29 :) |
I can TAL tomorrow. Added to m'y TODO
Le ven. 24 juil. 2020 à 17:00, Alexander Lyon <[email protected]> a
écrit :
… Hate to ping because I know you're all busy but would appreciate a merge
@gsquared94 <https://github.com/gsquared94> @tejal29
<https://github.com/tejal29> :)
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#3891 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABFPF7Z4JYJ3KOXVKYIMCLR5GOYHANCNFSM4LXDX4IA>
.
|
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.
Here's a first round of review
@arlyon this PR is getting a bit stale. do you still have the bandwidth to try and push it through? |
8757b78
to
21de9ea
Compare
Hi @nkubala sorry for the delay I though I'd pushed the requested changes but clearly not. I have rebased on master now! |
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.
@arlyon This looks good to me! Thanks for making all of the requested changes :)
Fixes: #3886
Description
When perfoming a lookup of artifacts, this change will attempt to import artifacts from docker running locally as well as whatever remote registry is configured. This enables the worklow outlined in the issue above.
This PR is not done because there needs to be some discussion as it changes the behaviour of builds. Should the functionality be placed behind a flag? Since the contents of images aren't verified, this could for example cause problems if a malicious (or unaware) user uploads images tagged with an incorrect commit however for those who are aware of the (imo limited) drawbacks the productivity boost far-outweighs the risk. That said, I would argue to make it opt-in.
User facing changes
This would cause anyone running
skaffold build
to have the images be imported from docker, if possible, 'short circuiting' some builds. This is particularly useful when sharing images across teams (say someone needs to check out your branch to help diagnose an issue).Follow-up work
Once the questions above are answered, then the PR needs to be adapted slightly and the docs updated.