Suppot Multi-platform images. #6
Workflow file for this run
This file contains 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
name: Multi-arch image build | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- "dev" | |
- "releases/**" | |
tags: | |
- '*' | |
pull_request: | |
branches: | |
- "dev" | |
- "releases/**" | |
jobs: | |
build-and-test-multi-arch-images-on-ubuntu: | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 120 | |
env: | |
DOCKER_REGISTRY_USER: ${{ secrets.DOCKER_REGISTRY_USER }} | |
DOCKER_REGISTRY_KEY: ${{ secrets.DOCKER_REGISTRY_KEY }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Free up space in github runner | |
run: | | |
df -h | |
sudo rm -rf /opt/ghc | |
sudo rm -rf "/usr/local/share/boost" | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/lib/android /usr/local/share/powershell /usr/share/swift /usr/lib/jvm /usr/local/.ghcup | |
sudo docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true | |
df -h | |
- name: build multi arch image | |
run: | | |
cd transforms/universal/noop/ray | |
make multiarch_image | |
docker buildx build -t noop-ray:latest-multiarch --load . | |
docker ps | |
docker run -t --rm noop-ray:latest-multiarch pytest -s test | |
docker login quay.io -u $DOCKER_REGISTRY_USER -p $DOCKER_REGISTRY_KEY | |
docker buildx build --platform=linux/amd64,linux/arm64 -t quay.io/dataprep1/data-prep-kit/noop-ray:latest-multiarch --push . | |
docker ps | |
test-multi-arch-images-on-ubuntu: | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 120 | |
needs: [build-and-test-multi-arch-images-on-ubuntu] | |
steps: | |
- name: Test multi-arch image | |
run: | | |
docker pull quay.io/dataprep1/data-prep-kit/noop-ray:latest-multiarch | |
docker run -t --rm quay.io/dataprep1/data-prep-kit/noop-ray:latest-multiarch pytest -s test | |