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 configuration option for sync inference [3/3] #2088

Merged
merged 9 commits into from
Jul 23, 2019

Conversation

corneliusweig
Copy link
Contributor

@corneliusweig corneliusweig commented May 7, 2019

The sync feature is getting refurbished, see design proposal #1844 .

This PR implements step 3 of the implementation plan for the sync improvements. Notable changes include:

  • add a new config option sync.infer []string to enable sync for some files
  • add unit tests for creation of sync items
  • add integration test for inferred sync mode

based-on #2084
Supersedes #1812
Fixes #1166, #1581
Related #1180, #1807
CC design shepherd @tejal29

@corneliusweig corneliusweig changed the title WIP Add configuration option for sync inference WIP Add configuration option for sync inference [3/3] May 7, 2019
@corneliusweig corneliusweig changed the title WIP Add configuration option for sync inference [3/3] Add configuration option for sync inference [3/3] May 8, 2019
@corneliusweig corneliusweig marked this pull request as ready for review May 8, 2019 10:32
@codecov-io
Copy link

codecov-io commented May 8, 2019

Codecov Report

Merging #2088 into master will decrease coverage by <.01%.
The diff coverage is 80.95%.

Impacted Files Coverage Δ
pkg/skaffold/schema/latest/config.go 100% <ø> (ø) ⬆️
pkg/skaffold/docker/parse.go 88.33% <100%> (ø) ⬆️
pkg/skaffold/runner/dev.go 65.65% <50%> (-0.67%) ⬇️
pkg/skaffold/sync/sync.go 81.89% <82.05%> (-1.44%) ⬇️
pkg/skaffold/event/event.go 88.43% <0%> (-1.37%) ⬇️
pkg/skaffold/jib/jib.go 77.41% <0%> (-1.08%) ⬇️

@balopat balopat added kokoro:run runs the kokoro jobs on a PR docs-modifications runs the docs preview service on the given PR and removed needs-rebase labels May 10, 2019
@container-tools-bot
Copy link

Please visit http://35.236.44.79:1313 to view changes to the docs.

@container-tools-bot container-tools-bot removed the docs-modifications runs the docs preview service on the given PR label May 10, 2019
@kokoro-team kokoro-team removed the kokoro:run runs the kokoro jobs on a PR label May 10, 2019
@corneliusweig corneliusweig force-pushed the sync/step-3-1166 branch 2 times, most recently from 605d047 to bd173e0 Compare June 11, 2019 22:23
@corneliusweig corneliusweig force-pushed the sync/step-3-1166 branch 2 times, most recently from 80318d3 to 7f11844 Compare June 25, 2019 20:34
@corneliusweig
Copy link
Contributor Author

@tejal29 @balopat Just a polite reminder that sync inference is still not complete due to the missing skaffold.yaml adaptions from this PR.

@dgageot
Copy link
Contributor

dgageot commented Jul 2, 2019

@corneliusweig What's the status on this PR? Is it good to be reviewed or are you still working on it? I'm happy to review

@corneliusweig
Copy link
Contributor Author

@dgageot it is ready. Thanks for taking a look!

Copy link
Contributor

@dgageot dgageot left a comment

Choose a reason for hiding this comment

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

LGTM with just a few nits. It would be better if someone else could review too

@@ -15,6 +15,37 @@ The file copying is enabled by adding a `sync` section with _sync rules_ to the
Under the hood, Skaffold creates a tar file with changed files that match the sync rules.
This tar file is sent to and extracted on the corresponding containers.

### Inferred sync mode
For docker artifacts, Skaffold knows to infer the desired destination from the artifact's `Dockerfile`.
Copy link
Contributor

Choose a reason for hiding this comment

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

knows -> knows how?

@corneliusweig
Copy link
Contributor Author

@tejal29 As you were the design shepherd: could you also review? Or find somebody to do that? Would be highly appreciated, as this PR has been ready for quite some time now.

Copy link
Contributor

@nkubala nkubala left a comment

Choose a reason for hiding this comment

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

a few tiny nits but otherwise LGTM

pkg/skaffold/sync/sync.go Show resolved Hide resolved
pkg/skaffold/sync/sync.go Outdated Show resolved Hide resolved
pkg/skaffold/sync/sync.go Outdated Show resolved Hide resolved
@corneliusweig
Copy link
Contributor Author

corneliusweig commented Jul 22, 2019

@nkubala addressed your comments and rebased on master (there were conflicts)
And thanks for taking your time to review this huge PR!

@nkubala
Copy link
Contributor

nkubala commented Jul 22, 2019

@corneliusweig looks good except I think there's an issue with the config file getting passed to TestDevSyncAPITrigger, it's looking for skaffold.yaml but I think you changed it to skaffold-infer.yaml

@corneliusweig
Copy link
Contributor Author

@nkubala you are right. That config needed to be adapted. Now let's wait for travis.

@corneliusweig
Copy link
Contributor Author

@nkubala CI is still failing. I now recall to also have refactored this test, because it had a loophole. I need to do the necessary adjustments tomorrow.

@googlebot
Copy link

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

- add new configuration sync.Infer
- create sync Item for builds with inferred sync map
- add test cases for inferred sync map

Signed-off-by: Cornelius Weig <[email protected]>
Before, it was possible that the test would pass even though no sync had happened. Now the test can only pass, if the file is synced into the container.

Signed-off-by: Cornelius Weig <[email protected]>
Signed-off-by: Cornelius Weig <[email protected]>
@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@corneliusweig
Copy link
Contributor Author

@nkubala Ok, CI is finally green again. There were some hickups.

@nkubala nkubala merged commit 7db7ce7 into GoogleContainerTools:master Jul 23, 2019
@nkubala
Copy link
Contributor

nkubala commented Jul 23, 2019

@corneliusweig awesome, thank you for pushing this through!

@corneliusweig corneliusweig deleted the sync/step-3-1166 branch July 23, 2019 18:36
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.

Sync map can be inferred from artifact Dockerfile
8 participants