Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade from ISMRMRD to MRD v2 #2

Merged
merged 34 commits into from
Dec 14, 2024
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
2d19661
WIP - MRD2 upgrade
naegelejd Aug 6, 2024
bebe45d
WIP - MRD2 upgrade, intermediate structures ported
naegelejd Aug 20, 2024
244e697
WIP - Partial revert to use hoNDArray in mrd2
naegelejd Sep 9, 2024
bb89798
WIP - Upgraded cmr and grappa Gadgets
naegelejd Sep 11, 2024
4ec51b7
WIP - Upgraded epi Gadgets
naegelejd Sep 12, 2024
31f4a09
WIP - Upgraded radial and spiral Gadgets
naegelejd Sep 17, 2024
28b1fc9
Remove code unnecessary for Gadgetron streaming-only
naegelejd Sep 23, 2024
aab67ae
WIP - Fixing python toolbox and adding Pytest e2e
naegelejd Sep 20, 2024
6ec53d0
Convert end-to-end tests to PyTest and MRD v2 only
naegelejd Sep 25, 2024
5069d64
Clean up mrd NDArrays and e2e test CUDA check
naegelejd Sep 30, 2024
ac7dabc
Update mri_core_stream and clean up my comments
naegelejd Oct 2, 2024
6c8f103
Remove everything Win32
naegelejd Oct 3, 2024
c199f55
Update e2e test data for new MRD::Array type
naegelejd Oct 4, 2024
d579c72
Remove all Readers and Writers
naegelejd Oct 4, 2024
08280b1
Update Python toolbox for MRDv2
naegelejd Oct 11, 2024
519e47c
Cleanup "core" definitions across the codebase
naegelejd Oct 11, 2024
00f5306
Clean up core Gadget
naegelejd Oct 11, 2024
cd3cd70
Move AnyImage type to mrd 2 model
naegelejd Oct 17, 2024
d4e0cec
Update to use improved MRD intermediate type names
naegelejd Oct 30, 2024
ca097a1
Merge recent changes to 'master'
naegelejd Nov 12, 2024
1ba436d
Update build to pull and re-generate MRD library
naegelejd Nov 12, 2024
3859909
Add mrd 2.1.0 to environment
naegelejd Nov 12, 2024
0622635
Port AzureDevOps pipeline to GitHub actions
naegelejd Nov 19, 2024
39f3ba3
Merge recent changes to Gadgetron master
naegelejd Nov 22, 2024
c3490ba
Fix CI issues
naegelejd Nov 22, 2024
c0baaa8
Bump ISMRMRD dependency
naegelejd Nov 25, 2024
8cb6637
Remove unused integration test and config files
naegelejd Nov 25, 2024
d3dc6a9
Debug pytest error in CI pipeline
naegelejd Nov 25, 2024
16971f7
Fix e2e tests for non-CUDA builds
naegelejd Nov 26, 2024
beb36c5
Renaming Gadgetron binary to Pingvin
naegelejd Dec 3, 2024
504c20f
Renaming Gadgetron libraries to Pingvin
naegelejd Dec 3, 2024
75af908
Merge branch 'main' into mrd2
naegelejd Dec 3, 2024
828a5b4
Publish conda package only when release is cut
naegelejd Dec 3, 2024
1aad95d
Remove more untested code and address PR feedback
naegelejd Dec 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .devcontainer/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "/opt/conda/envs/gadgetron/bin/gadgetron",
"program": "/opt/conda/envs/pingvin/bin/pingvin",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
Expand Down
4 changes: 2 additions & 2 deletions .devcontainer/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@
},
"cmake.configureOnOpen": true,
"cmake.preferredGenerators": ["Ninja", "Unix Makefiles"],
"cmake.cmakePath": "/opt/conda/envs/gadgetron/bin/cmake",
"cmake.cmakePath": "/opt/conda/envs/pingvin/bin/cmake",
"cmake.configureSettings": {
"USE_CUDA": "ON",
"USE_MKL": "ON",
"CMAKE_INSTALL_PREFIX": "/opt/conda/envs/gadgetron"
"CMAKE_INSTALL_PREFIX": "/opt/conda/envs/pingvin"
}
}
2 changes: 1 addition & 1 deletion .devcontainer/bootstrap-vscode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ else
fi

mkdir -p /home/vscode/.local/share/CMakeTools && \
echo '[{"name":"GCC-CONDA","compilers":{"C":"/opt/conda/envs/gadgetron/bin/x86_64-conda_cos6-linux-gnu-gcc","CXX":"/opt/conda/envs/gadgetron/bin/x86_64-conda_cos6-linux-gnu-g++"}}]' > /home/vscode/.local/share/CMakeTools/cmake-tools-kits.json && \
echo '[{"name":"GCC-CONDA","compilers":{"C":"/opt/conda/envs/pingvin/bin/x86_64-conda_cos6-linux-gnu-gcc","CXX":"/opt/conda/envs/pingvin/bin/x86_64-conda_cos6-linux-gnu-g++"}}]' > /home/vscode/.local/share/CMakeTools/cmake-tools-kits.json && \
chown vscode:conda /home/vscode/.local/share/CMakeTools/cmake-tools-kits.json
14 changes: 14 additions & 0 deletions .devcontainer/devcontainer.bashrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#! /bin/bash
# shellcheck source=/dev/null

