Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 4 additions & 15 deletions .build-tools/containers/build.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
#!/usr/bin/env bash

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

if [ $target_arch == "aarch64" ]; then
target_arch="arm64v8"
else
target_arch="x86_64"
fi
else
if [[ $# -ne 2 ]]; then
echo "arch not installed. Please provice manually the target architecture. Usage: $0 <name> <arch>"
exit 1
else
target_arch=${2}
fi
if [[ $# -ne 1 ]]; then
echo "arch not installed. Please provide the folder to build. Usage: $0 <name>"
exit 1
fi

folder=${1}
echo "Building $folder for arch $target_arch"
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}
docker build -t "ghcr.io/algebraic-programming/taskr/${folder}:latest" ${folder}
3 changes: 1 addition & 2 deletions .build-tools/containers/buildenv/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ARG ARCH=
FROM registry.gitlab.huaweirc.ch/zrc-von-neumann-lab/runtime-system-innovations/hicr/buildenv-${ARCH}:latest
FROM ghcr.io/algebraic-programming/hicr/buildenv:latest

ENV USER=hicr
ENV HOME=/home/$USER
Expand Down
2 changes: 1 addition & 1 deletion .build-tools/containers/buildenv/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ fi
folder=${1}
arch=${2}

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
docker run --name taskr --shm-size=1024M --privileged -td "ghcr.io/algebraic-programming/taskr/${folder}:latest" bash
24 changes: 0 additions & 24 deletions .build-tools/containers/deploy.sh

This file was deleted.

12 changes: 0 additions & 12 deletions .build-tools/containers/remove.sh

This file was deleted.

21 changes: 4 additions & 17 deletions .build-tools/containers/run.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,11 @@
#!/usr/bin/env bash

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

if [ $target_arch == "aarch64" ]; then
target_arch="arm64v8"
else
target_arch="x86_64"
fi
else
if [[ $# -ne 2 ]]; then
echo "arch not installed. Please provice manually the target architecture. Usage: $0 <name> <arch>"
exit 1
else
arch=${2}
fi
if [[ $# -ne 1 ]]; then
echo "arch not installed. Please provide the folder to build. Usage: $0 <name>"
exit 1
fi

folder=${1}
echo "Running $folder for arch $target_arch"

build_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
$build_dir/$folder/run.sh ${folder} ${target_arch}
$build_dir/$folder/run.sh ${folder}
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ If it fixes a bug or resolves a feature request, be sure to link to that issue._

## Type of change

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

- [ ] `CHANGE` (fix or feature that would cause existing functionality to not work as expected)
- [ ] `FEATURE` (non-breaking change which adds functionality)
Expand Down
99 changes: 99 additions & 0 deletions .github/workflows/master-build-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Merge into master - Build Workflow

# if statements modified to avoid: https://stackoverflow.com/questions/69354003/github-action-job-fire-when-previous-job-skipped

on:
workflow_call:
inputs:
os:
required: true
type: string
arch:
required: true
type: string

permissions:
contents: read

env:
REGISTRY: ghcr.io
DOCKERIMAGE: ghcr.io/algebraic-programming/taskr/buildenv

defaults:
run:
shell: bash

jobs:
check-dockerfile-modifications-with-last-commit:
runs-on: ${{ inputs.os }}
outputs:
dockerfile-modified: ${{ steps.check-dockerfile.outputs.dockerfile-modified }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2

# Check the PR diff using the current branch and the base branch of the PR
- name: Run git diff
run: |
git diff --name-only HEAD^..HEAD > ${{ runner.temp }}/diff.txt

- name: Check if Dockerfile was modified
id: check-dockerfile
env:
MODIFIED_FILES_PATH: ${{ runner.temp }}/diff.txt
run: |
cat $MODIFIED_FILES_PATH
if cat $MODIFIED_FILES_PATH | grep -q 'buildenv/Dockerfile' ; then
echo "Dockerfile was modified"
echo "dockerfile-modified=true" >> $GITHUB_OUTPUT
else
echo "Dockerfile was not modified"
echo "dockerfile-modified=false" >> $GITHUB_OUTPUT
fi

build-image:
runs-on: ${{ inputs.os }}
needs: [check-dockerfile-modifications-with-last-commit]
if: ${{ needs.check-dockerfile-modifications-with-last-commit.outputs.dockerfile-modified == 'true' }}
permissions:
contents: read
packages: write
attestations: write
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Docker metadata
id: dockermeta
uses: docker/metadata-action@v4
with:
images: ${{ env.DOCKERIMAGE }}
tags: ${{ inputs.arch }}-latest

- name: Build and push docker image
uses: docker/build-push-action@v6
with:
context: "{{defaultContext}}:.build-tools/containers/buildenv"
push: true
tags: ${{ steps.dockermeta.outputs.tags }}
labels: ${{ steps.dockermeta.outputs.labels }}
build-args: ARCH=${{ inputs.arch }}
cache-from: type=gha
cache-to: type=gha,mode=max
63 changes: 63 additions & 0 deletions .github/workflows/master-test-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Merge into master - Run Tests Workflow

# if statements modified to avoid: https://stackoverflow.com/questions/69354003/github-action-job-fire-when-previous-job-skipped

on:
workflow_call:
inputs:
os:
required: true
type: string
arch:
required: true
type: string

permissions:
contents: read

env:
REGISTRY: ghcr.io
DOCKERIMAGE: ghcr.io/algebraic-programming/taskr/buildenv

defaults:
run:
shell: bash

jobs:
# Build TaskR and run tests and the remote image
compile-and-test:
runs-on: ${{ inputs.os }}
container:
image: ghcr.io/algebraic-programming/taskr/buildenv:latest
options: --user taskr
credentials:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: 'true'

- name: Setup
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

- name: Compile
run: source /home/hicr/.bashrc && meson compile -C build

- name: Running tests and creating coverage report
shell: bash
run: |
echo "Running Tests..."
source /home/hicr/.bashrc
meson setup build --wipe -Db_coverage=true -Dbackends=hwloc,pthreads,mpi,nosv,boost -Dfrontends=channel,RPCEngine,tasking,objectStore -DbuildTests=true -DbuildExamples=true -DcompileWarningsAsErrors=true
meson compile -C build
meson test -C build
echo "Creating coverage report..."
ninja -C build coverage
- uses: actions/upload-artifact@v4
if: always()
with:
name: meson-logs-${{ inputs.arch }}
path: build/meson-logs/
68 changes: 68 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Merge into master - Build and Run Tests

# if statements modified to avoid: https://stackoverflow.com/questions/69354003/github-action-job-fire-when-previous-job-skipped

on:
push:
branches: ["master"]

env:
REGISTRY: ghcr.io
DOCKERIMAGE: ghcr.io/algebraic-programming/taskr/buildenv

jobs:
build-docker-arm64:
uses: Algebraic-Programming/TaskR/.github/workflows/master-build-workflow.yml@master
with:
os: ubuntu-24.04-arm
arch: arm64

build-docker-amd64:
uses: Algebraic-Programming/TaskR/.github/workflows/master-build-workflow.yml@master
with:
os: ubuntu-24.04
arch: amd64

push-buildenv-manifest:
runs-on: ubuntu-latest
needs: [ build-docker-amd64, build-docker-arm64 ]
if: |
always() &&
(contains(needs.build-docker-amd64.result, 'success') || contains(needs.build-docker-amd64.result, 'skipped')) &&
(contains(needs.build-docker-arm64.result, 'success') || contains(needs.build-docker-arm64.result, 'skipped'))
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Create and push manifest images
run:
docker buildx imagetools create --tag ${{ env.DOCKERIMAGE }}:latest ${{ env.DOCKERIMAGE }}:amd64-latest ${{ env.DOCKERIMAGE }}:arm64-latest

compile-and-test-arm64:
needs: [ push-buildenv-manifest ]
if: |
always() &&
(contains(needs.push-buildenv-manifest.result, 'success') || contains(needs.push-buildenv-manifest.result, 'skipped'))
uses: Algebraic-Programming/TaskR/.github/workflows/master-test-workflow.yml@master
with:
os: ubuntu-24.04-arm
arch: arm64

compile-and-test-amd64:
needs: [ push-buildenv-manifest ]
if: |
always() &&
(contains(needs.push-buildenv-manifest.result, 'success') || contains(needs.push-buildenv-manifest.result, 'skipped'))
uses: Algebraic-Programming/TaskR/.github/workflows/master-test-workflow.yml@master
with:
os: ubuntu-24.04
arch: amd64


Loading