Skip to content

Test MONAI Deploy Express #90

Test MONAI Deploy Express

Test MONAI Deploy Express #90

name: Test MONAI Deploy Express
on:
push:
paths:
- 'deploy/monai-deploy-express/**'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Controls when the workflow will run
permissions:
contents: write
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Start MONAI Deploy Express
working-directory: ./deploy/monai-deploy-express
run: |
./init.sh
docker compose up --wait
- name: Informatics Gateway Health Check
continue-on-error: true
run: |
curl http://localhost:5000/health
- name: Workflow Manager Health Check
continue-on-error: true
run: |
curl http://localhost:5001/health
- name: Task Manager Health Check
continue-on-error: true
run: |
curl http://localhost:5002/health
- name: Get WorkflowID
continue-on-error: true
run: |
curl -X POST http://localhost:8042/instances --data-binary "@deploy/monai-deploy-express/sample-workflows/ci-test-files/IMG0002.dcm"
WORKFLOW_ID=$(curl --request POST --header 'Content-Type: application/json' --data @deploy/monai-deploy-express/sample-workflows/hello-world.json http://localhost:5001/workflows | jq '.workflow_id' )
SIZE=${#WORKFLOW_ID}
echo "GITHUB_SIZE=$(echo $SIZE)" >> $GITHUB_ENV
if [[ $SIZE < 32 ]]; then
echo "WID=false" >> "$GITHUB_ENV"
echo "No WorkflowID"
else
echo "WID=true" >> "$GITHUB_ENV"
echo "WorkflowID Present"
fi
- name: Test env VAR
run: |
echo "State is: '${{ env.WID }}'" # Output works
if: env.WID != 'false'
echo "WID works"
- name: Test WorkflowID
continue-on-error: true
run: |
if: ${{ env.GITHUB_SIZE < 32 }}
uses: actions/github-script@v3
with:
script: |
core.setFailed('No workflow ID returned')
if: ${{ env.GITHUB_SIZE >= 32 }}
run: echo 'Workflow ID Returned'
- name: Collect Logs
working-directory: ./deploy/monai-deploy-express
continue-on-error: true
run: docker compose logs > logs.txt
- name: Stop MONAI Deploy Express
working-directory: ./deploy/monai-deploy-express
continue-on-error: true
run: docker compose down
- uses: actions/upload-artifact@v3
with:
name: logs
path: ./deploy/monai-deploy-express/logs.txt