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

Ensuring compilation for windows, darwin, and linux #270

Merged
merged 1 commit into from
Feb 18, 2021

Conversation

ClaytonNorthey92
Copy link
Contributor

@ClaytonNorthey92 ClaytonNorthey92 commented Nov 30, 2020

Prior, our dependencies wouldn't allow us to compile for windows:

$ GOOS=windows go build
# github.com/docker/docker/pkg/system
../../../go/pkg/mod/github.com/docker/docker@v17.12.0-ce-rc1.0.20200916142827-bd33bbf0497b+incompatible/pkg/system/filesys_windows.go:111:24: cannot use uintptr(unsafe.Pointer(&sd[0])) (type uintptr) as type *"golang.org/x/sys/windows".SECURITY_DESCRIPTOR in assignment

This is solved in the v20.10.2 version.

I added CI steps to build on the following operating systems: Linux, Windows, and MacOS

I am explicitly only running tests on Linux, as a lot of the containers we use in tests are only valid Linux containers, and won't run on Windows Server.

This should be a good start to allow us to update our tests in the near future.

@ClaytonNorthey92
Copy link
Contributor Author

I noticed @mdelapenya has this pull request open, which allows tests for different operating systems...my pull request only compiles for different operating systems, doesn't run tests on different operating systems. Should we maybe combine them into one pull request?

@@ -48,3 +48,18 @@ jobs:

- name: gotestsum
run: gotestsum --format short-verbose ./...

- name: compile for windows
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would you see any advantage running each stage in parallel, opposed to running them in serie? Something like moving the GOOS definition to the GH action strategy block.

Besides that, I'd like to not run the tests if the build process fails, so I'd move the go build stage/s prior to the test one. wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, those are good ideas. I will:

  • add a 3rd dimension to the matrix, called os and this can contain the three operating system values "linux", "darwin", and "windows".
  • move the compile steps to before the test

@mdelapenya
Copy link
Collaborator

I noticed @mdelapenya has this pull request open, which allows tests for different operating systems...my pull request only compiles for different operating systems, doesn't run tests on different operating systems. Should we maybe combine them into one pull request?

Hey @ClaytonNorthey92, sorry for the late response... you know, holidays...

Related to the merge, that would be great, although I'd see more value merging this to at least have build compatibility across different OSs. I added a comment in the PR in that direction

Thanks again for your time here!

@ClaytonNorthey92
Copy link
Contributor Author

I noticed @mdelapenya has this pull request open, which allows tests for different operating systems...my pull request only compiles for different operating systems, doesn't run tests on different operating systems. Should we maybe combine them into one pull request?

Hey @ClaytonNorthey92, sorry for the late response... you know, holidays...

Related to the merge, that would be great, although I'd see more value merging this to at least have build compatibility across different OSs. I added a comment in the PR in that direction

Thanks again for your time here!

@mdelapenya

Thanks for your review 🙂 I hope your holidays were great!

I agree with what you mentioned in your comment, I will update the PR shortly 👍

@ClaytonNorthey92 ClaytonNorthey92 force-pushed the chore/windows-build branch 2 times, most recently from 4e91d4b to 199f649 Compare January 23, 2021 22:55
@ClaytonNorthey92
Copy link
Contributor Author

ClaytonNorthey92 commented Jan 23, 2021

hey @mdelapenya , I apologize for the delay, I had a lot to consider with this PR.

I added the 3 different platforms to the CI matrix, and I am building the project on each. However I am only running tests on Linux. If we want to run tests on all 3 platforms, there are many other things we have to change (as I am sure you have seen working on your PR). The largest thing is that many of our images we use in tests won't run on Windows Server, since they don't have windows in their manifest, they are only written for Linux. This includes the default reaper container, ryuk, so we would have to make that image run-able on Windows or come up with a different default reaper to use for Windows.

I think this is a good PR to start with. Since it introduces the 3 platforms in CI, and ensures we can't at least compile on all 3.

@ClaytonNorthey92 ClaytonNorthey92 force-pushed the chore/windows-build branch 2 times, most recently from c903891 to 63dc987 Compare January 23, 2021 23:17
@ClaytonNorthey92 ClaytonNorthey92 force-pushed the chore/windows-build branch 2 times, most recently from 57bdf78 to 65f022c Compare January 23, 2021 23:32
@ClaytonNorthey92
Copy link
Contributor Author

@mdelapenya @gianarb
It looks like travis is failing with this error message:

toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit

Do we need travis anymore? Should we remove travis.yml? Since we have github actions to run our tests in CI?

@gianarb
Copy link
Collaborator

gianarb commented Feb 18, 2021

Hey! Sorry @ClaytonNorthey92 I am very late here!

Do you mind two things, can you revert Postgres:latest back to a pinned version? I like to avoid latest if we can because you never know when the latest will break! And can you rebase?

I agree, I will remove travis in a bit!

@ClaytonNorthey92
Copy link
Contributor Author

Hey! Sorry @ClaytonNorthey92 I am very late here!

Do you mind two things, can you revert Postgres:latest back to a pinned version? I like to avoid latest if we can because you never know when the latest will break! And can you rebase?

I agree, I will remove travis in a bit!

Hey @gianarb ! Yes I can change postgres back and rebase 👍

Upgraded a dependency which allows windows compilation.

Added CI steps to ensure that we can compile for major operating
systems: windows, darwin, and linux

Updated test files so they only run on linux.
@ClaytonNorthey92
Copy link
Contributor Author

hey @gianarb I rebased and changed postgres:latest to postgres:12, I had to do a major version for postgres because the minor versions supported for 12.x seem to change frequently. For example, as of now 12.2 is no longer available, but 12.6 is.

@gianarb
Copy link
Collaborator

gianarb commented Feb 18, 2021

Thanks a lot!

@gianarb gianarb merged commit c8e070a into testcontainers:master Feb 18, 2021
@ClaytonNorthey92 ClaytonNorthey92 deleted the chore/windows-build branch February 18, 2021 16:38
@mdelapenya
Copy link
Collaborator

Yes!!! Package Delivery!

image

This was referenced Mar 15, 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.

None yet

3 participants