-
-
Notifications
You must be signed in to change notification settings - Fork 579
ci(docker): Add tests for macOS #636
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
Closed
Closed
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
b8f9d1a
fix: Add tests for arm64 and for macOS
MaxymVlasov 51116cb
fix issues with docker on macos arm
MaxymVlasov df7d586
Build multiarch only in ubuntu amd64
MaxymVlasov 5583e99
f
MaxymVlasov 6d9d53c
Merge branch 'master' into fix_no_test_for_arm
MaxymVlasov eb71525
Merge branch 'master' into fix_no_test_for_arm
MaxymVlasov 9cac108
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 9ec3aac
Update .github/workflows/build-image-test.yaml
MaxymVlasov 677118c
Update .github/workflows/build-image-test.yaml
MaxymVlasov 61bce20
Update .github/workflows/build-image-test.yaml
MaxymVlasov 5badac2
Update .github/workflows/build-image-test.yaml
MaxymVlasov 98fb397
Update build-image-test.yaml
MaxymVlasov ecbad24
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] aede651
Update .github/workflows/build-image-test.yaml
MaxymVlasov 6e9722c
Update .github/workflows/build-image-test.yaml
MaxymVlasov 53088bd
Update build-image-test.yaml
MaxymVlasov 1b9668b
Update build-image-test.yaml
MaxymVlasov 2d34d2f
Update build-image-test.yaml
MaxymVlasov dfcdca3
Update build-image-test.yaml
MaxymVlasov 8332068
Update build-image-test.yaml
MaxymVlasov f1f1f70
Update build-image-test.yaml
MaxymVlasov 31d95c0
Update build-image-test.yaml
MaxymVlasov 7d216ef
fix container-structure-test
MaxymVlasov d2f9601
Update build-image-test.yaml
MaxymVlasov e50e810
Update build-image-test.yaml
MaxymVlasov 0c36c1f
Update build-image-test.yaml
MaxymVlasov f7b31a7
Update build-image-test.yaml
MaxymVlasov 525825c
Update build-image-test.yaml
MaxymVlasov b760886
Update build-image-test.yaml
MaxymVlasov a2bc4dd
Update build-image-test.yaml
MaxymVlasov 4df69be
Update build-image-test.yaml
MaxymVlasov bbf1021
Update build-image-test.yaml
MaxymVlasov dc6a939
Update build-image-test.yaml
MaxymVlasov 948df60
Update build-image-test.yaml
MaxymVlasov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,17 +17,27 @@ jobs: | |
| pull-requests: write | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| arch: | ||
| - amd64 | ||
| - arm64 | ||
| include: | ||
| - os-name: Ubuntu x64 | ||
| os: ubuntu-latest | ||
| os-type: linux | ||
| arch: amd64 | ||
|
|
||
| - os-name: Ubuntu ARM | ||
| os: ubuntu-24.04-arm | ||
| os-type: linux | ||
| arch: arm64 | ||
|
|
||
| - os-name: MacOS x64 | ||
| os: macos-13 | ||
| os-type: darwin | ||
| arch: amd64 | ||
|
|
||
| - os-name: MacOS ARM | ||
| os: macos-13 | ||
| os-type: darwin | ||
| arch: arm64 | ||
|
|
||
| name: ${{ matrix.os-name }} | ||
|
|
@@ -52,9 +62,24 @@ jobs: | |
| if: steps.changed-files-specific.outputs.any_changed == 'true' | ||
| # Lowercase the org/repo name to allow for workflow to run in forks, | ||
| # which owners have uppercase letters in username | ||
| run: >- | ||
| echo "IMAGE=ghcr.io/${GITHUB_REPOSITORY@L}:${{ env.IMAGE_TAG }}" | ||
| >> $GITHUB_ENV | ||
| run: |- | ||
| repo=$(echo $GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]') | ||
| echo "IMAGE=ghcr.io/${repo}:${{ env.IMAGE_TAG }}" >> $GITHUB_ENV | ||
|
|
||
| - name: Setup Docker on macOS | ||
| if: matrix.os-type == 'darwin' | ||
| uses: douglascamata/[email protected] | ||
|
|
||
| - name: Set DOCKER_HOST to point to Colima's socket | ||
| if: matrix.os-type == 'darwin' | ||
| run: | | ||
| docker context ls | ||
| # Colima usually creates the socket at ~/.colima/default/docker.sock | ||
| DOCKER_SOCKET_PATH=$(docker context ls | awk '{print $4}' | grep colima) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| echo "DOCKER_HOST=$DOCKER_SOCKET_PATH" >> $GITHUB_ENV | ||
| docker info | ||
| docker context ls | ||
| echo "DOCKER_HOST=$DOCKER_SOCKET_PATH" | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0 | ||
|
|
@@ -75,6 +100,11 @@ jobs: | |
| secrets: | | ||
| "github_token=${{ secrets.GITHUB_TOKEN }}" | ||
|
|
||
| - name: Doxker inpect (debug) | ||
| run: | | ||
| docker images | ||
| docker images -q | xargs docker inspect | ||
|
|
||
| - name: Setup Container Structure Tests | ||
| if: steps.changed-files-specific.outputs.any_changed == 'true' | ||
| env: | ||
|
|
@@ -84,8 +114,8 @@ jobs: | |
| CST_REPO: github.com/GoogleContainerTools/container-structure-test | ||
| run: >- | ||
| curl -L "https://${{ env.CST_REPO }}/releases/download/v${{ | ||
| env.CST_VERSION }}/container-structure-test-linux-${{ matrix.arch }}" | ||
| > container-structure-test | ||
| env.CST_VERSION }}/container-structure-test-${{ | ||
| matrix.os-type }}-${{ matrix.arch }}" > container-structure-test | ||
| && chmod +x container-structure-test | ||
| && mkdir -p $HOME/bin/ | ||
| && mv container-structure-test $HOME/bin/ | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so, as Mac docker is still a linux VM which is not described anyhow in docker inspect metadata => I assume it have no difference with standard linux build, is it make any sense to test Mac-specific docker builds at all?
docker inspectof built image on Mac x64:docker infoon Mac x64:For context - all that started as issue from #636. Linux arm tests whete added long time ago.
Mac x64 build works in this PR, Mac arm - still not, and according to build action used here for mac - it near impossible to make it run natively
@yermulnik
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might there be a difference around tool paths, libs, whatever the tests rely upon? Like those common diffs in POSIX (macOS) vs GNU (Linux)?
If not, then, given the info you provided, I agree that we can take macOS build as equal to Linux build.
Maybe call out for someone with macOS to validate tests provide the same outcome in Docker and on native Mac hardware? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Different tools inside linux VMs? Could be, but then it depends what users use - Docker Desktop, Rancher etc. and specific it version.
I'll close it for now, till we will face a mac-specific issues that are not detected by current tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably that I didn't get the basic point of the message: did you mean that
os: macos-13 os-type: darwinin reality is a linux ubuntu-based container? What make it macOS build then? Or did you mean that underlying host is Linux anyways and hence built artifacts (like pre-compiled binaries) should be the same anyways (kinda use the same set of instructions)? 🤔 I'm definitely of context of this PR and thus most probably am mixing up things 🤷🏻Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
os: macos-13 os-type: darwinis Mac, but colima spin-ups Linux VM to run dockerThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So your concern is underlying host system and not container internals, right?