Skip to content
This repository has been archived by the owner on Mar 31, 2022. It is now read-only.

WIP: adds support for pushing to GCR via mvn deploy. Has failing in… #13

Merged
merged 1 commit into from
Jun 2, 2017
Merged

Conversation

mavenraven
Copy link
Contributor

…tegration test.

Hey @dflemstr, I'm trying to figure out how to debug the failing integration test. I've tried variations of mvn -Dmaven.failsafe.debug failsafe:integration-test without any success. I also can't figure out how to run these tests via IntelliJ. It'd be awesome if you could help me figure out the failing test, or just fix it if you happen to know what the problem is. Thanks!

@mavenraven
Copy link
Contributor Author

mavenraven commented May 31, 2017

Here's the build output
output.txt

FWIW, @gimaker ran the tests against this WIP on Linux (I'm using OS X) and he is seeing successful builds. Maybe the test that's failing [testLowercase] has some implicit platform specific assumption?

@dflemstr
Copy link
Contributor

Does this rely on the Google Cloud SDK being installed?

Also, Travis runs inside of GCE so that might screw things up

authSupplier = ContainerRegistryAuthSupplier.forApplicationDefaultCredentials()
.build();
getLog().info("Using Google application credentials");
} catch (IOException ex) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs to catch DockerException as well, which maybe shouldn't be an unchecked exception to begin with? (I realize that would be a breaking change)

Copy link
Member

Choose a reason for hiding this comment

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

@mattnworb
Copy link
Member

It might make sense to add a system property that can be set when running tests to disable the automatic google credential loading, like -DdisableGoogleCredentials.

Seems like the automatic loading would be useful for most developers running the plugin (without them having to opt-in to the behavior), but it needs to be turned off in some cases

@dflemstr
Copy link
Contributor

@mattnworb I like the current strategy of attempting to load the credentials and falling back to proceeding without them, it's just that the current code has a bug when trying to catch the resulting exception.

@dflemstr
Copy link
Contributor

Maybe I'm misunderstanding the desired behavior for this case?

@mavenraven
Copy link
Contributor Author

@dflemstr did you have any thoughts re: debugging the failing integration test?

@mattnworb
Copy link
Member

spotify/docker-client#773 will fix the case where the loaded credentials aren't scoped to devstorage

@mattnworb
Copy link
Member

testLowercase fails for me on this branch and on the master branch for me on Mac OS X too, although perhaps it has to do with Docker for Mac rather than the test on OS X itself.

$ mvn -V
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T15:39:06-04:00)
Maven home: /usr/local/Cellar/maven/3.5.0/libexec
Java version: 1.8.0_101, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.12.4", arch: "x86_64", family: "mac"

$ docker version
Client:
 Version:      17.03.1-ce
 API version:  1.27
 Go version:   go1.7.5
 Git commit:   c6d412e
 Built:        Tue Mar 28 00:40:02 2017
 OS/Arch:      darwin/amd64

Server:
 Version:      17.03.1-ce
 API version:  1.27 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   c6d412e
 Built:        Fri Mar 24 00:00:50 2017
 OS/Arch:      linux/amd64
 Experimental: false

@mattnworb
Copy link
Member

This reminds me of other issues I have seen with helios-solo on Docker For Mac - when MainIT calls TemporaryJob.deploy(), the method does not return until helios-testing has successfully "probed" the external port of the container to make sure the container is up and running ok. Helios probes a tcp port mapping by checking to see if it can open a socket to the port.

I believe that on DFM, the external port is connect-able immediately after the container is created, even if the container is not yet listening on the internal port on the other side of the mapping.

The fix for this is to add a healthcheck to the TemporaryJob so that can helios can do a higher-level check (can it get a HTTP 2xx response from the port) rather than a tcp-level check.

see spotify/helios#916 (comment)

mattnworb added a commit that referenced this pull request Jun 1, 2017
need to add a healthcheck to the TemporaryJob to avoid helios-testing
from thinking that the job is immediately available after the deploy
finishes.

see:
#13 (comment)
spotify/helios#916 (comment)
@mattnworb
Copy link
Member

if you bump docker-client to 8.6.2 it should address the other issue mentioned above

dflemstr pushed a commit that referenced this pull request Jun 1, 2017
need to add a healthcheck to the TemporaryJob to avoid helios-testing
from thinking that the job is immediately available after the deploy
finishes.

see:
#13 (comment)
spotify/helios#916 (comment)
@mattnworb
Copy link
Member

realized I can commit to the branch directly so now the tests are green ✅ 😄

@mavenraven
Copy link
Contributor Author

@mattnworb fwiw I'm using Docker Machine, not Docker for Mac

@mattnworb
Copy link
Member

@mavenraven can you rebase / resolve the "branch is out of sync" warning? I confirmed with @dflemstr offline that this looks good now.

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