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

Adds GitHub Action to automatically build and test MAP #12

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
58 changes: 58 additions & 0 deletions .github/workflows/publish_map.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Workflow to build and publish aide-svrtk MAP on GHCR

name: Build and package MAP

on:
push:
branches: ['11-gha-build']

jobs:
build:

runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
python-version: [ '3.10' ]

defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install Python packages
run: |
python -m pip install --upgrade pip
pip install flake8 pytest pytest-cov
pip install -r requirements.txt
# pip install -r app/app_requirements.txt

- name: Display installed pip packages
run: |
pip list

- name: Free disk space
run: |
df -h
sudo swapoff -a
sudo rm -rf /swapfile /usr/share/dotnet /usr/local/lib/android /opt/ghc
sudo apt clean
docker rmi $(docker image ls -aq)
df -h

- name: Package MAP & test MAP end-to-end
run: |
monai-deploy package app -t map-init:temp -r requirements.txt -l DEBUG
docker images
docker build --build-arg INIT_CONTAINER=map-init:temp -t map-final:temp app
docker images

4 changes: 3 additions & 1 deletion app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM fetalsvrtk/aide:map-test AS build
ARG INIT_CONTAINER

FROM $INIT_CONTAINER AS build

# Add dcm2niix to MAP
WORKDIR /bin
Expand Down