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

Fixes analyzer acceptance tests for Windows #541

Merged

Conversation

micahyoung
Copy link
Member

@micahyoung micahyoung commented Mar 5, 2021

This enables almost all the analyzer acceptance tests for Windows. This does not yet fix other acceptance tests for Windows, as this is intended to introduce the patterns those tests follow in later commits.

In general, uses tests helpers and variables for OS differences. Existing helpers workaround the following limitations on windows:

  • Windows can't seed volumes from stopped containers so it copies to seeds to container paths instead
  • Windows can't use "host" network so it access the registry on the default network, using any IP with a "/32" in the daemon's "insecure-registry" (from imgutil Registry helper)

@micahyoung micahyoung force-pushed the fix/analyzer-acceptance-windows branch 5 times, most recently from 63b4a99 to 922b711 Compare March 7, 2021 20:04
@micahyoung micahyoung changed the title Fix/analyzer acceptance windows Fixes analyzer acceptance tests for Windows Mar 7, 2021
@micahyoung micahyoung force-pushed the fix/analyzer-acceptance-windows branch from 922b711 to 1f04205 Compare March 7, 2021 20:50
@micahyoung micahyoung force-pushed the fix/analyzer-acceptance-windows branch 2 times, most recently from 225d965 to 3961d4b Compare March 10, 2021 13:22
"--build-arg", "metadata="+metadata,
)

noAuthRegCacheImage = noAuthRegistry.RepoName(cacheImageName)
Copy link
Member

Choose a reason for hiding this comment

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

I found myself scratching my head wondering "when do we push this image" but now I understand (I think) this works because we're using the shared storage volume. I feel like we might want to document this in a comment somewhere...

@natalieparellano
Copy link
Member

@micahyoung it's awesome to see this! I added a couple nits / comments on clarity but overall this is looking great!

Micah Young and others added 8 commits March 16, 2021 07:35
Signed-off-by: Micah Young <ymicah@vmware.com>
- Fixes cache images create with wrong format
- imgutil WithPlatform initializes OS-specific images
- Windows sim base layers are generated by imgutil instead of lifecycle

Signed-off-by: Micah Young <ymicah@vmware.com>
Co-authored-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Micah Young <ymicah@vmware.com>
- Use dual registries with shared data volume to test no-auth registries

Signed-off-by: Micah Young <ymicah@vmware.com>
- Generated layers are handled by imgutil

Signed-off-by: Micah Young <ymicah@vmware.com>
Signed-off-by: Micah Young <ymicah@vmware.com>
* Changes test helper signature to group related args
* Adds GHA step to add insecure-registries entry
  * Test helpers will use the field to determine registry host
* Changes to use imgutil for authorized/readonly registries

Signed-off-by: Micah Young <ymicah@vmware.com>
Signed-off-by: Micah Young <ymicah@vmware.com>
@micahyoung micahyoung force-pushed the fix/analyzer-acceptance-windows branch from 3c7077a to 6bd40a9 Compare March 16, 2021 12:25
Signed-off-by: Micah Young <ymicah@vmware.com>
@micahyoung micahyoung force-pushed the fix/analyzer-acceptance-windows branch from c90c25e to f8d9838 Compare March 16, 2021 14:18
@micahyoung micahyoung force-pushed the fix/analyzer-acceptance-windows branch 2 times, most recently from 117ad0e to f8d9838 Compare March 19, 2021 10:55
@micahyoung
Copy link
Member Author

micahyoung commented Mar 22, 2021

Looks like this Docker engine issue was biting us (usage here).

I'll have to check again but I'm hoping runner's docker CLI got bumped (or will shortly) and this should get back to green.

@micahyoung micahyoung force-pushed the fix/analyzer-acceptance-windows branch 2 times, most recently from 298484b to eca480b Compare March 22, 2021 13:52
Micah Young added 2 commits March 22, 2021 09:55
Signed-off-by: Micah Young <ymicah@vmware.com>
Signed-off-by: Micah Young <ymicah@vmware.com>
@micahyoung micahyoung force-pushed the fix/analyzer-acceptance-windows branch from eca480b to 1e588b8 Compare March 22, 2021 14:02
Signed-off-by: Micah Young <ymicah@vmware.com>
@micahyoung micahyoung force-pushed the fix/analyzer-acceptance-windows branch from 8f8c180 to e033d1c Compare March 22, 2021 17:06
testhelpers/docker.go Outdated Show resolved Hide resolved
Signed-off-by: Micah Young <ymicah@vmware.com>

Co-authored-by: Natalie Arellano <narellano@vmware.com>
func SeedDockerVolume(t *testing.T, srcPath string) string {
volumeName := "test-volume-" + RandString(10)
containerName := "test-volume-helper-" + RandString(10)
volumeHelperImage := "alpine"
Copy link
Member Author

Choose a reason for hiding this comment

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

Since this helper can only be used on Linux, I made the image name local. Eventually, when Windows implements this functionality, this function will also be ported.

Micah Young added 3 commits March 25, 2021 09:34
Signed-off-by: Micah Young <ymicah@vmware.com>
Signed-off-by: Micah Young <ymicah@vmware.com>
@micahyoung micahyoung force-pushed the fix/analyzer-acceptance-windows branch from 7c794c4 to b5c226c Compare March 25, 2021 14:49
Micah Young added 2 commits March 25, 2021 10:52
- Unknown integrity of docker-cli-builder binary: StefanScherer/docker-cli-builder#13

Signed-off-by: Micah Young <ymicah@vmware.com>
- Already present on runner

Signed-off-by: Micah Young <ymicah@vmware.com>
@micahyoung micahyoung force-pushed the fix/analyzer-acceptance-windows branch from b5c226c to 3f09d11 Compare March 25, 2021 14:52
@micahyoung micahyoung marked this pull request as ready for review March 25, 2021 15:14
@micahyoung micahyoung requested a review from a team as a code owner March 25, 2021 15:14
Micah Young added 2 commits March 25, 2021 11:16
Signed-off-by: Micah Young <ymicah@vmware.com>
This helper simplifies running tests against remote Windows daemon from a Unix workstation

- Updates docker cli to 20.10.5
- Adds richgo, docker build compression

Signed-off-by: Micah Young <ymicah@vmware.com>
Copy link
Member

@natalieparellano natalieparellano left a comment

Choose a reason for hiding this comment

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

This is awesome! Thank you @micahyoung :)

@natalieparellano natalieparellano merged commit 92b47a8 into buildpacks:main Apr 6, 2021
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.

2 participants