From 73d25eeea410dd36724077a3bbcd73d5c2cc0dd1 Mon Sep 17 00:00:00 2001 From: Jennings Zhang Date: Fri, 17 Feb 2023 09:56:09 -0500 Subject: [PATCH] Fix build --- .github/workflows/ci.yml | 36 +----------------------------------- Dockerfile | 7 ++----- tests/test_example.py | 21 --------------------- 3 files changed, 3 insertions(+), 61 deletions(-) delete mode 100644 tests/test_example.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 77a5d21..7f26dd1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,7 +1,6 @@ # Continuous integration testing for ChRIS Plugin. # https://github.com/FNNDSC/python-chrisapp-template/wiki/Continuous-Integration # -# - on push and PR: run pytest # - on push to main: build and push container images as ":latest" # - on push to semver tag: build and push container image with tag and # upload plugin description to https://chrisstore.co @@ -13,42 +12,10 @@ on: branches: [ main ] tags: - "v?[0-9]+.[0-9]+.[0-9]+*" - pull_request: - branches: [ main ] jobs: - test: - name: Unit tests - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - uses: docker/setup-buildx-action@v2 - - name: Cache Docker layers - uses: actions/cache@v3 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - name: Build - uses: docker/build-push-action@v3 - with: - build-args: extras_require=dev - context: . - load: true - push: false - tags: "localhost/local/app:dev" - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - name: Run pytest - run: | - docker run -v "$GITHUB_WORKSPACE:/app:ro" -w /app localhost/local/app:dev \ - pytest -o cache_dir=/tmp/pytest - build: name: Build - if: github.event_name == 'push' || github.event_name == 'release' - # needs: [ test ] # uncomment to require passing tests runs-on: ubuntu-22.04 # A local registry helps us reuse the built image between steps @@ -122,8 +89,7 @@ jobs: localhost:5000/${{ steps.determine.outputs.dock_image }} docker.io/${{ steps.determine.outputs.dock_image }} ghcr.io/${{ steps.determine.outputs.dock_image }} - # if non-x86_84 architectures are supported, add them here - platforms: linux/amd64 #,linux/arm64,linux/ppc64le + platforms: linux/amd64,linux/arm64,linux/ppc64le push: true cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache diff --git a/Dockerfile b/Dockerfile index 8f3dbd2..eadfc1d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,6 @@ -# Python version can be changed, e.g. -# FROM python:3.8 -# FROM docker.io/fnndsc/conda:python3.10.2-cuda11.6.0 -FROM docker.io/python:3.11.0-slim-bullseye +FROM docker.io/fnndsc/mni-conda-base:civet2.1.1-python3.10.6 -LABEL org.opencontainers.image.authors="FNNDSC " \ +LABEL org.opencontainers.image.authors="FNNDSC " \ org.opencontainers.image.title="Subdivide Masks" \ org.opencontainers.image.description="A ChRIS plugin wrapper around mincresample for increasing the resolution of binary images." diff --git a/tests/test_example.py b/tests/test_example.py deleted file mode 100644 index cb46fed..0000000 --- a/tests/test_example.py +++ /dev/null @@ -1,21 +0,0 @@ -from pathlib import Path - -from subdiv_mask import parser, main - - -def test_main(tmp_path: Path): - # setup example data - inputdir = tmp_path / 'incoming' - outputdir = tmp_path / 'outgoing' - inputdir.mkdir() - outputdir.mkdir() - (inputdir / 'plaintext.txt').write_text('hello ChRIS, I am a ChRIS plugin') - - # simulate run of main function - options = parser.parse_args(['--word', 'ChRIS', '--pattern', '*.txt']) - main(options, inputdir, outputdir) - - # assert behavior is expected - expected_output_file = outputdir / 'plaintext.count.txt' - assert expected_output_file.exists() - assert expected_output_file.read_text() == '2'