Skip to content

Commit 71cf2ff

Browse files
authored
Remove arm64 build (#776)
* Remove arm64 build * Move Dockerfile up * Remove firefox tests * Don't push to dockerhub
1 parent 4d7cadc commit 71cf2ff

File tree

17 files changed

+89
-549
lines changed

17 files changed

+89
-549
lines changed

.github/actions/create-dev-env/action.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.github/actions/integration-tests/action.yml

Lines changed: 0 additions & 59 deletions
This file was deleted.

.github/actions/load-image/action.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 69 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,91 @@
11
---
2-
name: Build a new image and then upload the image, tags and manifests to GitHub artifacts
2+
name: Build Docker image
3+
4+
on:
5+
pull_request:
6+
push:
7+
branches:
8+
- main
9+
tags:
10+
- v*
11+
workflow_dispatch:
312

413
env:
5-
OWNER: ${{ github.repository_owner }}
614
FORCE_COLOR: 1
15+
IMAGE: ghcr.io/aiidalab/qe
16+
BUILDKIT_PROGRESS: plain
717

8-
on:
9-
workflow_call:
10-
inputs:
11-
image:
12-
description: Image name
13-
required: true
14-
type: string
15-
architecture:
16-
description: Image architecture, e.g. amd64, arm64
17-
required: true
18-
type: string
19-
runsOn:
20-
description: GitHub Actions Runner image
21-
required: true
22-
type: string
18+
# https://docs.github.com/en/actions/using-jobs/using-concurrency
19+
concurrency:
20+
# only cancel in-progress jobs or runs for the current workflow - matches against branch & tags
21+
group: ${{ github.workflow }}-${{ github.ref }}
22+
cancel-in-progress: true
2323

2424
jobs:
2525
build-test-upload:
26-
runs-on: ${{ inputs.runsOn }}
26+
runs-on: ubuntu-latest
2727
continue-on-error: true
2828

2929
steps:
3030
- name: Checkout Repo ⚡️
3131
uses: actions/checkout@v4
32-
- name: Create dev environment 📦
33-
uses: ./.github/actions/create-dev-env
32+
33+
- name: Login to Container Registry 🔑
34+
uses: docker/login-action@v2
35+
if: ${{ !github.event.pull_request.head.repo.fork }}
3436
with:
35-
architecture: ${{ inputs.architecture }}
37+
registry: ghcr.io
38+
username: ${{ github.actor }}
39+
password: ${{ secrets.GITHUB_TOKEN }}
3640

37-
# Self-hosted runners share a state (whole VM) between runs
38-
# Also, they might have running or stopped containers,
39-
# which are not cleaned up by `docker system prun`
40-
- name: Reset docker state and cleanup artifacts 🗑️
41-
if: ${{ startsWith(inputs.runsOn, 'ubuntu') }}
42-
run: |
43-
docker kill $(docker ps --quiet) || true
44-
docker rm $(docker ps --all --quiet) || true
45-
docker system prune --all --force
46-
rm -rf /tmp/aiidalab/
47-
shell: bash
41+
- name: Set up Docker Buildx
42+
uses: docker/setup-buildx-action@v3
4843

49-
- name: Build image 🛠
50-
working-directory: docker
51-
run: docker buildx bake --set qe.platform=linux/${{ inputs.architecture }} -f docker-bake.hcl -f build.json --load
52-
env:
53-
# Use buildx
54-
DOCKER_BUILDKIT: 1
55-
# Full logs for CI build
56-
BUILDKIT_PROGRESS: plain
57-
shell: bash
44+
- name: Docker meta 📝
45+
id: meta
46+
uses: docker/metadata-action@v5
47+
with:
48+
images: |
49+
name=${{ env.IMAGE }}
50+
tags: |
51+
type=ref,event=pr
52+
type=edge,enable={{is_default_branch}}
53+
type=raw,value={{tag}},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
5854
59-
- name: Run tests ✅
60-
uses: ./.github/actions/integration-tests
55+
- name: Build and push image
56+
id: build-upload
57+
uses: docker/build-push-action@v5
6158
with:
62-
architecture: ${{ inputs.architecture }}
63-
runsOn: ${{ inputs.runsOn }}
59+
tags: ${{ steps.meta.outputs.tags }}
60+
load: ${{ github.event.pull_request.head.repo.fork }}
61+
push: ${{ ! github.event.pull_request.head.repo.fork }}
62+
context: .
63+
platforms: linux/amd64
64+
cache-to: |
65+
type=gha,scope=${{ github.workflow }},mode=min
66+
cache-from: |
67+
type=gha,scope=${{ github.workflow }}
6468
65-
- name: Save image as a tar for later use 💾
66-
run: |
67-
mkdir -p /tmp/aiidalab/
68-
docker save ${{ env.OWNER }}/${{ inputs.image }} -o /tmp/aiidalab/${{ inputs.image }}-${{ inputs.architecture }}.tar
69-
shell: bash
70-
if: always()
69+
- name: Set Up Python 🐍
70+
uses: actions/setup-python@v5
71+
with:
72+
python-version: 3.11
73+
74+
- name: Install Dev Dependencies 📦
75+
run: pip install -r requirements-docker.txt
7176

72-
- name: Upload image as artifact 💾
77+
- name: Set jupyter token env
78+
run: echo "JUPYTER_TOKEN=$(openssl rand -hex 32)" >> $GITHUB_ENV
79+
80+
- name: Run pytest for Chrome
81+
run: pytest --driver Chrome tests_integration/
82+
env:
83+
QE_IMAGE: ${{ env.IMAGE }}@${{ steps.build-upload.outputs.digest }}
84+
85+
- name: Upload screenshots as artifacts
86+
if: always()
7387
uses: actions/upload-artifact@v4
7488
with:
75-
name: ${{ inputs.image }}-${{ inputs.architecture }}
76-
path: /tmp/aiidalab/${{ inputs.image }}-${{ inputs.architecture }}.tar
77-
retention-days: 3
78-
if: always()
89+
name: Screenshots
90+
path: screenshots/
91+
if-no-files-found: error

.github/workflows/docker-merge-tags.yml

Lines changed: 0 additions & 65 deletions
This file was deleted.

0 commit comments

Comments
 (0)