Skip to content

Commit 4df4b6d

Browse files
authored
Reduce arm usage (#453)
* Only run arm64 tests on main or tags * Try caching to gha * Add paths-ignore to pull_request * Update README.md
1 parent 4ca0b40 commit 4df4b6d

File tree

3 files changed

+30
-11
lines changed

3 files changed

+30
-11
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ jobs:
6464
set: |
6565
*.platform=${{ inputs.platforms }}
6666
*.output=type=registry,push-by-digest=true,name-canonical=true
67+
*.cache-to=type=gha,scope=${{ github.workflow }},mode=max
68+
*.cache-from=type=gha,scope=${{ github.workflow }}
6769
files: |
6870
docker-bake.hcl
6971
build.json

.github/workflows/main.yml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ name: Docker
33

44
on:
55
pull_request:
6+
paths-ignore:
7+
- "**.md"
8+
- ruff.toml
9+
- bumpver.toml
10+
- .pre-commit-config.yaml
11+
# We use doit only for local builds
12+
- dodo.py
13+
- aarch64-runner/**
614
push:
715
branches:
816
- main
@@ -47,8 +55,12 @@ jobs:
4755
runsOn: ubuntu-22.04
4856
platforms: linux/amd64,linux/arm64
4957

50-
# To save self-hosted runner resources, we're only testing full-stack image
58+
# To save arm64 runner resources, we run the tests only on main
59+
# and only for full-stack image (same for integration tests below).
5160
test-arm64:
61+
if: >-
62+
github.repository == 'aiidalab/aiidalab-docker-stack'
63+
&& (github.ref_type == 'tag' || github.ref_name == 'main')
5264
needs: build
5365
uses: ./.github/workflows/test.yml
5466
with:
@@ -58,11 +70,20 @@ jobs:
5870
integration: false
5971

6072
test-integration:
73+
name: Integration tests
6174
needs: build
6275
strategy:
6376
fail-fast: false
77+
# Trick to exclude arm64 tests from PRs
78+
# https://github.com/orgs/community/discussions/26253
6479
matrix:
6580
runner: [ubuntu-22.04, buildjet-4vcpu-ubuntu-2204-arm]
81+
isPR:
82+
- ${{ github.event_name == 'pull_request' }}
83+
exclude:
84+
- isPR: true
85+
runner: buildjet-4vcpu-ubuntu-2204-arm
86+
6687
uses: ./.github/workflows/test.yml
6788
with:
6889
runsOn: ${{ matrix.runner }}
@@ -71,7 +92,7 @@ jobs:
7192
integration: true
7293

7394
publish-ghcr:
74-
needs: [build, test-amd64, test-arm64]
95+
needs: [build, test-amd64]
7596
uses: ./.github/workflows/publish.yml
7697
with:
7798
runsOn: ubuntu-22.04
@@ -83,7 +104,7 @@ jobs:
83104
if: >-
84105
github.repository == 'aiidalab/aiidalab-docker-stack'
85106
&& (github.ref_type == 'tag' || github.ref_name == 'main')
86-
needs: [build, publish-ghcr]
107+
needs: [build, test-amd64, test-arm64, publish-ghcr]
87108
uses: ./.github/workflows/publish.yml
88109
with:
89110
runsOn: ubuntu-22.04

README.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ The repository uses the [doit automation tool](https://pydoit.org/) to automate
4444
To use this system, setup a build end testing environment and install the dependencies with:
4545

4646
```console
47-
pip install -r requirements-dev.txt
47+
pip install -r requirements.txt
4848
```
4949

5050
### Build images locally
@@ -55,7 +55,7 @@ The build system will attempt to detect the local architecture and automatically
5555
All commands `build`, `tests`, and `up` will use the locally detected platform and use a version tag based on the state of the local git repository.
5656
However, you can also specify a custom platform or version with the `--platform` and `--version` parameters, example: `doit build --arch=arm64 --version=my-version`.
5757

58-
You can specify target stacks to build with `--target`, example: `doit build --target base --target full-stack`.
58+
You can specify target image variants to build with `--target`, example: `doit build --target base --target lab`.
5959

6060
### Run automated tests
6161

@@ -70,18 +70,14 @@ For manual testing, you can start the images with `doit up`, however we recommen
7070

7171
Images are built for `linux/amd64` and `linux/arm64` during continuous integration for all pull requests into the default branch and pushed to the GitHub Container Registry (ghcr.io) with tags `ghcr.io/aiidalab/*:pr-###`.
7272
You can run automated or manual tests against those images by specifying the registry and version for both the `up` and `tests` commands, example: `doit up --registry=ghcr.io/ --version=pr-123`.
73-
Note: You may have to [log into the registry first](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#authenticating-to-the-container-registry).
7473

7574
### Creating a release
7675

77-
We distinguish between _regular_ releases and _special_ releases, where the former follow the standard versioning scheme (`v2022.1001`) and the latter would be specific to a certain use case, e.g., a workshop with dedicated requirements.
78-
To create a regular release, set up a development environment, and then use `bumpver`:
76+
We use a calendar versioning scheme (e.g. `v2022.1001`), and we automate the release with `bumpver`. To create a release, make sure your are on an up-to-date main branch and run:
7977
```console
8078
bumpver update
8179
```
82-
This will update the README.md file, make a commit, tag it, and then push both to the repository to kick off the build and release flow.
83-
84-
To create a _special_ release, simply tag it with a tag name of your choice with the exception that it cannot start with the character `v`.
80+
This will update the version in bumpver.toml, make a commit, tag it, and then push both to the repository to kick off the build and release flow.
8581

8682
## Deploy AiiDAlab with aiidalab-launch
8783

0 commit comments

Comments
 (0)