Skip to content

Commit 26f8053

Browse files
authored
ci: use hicr CI for taskr (#2)
* build: update submodules * ci: use hicr CI for taskr
1 parent a654654 commit 26f8053

20 files changed

+702
-80
lines changed

.build-tools/containers/build.sh

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,11 @@
11
#!/usr/bin/env bash
22

3-
if command -v arch &>/dev/null; then
4-
target_arch=$(arch)
53

6-
if [ $target_arch == "aarch64" ]; then
7-
target_arch="arm64v8"
8-
else
9-
target_arch="x86_64"
10-
fi
11-
else
12-
if [[ $# -ne 2 ]]; then
13-
echo "arch not installed. Please provice manually the target architecture. Usage: $0 <name> <arch>"
14-
exit 1
15-
else
16-
target_arch=${2}
17-
fi
4+
if [[ $# -ne 1 ]]; then
5+
echo "arch not installed. Please provide the folder to build. Usage: $0 <name>"
6+
exit 1
187
fi
198

209
folder=${1}
2110
echo "Building $folder for arch $target_arch"
22-
docker build -t "registry.gitlab.huaweirc.ch/zrc-von-neumann-lab/runtime-system-innovations/taskr/${folder}-${target_arch}:latest" --build-arg ARCH=${target_arch} ${folder}
11+
docker build -t "ghcr.io/algebraic-programming/taskr/${folder}:latest" ${folder}

.build-tools/containers/buildenv/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
ARG ARCH=
2-
FROM registry.gitlab.huaweirc.ch/zrc-von-neumann-lab/runtime-system-innovations/hicr/buildenv-${ARCH}:latest
1+
FROM ghcr.io/algebraic-programming/hicr/buildenv:latest
32

43
ENV USER=hicr
54
ENV HOME=/home/$USER

.build-tools/containers/buildenv/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ fi
88
folder=${1}
99
arch=${2}
1010

11-
docker run --name taskr --shm-size=1024M --privileged -td "registry.gitlab.huaweirc.ch/zrc-von-neumann-lab/runtime-system-innovations/taskr/${folder}-${arch}:latest" bash
11+
docker run --name taskr --shm-size=1024M --privileged -td "ghcr.io/algebraic-programming/taskr/${folder}:latest" bash

.build-tools/containers/deploy.sh

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

.build-tools/containers/remove.sh

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

.build-tools/containers/run.sh

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,11 @@
11
#!/usr/bin/env bash
22

3-
if command -v arch &>/dev/null; then
4-
target_arch=$(arch)
5-
6-
if [ $target_arch == "aarch64" ]; then
7-
target_arch="arm64v8"
8-
else
9-
target_arch="x86_64"
10-
fi
11-
else
12-
if [[ $# -ne 2 ]]; then
13-
echo "arch not installed. Please provice manually the target architecture. Usage: $0 <name> <arch>"
14-
exit 1
15-
else
16-
arch=${2}
17-
fi
3+
if [[ $# -ne 1 ]]; then
4+
echo "arch not installed. Please provide the folder to build. Usage: $0 <name>"
5+
exit 1
186
fi
197

208
folder=${1}
21-
echo "Running $folder for arch $target_arch"
229

2310
build_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
24-
$build_dir/$folder/run.sh ${folder} ${target_arch}
11+
$build_dir/$folder/run.sh ${folder}

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ If it fixes a bug or resolves a feature request, be sure to link to that issue._
55

66
## Type of change
77

8-
_What type of changes does your code introduce to HiCR? Put an `x` in the box that apply._
8+
_What type of changes does your code introduce to TaskR? Put an `x` in the box that apply._
99

1010
- [ ] `CHANGE` (fix or feature that would cause existing functionality to not work as expected)
1111
- [ ] `FEATURE` (non-breaking change which adds functionality)
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Merge into master - Build Workflow
2+
3+
# if statements modified to avoid: https://stackoverflow.com/questions/69354003/github-action-job-fire-when-previous-job-skipped
4+
5+
on:
6+
workflow_call:
7+
inputs:
8+
os:
9+
required: true
10+
type: string
11+
arch:
12+
required: true
13+
type: string
14+
15+
permissions:
16+
contents: read
17+
18+
env:
19+
REGISTRY: ghcr.io
20+
DOCKERIMAGE: ghcr.io/algebraic-programming/taskr/buildenv
21+
22+
defaults:
23+
run:
24+
shell: bash
25+
26+
jobs:
27+
check-dockerfile-modifications-with-last-commit:
28+
runs-on: ${{ inputs.os }}
29+
outputs:
30+
dockerfile-modified: ${{ steps.check-dockerfile.outputs.dockerfile-modified }}
31+
steps:
32+
- name: Checkout repository
33+
uses: actions/checkout@v4
34+
with:
35+
fetch-depth: 2
36+
37+
# Check the PR diff using the current branch and the base branch of the PR
38+
- name: Run git diff
39+
run: |
40+
git diff --name-only HEAD^..HEAD > ${{ runner.temp }}/diff.txt
41+
42+
- name: Check if Dockerfile was modified
43+
id: check-dockerfile
44+
env:
45+
MODIFIED_FILES_PATH: ${{ runner.temp }}/diff.txt
46+
run: |
47+
cat $MODIFIED_FILES_PATH
48+
if cat $MODIFIED_FILES_PATH | grep -q 'buildenv/Dockerfile' ; then
49+
echo "Dockerfile was modified"
50+
echo "dockerfile-modified=true" >> $GITHUB_OUTPUT
51+
else
52+
echo "Dockerfile was not modified"
53+
echo "dockerfile-modified=false" >> $GITHUB_OUTPUT
54+
fi
55+
56+
build-image:
57+
runs-on: ${{ inputs.os }}
58+
needs: [check-dockerfile-modifications-with-last-commit]
59+
if: ${{ needs.check-dockerfile-modifications-with-last-commit.outputs.dockerfile-modified == 'true' }}
60+
permissions:
61+
contents: read
62+
packages: write
63+
attestations: write
64+
id-token: write
65+
66+
steps:
67+
- name: Checkout repository
68+
uses: actions/checkout@v4
69+
70+
- name: Log in to the Container registry
71+
uses: docker/login-action@v3
72+
with:
73+
registry: ${{ env.REGISTRY }}
74+
username: ${{ github.repository_owner }}
75+
password: ${{ secrets.GITHUB_TOKEN }}
76+
77+
- name: Set up QEMU
78+
uses: docker/setup-qemu-action@v3
79+
80+
- name: Set up Docker Buildx
81+
uses: docker/setup-buildx-action@v3
82+
83+
- name: Docker metadata
84+
id: dockermeta
85+
uses: docker/metadata-action@v4
86+
with:
87+
images: ${{ env.DOCKERIMAGE }}
88+
tags: ${{ inputs.arch }}-latest
89+
90+
- name: Build and push docker image
91+
uses: docker/build-push-action@v6
92+
with:
93+
context: "{{defaultContext}}:.build-tools/containers/buildenv"
94+
push: true
95+
tags: ${{ steps.dockermeta.outputs.tags }}
96+
labels: ${{ steps.dockermeta.outputs.labels }}
97+
build-args: ARCH=${{ inputs.arch }}
98+
cache-from: type=gha
99+
cache-to: type=gha,mode=max
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Merge into master - Run Tests Workflow
2+
3+
# if statements modified to avoid: https://stackoverflow.com/questions/69354003/github-action-job-fire-when-previous-job-skipped
4+
5+
on:
6+
workflow_call:
7+
inputs:
8+
os:
9+
required: true
10+
type: string
11+
arch:
12+
required: true
13+
type: string
14+
15+
permissions:
16+
contents: read
17+
18+
env:
19+
REGISTRY: ghcr.io
20+
DOCKERIMAGE: ghcr.io/algebraic-programming/taskr/buildenv
21+
22+
defaults:
23+
run:
24+
shell: bash
25+
26+
jobs:
27+
# Build TaskR and run tests and the remote image
28+
compile-and-test:
29+
runs-on: ${{ inputs.os }}
30+
container:
31+
image: ghcr.io/algebraic-programming/taskr/buildenv:latest
32+
options: --user taskr
33+
credentials:
34+
username: ${{ github.repository_owner }}
35+
password: ${{ secrets.GITHUB_TOKEN }}
36+
37+
steps:
38+
- name: Checkout repository
39+
uses: actions/checkout@v4
40+
with:
41+
submodules: 'true'
42+
43+
- name: Setup
44+
run: source /home/hicr/.bashrc && meson setup build -Dbackends=hwloc,pthreads,mpi,lpf,nosv,boost,opencl -Dfrontends=channel,RPCEngine,tasking,objectStore -DbuildTests=true -DbuildExamples=true -DcompileWarningsAsErrors=true
45+
46+
- name: Compile
47+
run: source /home/hicr/.bashrc && meson compile -C build
48+
49+
- name: Running tests and creating coverage report
50+
shell: bash
51+
run: |
52+
echo "Running Tests..."
53+
source /home/hicr/.bashrc
54+
meson setup build --wipe -Db_coverage=true -Dbackends=hwloc,pthreads,mpi,nosv,boost -Dfrontends=channel,RPCEngine,tasking,objectStore -DbuildTests=true -DbuildExamples=true -DcompileWarningsAsErrors=true
55+
meson compile -C build
56+
meson test -C build
57+
echo "Creating coverage report..."
58+
ninja -C build coverage
59+
- uses: actions/upload-artifact@v4
60+
if: always()
61+
with:
62+
name: meson-logs-${{ inputs.arch }}
63+
path: build/meson-logs/

.github/workflows/master.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Merge into master - Build and Run Tests
2+
3+
# if statements modified to avoid: https://stackoverflow.com/questions/69354003/github-action-job-fire-when-previous-job-skipped
4+
5+
on:
6+
push:
7+
branches: ["master"]
8+
9+
env:
10+
REGISTRY: ghcr.io
11+
DOCKERIMAGE: ghcr.io/algebraic-programming/taskr/buildenv
12+
13+
jobs:
14+
build-docker-arm64:
15+
uses: Algebraic-Programming/TaskR/.github/workflows/master-build-workflow.yml@master
16+
with:
17+
os: ubuntu-24.04-arm
18+
arch: arm64
19+
20+
build-docker-amd64:
21+
uses: Algebraic-Programming/TaskR/.github/workflows/master-build-workflow.yml@master
22+
with:
23+
os: ubuntu-24.04
24+
arch: amd64
25+
26+
push-buildenv-manifest:
27+
runs-on: ubuntu-latest
28+
needs: [ build-docker-amd64, build-docker-arm64 ]
29+
if: |
30+
always() &&
31+
(contains(needs.build-docker-amd64.result, 'success') || contains(needs.build-docker-amd64.result, 'skipped')) &&
32+
(contains(needs.build-docker-arm64.result, 'success') || contains(needs.build-docker-arm64.result, 'skipped'))
33+
steps:
34+
- name: Set up Docker Buildx
35+
uses: docker/setup-buildx-action@v3
36+
37+
- name: Log in to the Container registry
38+
uses: docker/login-action@v3
39+
with:
40+
registry: ${{ env.REGISTRY }}
41+
username: ${{ github.repository_owner }}
42+
password: ${{ secrets.GITHUB_TOKEN }}
43+
44+
- name: Create and push manifest images
45+
run:
46+
docker buildx imagetools create --tag ${{ env.DOCKERIMAGE }}:latest ${{ env.DOCKERIMAGE }}:amd64-latest ${{ env.DOCKERIMAGE }}:arm64-latest
47+
48+
compile-and-test-arm64:
49+
needs: [ push-buildenv-manifest ]
50+
if: |
51+
always() &&
52+
(contains(needs.push-buildenv-manifest.result, 'success') || contains(needs.push-buildenv-manifest.result, 'skipped'))
53+
uses: Algebraic-Programming/TaskR/.github/workflows/master-test-workflow.yml@master
54+
with:
55+
os: ubuntu-24.04-arm
56+
arch: arm64
57+
58+
compile-and-test-amd64:
59+
needs: [ push-buildenv-manifest ]
60+
if: |
61+
always() &&
62+
(contains(needs.push-buildenv-manifest.result, 'success') || contains(needs.push-buildenv-manifest.result, 'skipped'))
63+
uses: Algebraic-Programming/TaskR/.github/workflows/master-test-workflow.yml@master
64+
with:
65+
os: ubuntu-24.04
66+
arch: amd64
67+
68+

0 commit comments

Comments
 (0)