Skip to content
This repository was archived by the owner on Mar 27, 2024. It is now read-only.

remove ImagePrepper in favor of processing individual preppers directly #101

Merged
merged 7 commits into from
Sep 22, 2017

Conversation

nkubala
Copy link
Contributor

@nkubala nkubala commented Sep 21, 2017

This code adds support for calling code to use specific preppers directly, rather than relying on the container-diff library to infer the prepper source. This allows callers to explicitly retrieve images from their local docker daemon vs. a remote registry. Container-diff implements this by specifying prefixes on the image strings: prefixing an image with daemon:// specifies the local daemon, and prefixing with remote:// specifies remote registry. If no prefix is specified, the local daemon is tried first.

cc @dlorenc

Copy link
Contributor

@dlorenc dlorenc left a comment

Choose a reason for hiding this comment

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

Nice, this looks much better.

@@ -80,14 +80,16 @@ func diffImages(image1Arg, image2Arg string, diffArgs []string) error {
for imageArg := range imageMap {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add a TODO or open a bug to fix up this code, the error handling isn't really correct. You're not making it worse here, bu I want to make sure we don't forget.

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.

Copy link
Contributor

@dlorenc dlorenc left a comment

Choose a reason for hiding this comment

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

I think something might have just gotten a bit slower and a timeout is happening. Specifically I'm seeing the node differ test take a while.

I figured that out by switching the tests to run in serial and seeing how long each one takes.

We might need to add a local cache or increase the timeouts.

@nkubala
Copy link
Contributor Author

nkubala commented Sep 22, 2017

Ah that might be it. We should definitely add caching for the processed images, I think that's out of the scope of this PR though.

Looks like Travis actually doesn't have real build timeouts, they just timeout if there are no log entries printed in 10 minutes: https://docs.travis-ci.com/user/customizing-the-build#Build-Timeouts. This is probably what we're running into? go test doesn't print the output for the tests until they're all done running, so this makes sense.

@dlorenc
Copy link
Contributor

dlorenc commented Sep 22, 2017

Looks like Travis actually doesn't have real build timeouts, they just timeout if there are no log entries printed in 10 minutes: https://docs.travis-ci.com/user/customizing-the-build#Build-Timeouts. This is probably what we're running into? go test doesn't print the output for the tests until they're all done running, so this makes sense.

Go test has it's own ten minute timeout :( You can try passing a longer one in the go test command.

@nkubala
Copy link
Contributor Author

nkubala commented Sep 22, 2017

Looks like the build is actually only running for 1.5 minutes before failing: https://travis-ci.org/GoogleCloudPlatform/container-diff/builds/278677161. So I don't think it's a timeout

@r2d4
Copy link
Contributor

r2d4 commented Sep 22, 2017

I was able to reproduce the error by pulling down this branch

@@ -185,3 +201,20 @@ func TestDiffAndAnalysis(t *testing.T) {
})
}
}

func TestMain(m *testing.M) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is the culprit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good call, also turns out Docker actually wasn't available in our Travis runs. fixed

func TestMain(m *testing.M) {
// setup
ctx := context.Background()
cli, _ := client.NewEnvClient()
Copy link
Contributor

Choose a reason for hiding this comment

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

@nkubala nkubala merged commit b089b9b into GoogleContainerTools:master Sep 22, 2017
@nkubala nkubala deleted the refactor branch September 22, 2017 21:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants