Skip to content

Commit

Permalink
Remove arm64 build
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhollas committed Jul 18, 2024
1 parent 4d7cadc commit 8cd30a2
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 418 deletions.
27 changes: 0 additions & 27 deletions .github/actions/create-dev-env/action.yml

This file was deleted.

31 changes: 0 additions & 31 deletions .github/actions/load-image/action.yml

This file was deleted.

113 changes: 55 additions & 58 deletions .github/workflows/docker-build-test-upload.yml
Original file line number Diff line number Diff line change
@@ -1,78 +1,75 @@
---
name: Build a new image and then upload the image, tags and manifests to GitHub artifacts
name: Build Docker image

on:
pull_request:
push:
branches:
- main
tags:
- v*
workflow_dispatch:

env:
OWNER: ${{ github.repository_owner }}
FORCE_COLOR: 1

on:
workflow_call:
inputs:
image:
description: Image name
required: true
type: string
architecture:
description: Image architecture, e.g. amd64, arm64
required: true
type: string
runsOn:
description: GitHub Actions Runner image
required: true
type: string
# https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
# only cancel in-progress jobs or runs for the current workflow - matches against branch & tags
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-test-upload:
runs-on: ${{ inputs.runsOn }}
runs-on: ubuntu-latest
continue-on-error: true

steps:
- name: Checkout Repo ⚡️
uses: actions/checkout@v4
- name: Create dev environment 📦
uses: ./.github/actions/create-dev-env
with:
architecture: ${{ inputs.architecture }}

# Self-hosted runners share a state (whole VM) between runs
# Also, they might have running or stopped containers,
# which are not cleaned up by `docker system prun`
- name: Reset docker state and cleanup artifacts 🗑️
if: ${{ startsWith(inputs.runsOn, 'ubuntu') }}
run: |
docker kill $(docker ps --quiet) || true
docker rm $(docker ps --all --quiet) || true
docker system prune --all --force
rm -rf /tmp/aiidalab/
shell: bash
- name: Login to Container Registry 🔑
uses: docker/login-action@v2
if: ${{ !github.event.pull_request.head.repo.fork }}
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build image 🛠
working-directory: docker
run: docker buildx bake --set qe.platform=linux/${{ inputs.architecture }} -f docker-bake.hcl -f build.json --load
env:
# Use buildx
DOCKER_BUILDKIT: 1
# Full logs for CI build
BUILDKIT_PROGRESS: plain
shell: bash
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Run tests ✅
uses: ./.github/actions/integration-tests
- name: Docker meta 📝
if: ${{ !github.event.pull_request.head.repo.fork }}
id: meta
uses: docker/metadata-action@v4
with:
architecture: ${{ inputs.architecture }}
runsOn: ${{ inputs.runsOn }}
images: |
name=ghcr.io/{{ github.repository_owner }}/qe
tags: |
type=edge,enable={{is_default_branch}}
type=ref,event=pr
type=match,pattern=v(\d{2}\.\d{2}.\d+.*),group=1
type=raw,value={{tag}},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
- name: Save image as a tar for later use 💾
run: |
mkdir -p /tmp/aiidalab/
docker save ${{ env.OWNER }}/${{ inputs.image }} -o /tmp/aiidalab/${{ inputs.image }}-${{ inputs.architecture }}.tar
shell: bash
if: always()
- name: Build and load to Docker
id: build-upload
uses: docker/build-push-action@v5
with:
tags: ${{ steps.meta.outputs.tags }}
load: ${{ github.event.pull_request.head.repo.fork }}
push: ${{ ! github.event.pull_request.head.repo.fork }}
context: .
platforms: linux/amd64
cache-to: |
type=gha,scope=${{ github.workflow }},mode=min
cache-from: |
type=gha,scope=${{ github.workflow }}
- name: Upload image as artifact 💾
uses: actions/upload-artifact@v4
- name: Set Up Python 🐍
uses: actions/setup-python@v5
with:
name: ${{ inputs.image }}-${{ inputs.architecture }}
path: /tmp/aiidalab/${{ inputs.image }}-${{ inputs.architecture }}.tar
retention-days: 3
if: always()
python-version: 3.11

- name: Install Dev Dependencies 📦
run: pip install -r docker/requirements-dev.txt
65 changes: 0 additions & 65 deletions .github/workflows/docker-merge-tags.yml

This file was deleted.

93 changes: 0 additions & 93 deletions .github/workflows/docker-push.yml

This file was deleted.

Loading

0 comments on commit 8cd30a2

Please sign in to comment.