Skip to content
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 Feb 23, 2024
51116cb
fix issues with docker on macos arm
MaxymVlasov Feb 23, 2024
df7d586
Build multiarch only in ubuntu amd64
MaxymVlasov Feb 23, 2024
5583e99
f
MaxymVlasov Feb 23, 2024
6d9d53c
Merge branch 'master' into fix_no_test_for_arm
MaxymVlasov Mar 5, 2024
eb71525
Merge branch 'master' into fix_no_test_for_arm
MaxymVlasov May 27, 2025
9cac108
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 27, 2025
9ec3aac
Update .github/workflows/build-image-test.yaml
MaxymVlasov May 27, 2025
677118c
Update .github/workflows/build-image-test.yaml
MaxymVlasov May 27, 2025
61bce20
Update .github/workflows/build-image-test.yaml
MaxymVlasov May 27, 2025
5badac2
Update .github/workflows/build-image-test.yaml
MaxymVlasov May 27, 2025
98fb397
Update build-image-test.yaml
MaxymVlasov May 27, 2025
ecbad24
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 27, 2025
aede651
Update .github/workflows/build-image-test.yaml
MaxymVlasov May 27, 2025
6e9722c
Update .github/workflows/build-image-test.yaml
MaxymVlasov May 27, 2025
53088bd
Update build-image-test.yaml
MaxymVlasov May 27, 2025
1b9668b
Update build-image-test.yaml
MaxymVlasov May 27, 2025
2d34d2f
Update build-image-test.yaml
MaxymVlasov May 27, 2025
dfcdca3
Update build-image-test.yaml
MaxymVlasov May 27, 2025
8332068
Update build-image-test.yaml
MaxymVlasov May 27, 2025
f1f1f70
Update build-image-test.yaml
MaxymVlasov May 28, 2025
31d95c0
Update build-image-test.yaml
MaxymVlasov May 28, 2025
7d216ef
fix container-structure-test
MaxymVlasov May 28, 2025
d2f9601
Update build-image-test.yaml
MaxymVlasov May 28, 2025
e50e810
Update build-image-test.yaml
MaxymVlasov May 28, 2025
0c36c1f
Update build-image-test.yaml
MaxymVlasov May 28, 2025
f7b31a7
Update build-image-test.yaml
MaxymVlasov May 29, 2025
525825c
Update build-image-test.yaml
MaxymVlasov May 30, 2025
b760886
Update build-image-test.yaml
MaxymVlasov May 30, 2025
a2bc4dd
Update build-image-test.yaml
MaxymVlasov May 30, 2025
4df69be
Update build-image-test.yaml
MaxymVlasov May 30, 2025
bbf1021
Update build-image-test.yaml
MaxymVlasov May 30, 2025
dc6a939
Update build-image-test.yaml
MaxymVlasov May 31, 2025
948df60
Update build-image-test.yaml
MaxymVlasov May 31, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 38 additions & 8 deletions .github/workflows/build-image-test.yaml
Copy link
Collaborator Author

@MaxymVlasov MaxymVlasov May 31, 2025

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 inspect of built image on Mac x64:
Screenshot_20250601-021051.png

docker info on Mac x64:
Screenshot_20250601-023506.png

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

I assume it have no difference with standard linux build, is it make any sense to test Mac-specific docker builds at all?

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? 🤔

Copy link
Collaborator Author

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

Copy link
Collaborator

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: darwin in 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 🤷🏻

Copy link
Collaborator Author

@MaxymVlasov MaxymVlasov Jun 2, 2025

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: darwin is Mac, but colima spin-ups Linux VM to run docker

Colima means Containers on Lima. Since Lima is aka Linux Machines. By transitivity, Colima can also mean Containers on Linux Machines.

Copy link
Collaborator

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?

Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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)
Copy link
Collaborator

Choose a reason for hiding this comment

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

  • Using aws as cut is an anti-pattern
  • But if you change it to something like ... | awk -F$'\t' '$4 ~ /colima/ {print $3; exit}', the it makes sense (the exit is to produce only one string if there are more matches). Otherwise it should be something like ... | cut -f 4 | grep colima.

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
Expand All @@ -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:
Expand All @@ -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/
Expand Down
Loading