Upgrade from ISMRMRD to MRD v2 #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Pingvin CI | |
on: | |
push: | |
branches: [main] | |
tags: ["v*.*.*"] | |
pull_request: | |
branches: [main] | |
workflow_dispatch: | |
permissions: | |
id-token: write | |
contents: read | |
env: | |
imageBaseName: ghcr.io/gadgetron/pingvin/ubuntu22.04 | |
defaults: | |
run: | |
# See https://github.com/marketplace/actions/setup-miniconda#important | |
shell: bash -el {0} | |
jobs: | |
build-and-test: | |
runs-on: ["self-hosted", "1ES.Pool=biomedsigproc-pingvin-NC6s_v3"] | |
strategy: | |
matrix: | |
include: | |
- flavor: cuda | |
requirements: python,cuda | |
- flavor: nocuda | |
requirements: python | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4.1.0 | |
- name: Check GPU availability | |
run: docker run --rm --gpus=all ghcr.io/gadgetron/gadgetron/cuda:12.3.0-base-ubuntu22.04 nvidia-smi | |
- name: Build Docker images | |
run: ./docker/build-images.sh --type dev --type build --type rt --flavor ${{matrix.flavor}} --base-name "${{env.imageBaseName}}" | |
- name: Unit Test | |
run: |- | |
image_name="${{env.imageBaseName}}_build_${{matrix.flavor}}" | |
test_command=". /opt/conda/etc/profile.d/conda.sh \ | |
&& conda activate gadgetron \ | |
&& /opt/code/gadgetron/build/test/test_all" | |
docker run --rm --gpus=all "${image_name}" /bin/bash -c "$test_command" | |
- name: End-to-End Test | |
run: |- | |
image_name="${{env.imageBaseName}}_rt_${{matrix.flavor}}" | |
# Check Gadgetron entrypoint | |
docker run --rm -i --gpus=all "${image_name}" --info | |
# Test Gadgetron end-to-end | |
test_command=". /opt/conda/etc/profile.d/conda.sh \ | |
&& conda activate gadgetron \ | |
&& cd /opt/e2e-test/ \ | |
&& pytest --ignore-requirements ${{matrix.requirements}} --echo-log-on-failure" | |
docker run --rm --gpus=all --entrypoint /bin/bash "${image_name}" -c "$test_command" | |
publish-docker-images: | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
needs: [build-and-test] | |
runs-on: ["self-hosted", "1ES.Pool=biomedsigproc-pingvin-NC6s_v3"] | |
strategy: | |
matrix: | |
flavor: [cuda, nocuda] | |
permissions: | |
packages: write | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4.1.0 | |
- name: Log into ghcr.io | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Publish Docker images | |
run: |- | |
GADGETRON_VERSION_MAJOR=$(grep -Po '(?<=set\(GADGETRON_VERSION_MAJOR )([^\)]+)' CMakeLists.txt) | |
GADGETRON_VERSION_MINOR=$(grep -Po '(?<=set\(GADGETRON_VERSION_MINOR )([^\)]+)' CMakeLists.txt) | |
GADGETRON_VERSION_PATCH=$(grep -Po '(?<=set\(GADGETRON_VERSION_PATCH )([^\)]+)' CMakeLists.txt) | |
GADGETRON_VERSION="${GADGETRON_VERSION_MAJOR}.${GADGETRON_VERSION_MINOR}.${GADGETRON_VERSION_PATCH}" | |
./docker/build-images.sh --type dev --type rt --flavor ${{matrix.flavor}} --base-name "${{env.imageBaseName}}" --tag "${GADGETRON_VERSION}" --push | |
./docker/build-images.sh --type dev --type rt --flavor ${{matrix.flavor}} --base-name "${{env.imageBaseName}}" --tag latest --push | |
build-conda-package: | |
runs-on: ["self-hosted", "1ES.Pool=biomedsigproc-pingvin-NC6s_v3"] | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4.1.0 | |
- name: Setup Miniforge | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
miniforge-version: latest | |
environment-file: conda/environment.yml | |
activate-environment: gadgetron-build | |
- name: Build conda package | |
run: ./conda/package.sh | |
- name: Upload Conda package | |
uses: actions/upload-artifact@v4 | |
with: | |
name: conda-packages | |
path: conda/build_pkg/**/gadgetron*.tar.bz2 | |
- name: Publish conda package | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
env: | |
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }} | |
run: | | |
for p in $(find conda/build_pkg -name gadgetron*.tar.bz2) | |
do | |
./conda/publish_package.sh -u gadgetron -t "$ANACONDA_TOKEN" -p "$p" | |
done | |
publish-conda-package: | |
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
# Publishing a Pingvin conda package will overwrite Gadgetron packages. | |
# Enable this job once Pingvin is ready for release. | |
if: false | |
needs: [build-conda-package] | |
runs-on: ["self-hosted", "1ES.Pool=biomedsigproc-pingvin-NC6s_v3"] | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4.1.0 | |
- name: Setup Miniforge | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
miniforge-version: latest | |
environment-file: conda/environment.yml | |
activate-environment: gadgetron-build | |
- name: Download Conda package | |
uses: actions/download-artifact@v4 | |
with: | |
name: conda-packages | |
path: conda/build_pkg/ | |
- name: Publish conda package | |
env: | |
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }} | |
run: | | |
for p in $(find conda/build_pkg -name gadgetron*.tar.bz2) | |
do | |
./conda/publish_package.sh -u gadgetron -t "$ANACONDA_TOKEN" -p "$p" | |
done |