Skip to content

Commit

Permalink
Merge pull request #1 from sondavidb/automate-arm-testing
Browse files Browse the repository at this point in the history
Add ARM testing to workflow
  • Loading branch information
sondavidb committed Sep 19, 2023
2 parents f556b45 + 000c9c3 commit d918807
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 2 deletions.
54 changes: 52 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ on:
- 'Dockerfile'
- 'integration/**'
- 'scripts/**'
env:
GO_VERSION: '1.20.6'

jobs:
test:
Expand All @@ -25,7 +27,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: '1.20.6'
go-version: ${{ env.GO_VERSION }}
- run: make
- run: make test
integration:
Expand All @@ -40,5 +42,53 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: '1.20.6'
go-version: ${{ env.GO_VERSION }}
- run: make integration

integration-arm64:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
containerd: ["1.7.0"]
arch: ["arm64"]
env:
DOCKER_BUILD_ARGS: "CONTAINERD_VERSION=${{ matrix.containerd }}"
steps:
- uses: actions/checkout@v4
- uses: uraimo/run-on-arch-action@v2.5.1
id: integration-tests-arm64
with:
arch: aarch64
distro: ubuntu20.04
dockerRunArgs: |
-v /tmp:/tmp
-v ${{ github.workspace }}:/soci-snapshotter
githubToken: ${{ github.token }}
shell: /bin/bash
install: |
apt-get update
apt-get -y install curl gcc git libz-dev make wget
wget https://go.dev/dl/go${{ env.GO_VERSION }}.linux-arm64.tar.gz
rm -rf /usr/local/go && tar -C /usr/local -xzf go${{ env.GO_VERSION }}.linux-arm64.tar.gz
curl -fsSL https://get.docker.com -o get-docker.sh
sh ./get-docker.sh --version
curl -SL https://github.com/docker/compose/releases/download/v2.19.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
run: |
echo ${{ github.workspace }}
dpkg --add-architecture arm64
export PATH=$PATH:/usr/local/go/bin
uname -m
go version
docker info
docker-compose --version
cd /soci-snapshotter
ls -l
ls -l ./integration
STATIC=1 GO_TEST_FLAGS=“-run TestLazyPullNoBackgroundFetch -count=1” make integration
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ ARG TARGETARCH
COPY . $GOPATH/src/github.com/awslabs/soci-snapshotter
ENV GOPROXY direct
RUN apt-get update -y && apt-get install -y libbtrfs-dev libseccomp-dev libz-dev gcc fuse pigz
RUN if [ "$TARGETARCH" = "aarch64" ] ; then apt-get install -y glibc-static ; fi

RUN cp $GOPATH/src/github.com/awslabs/soci-snapshotter/out/soci /usr/local/bin/ && \
cp $GOPATH/src/github.com/awslabs/soci-snapshotter/out/soci-snapshotter-grpc /usr/local/bin/ && \
mkdir /etc/soci-snapshotter-grpc && \
Expand Down

0 comments on commit d918807

Please sign in to comment.