source /opt/conda/etc/profile.d/conda.sh
conda activate pingvin

if command -v just >/dev/null ; then
source <(just --completions bash)
fi

if [[ "${BASH_ENV:-}" == "$(readlink -f "${BASH_SOURCE[0]:-}")" ]]; then
# We don't want subshells to unnecessarily source this again.
unset BASH_ENV
fi
15 changes: 7 additions & 8 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "Gadgetron",
"name": "Pingvin",
"build": {
"dockerfile": "../Dockerfile",
"target": "gadgetron_dev_cuda",
"target": "pingvin_dev_cuda",
"context": "../",
"cacheFrom": "ghcr.io/gadgetron/gadgetron/gadgetron_ubuntu_dev_cuda:latest",
"cacheFrom": "ghcr.io/gadgetron/pingvin/ubuntu22.04_dev_cuda:latest",
},
"containerEnv": {
"DOCKER_BUILDKIT": "1",
Expand All @@ -21,11 +21,11 @@
"Ninja",
"Unix Makefiles"
],
"cmake.cmakePath": "/opt/conda/envs/gadgetron/bin/cmake",
"cmake.cmakePath": "/opt/conda/envs/pingvin/bin/cmake",
"cmake.configureSettings": {
"USE_CUDA": "ON",
"USE_MKL": "ON",
"CMAKE_INSTALL_PREFIX": "/opt/conda/envs/gadgetron",
"CMAKE_INSTALL_PREFIX": "/opt/conda/envs/pingvin",
"BUILD_DOCUMENTATION": "OFF"
},
"indentRainbow.includedLanguages": [ "yaml", "python" ]
Expand All @@ -34,6 +34,7 @@
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-vscode.cpptools",
"ms-vscode.cpptools-extension-pack",
"ms-vscode.cmake-tools",
"ms-vscode.live-server",
"eamodio.gitlens",
Expand All @@ -48,10 +49,8 @@
}
},

"runArgs": ["--init", "--network=host"],

// To enable your local GPUs in container if they are on enabled by default devcontainer will fail to start on hosts without GPU
// "runArgs": ["--init", "--network=host", "--gpus=all"],
"runArgs": ["--init", "--network=host", "--gpus=all"],

"mounts": [
],
Expand Down
7 changes: 5 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@
!apps/
!cmake/
!core/
!doc/
!docker/
!gadgets/
!justfile
!libmrd/
!test/
!toolboxes/
!environment.yml
!chroot/
!doc/
!.devcontainer/devcontainer.bashrc

# but also ignore:
test/integration/data/
test/e2e/data/
*.Dockerfile
docker/integration-test-image.sh
149 changes: 149 additions & 0 deletions .github/workflows/pingvin-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
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:
flavor: [cuda, nocuda]
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 pingvin \
&& /opt/code/pingvin/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 Pingvin entrypoint
docker run --rm -i --gpus=all "${image_name}" --info
# Test Pingvin end-to-end
test_command=". /opt/conda/etc/profile.d/conda.sh \
&& conda activate pingvin \
&& cd /opt/e2e-test/ \
&& pytest --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: |-
PINGVIN_VERSION_MAJOR=$(grep -Po '(?<=set\(PINGVIN_VERSION_MAJOR )([^\)]+)' CMakeLists.txt)
PINGVIN_VERSION_MINOR=$(grep -Po '(?<=set\(PINGVIN_VERSION_MINOR )([^\)]+)' CMakeLists.txt)
PINGVIN_VERSION_PATCH=$(grep -Po '(?<=set\(PINGVIN_VERSION_PATCH )([^\)]+)' CMakeLists.txt)
PINGVIN_VERSION="${PINGVIN_VERSION_MAJOR}.${PINGVIN_VERSION_MINOR}.${PINGVIN_VERSION_PATCH}"

./docker/build-images.sh --type dev --type rt --flavor ${{matrix.flavor}} --base-name "${{env.imageBaseName}}" --tag "${PINGVIN_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: Install Yardl
run: |-
YARDL_VERSION=$(grep -Po '(?<=YARDL_VERSION=)(.+)' Dockerfile)
mkdir -p "/tmp/yardl_${YARDL_VERSION}_linux_x86_64"
cd "/tmp/yardl_${YARDL_VERSION}_linux_x86_64"
wget --quiet "https://github.com/microsoft/yardl/releases/download/v${YARDL_VERSION}/yardl_${YARDL_VERSION}_linux_x86_64.tar.gz"
tar -xzf "yardl_${YARDL_VERSION}_linux_x86_64.tar.gz"
pwd >> $GITHUB_PATH

- name: Setup Miniforge
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
environment-file: conda/environment.yml
activate-environment: pingvin-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/**/pingvin*.tar.bz2

publish-conda-package:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
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: pingvin-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 pingvin*.tar.bz2)
do
./conda/publish_package.sh -u gadgetron -t "$ANACONDA_TOKEN" -p "$p"
done
Loading
Loading