From 34ae011382386d6f0c28b2df73585f6c12a0e8d0 Mon Sep 17 00:00:00 2001 From: Artem Sokolov Date: Wed, 8 Jun 2022 21:29:18 +0000 Subject: [PATCH 01/16] Fixed README spelling --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 28f4ad8..1b3a210 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -with open("README.md", "r", encoding="utf-8") as fh: +with open("ReadMe.md", "r", encoding="utf-8") as fh: LONG_DESCRIPTION = fh.read() requires = [ From 969734f88fb0cdc70b090da56fc9e7976b545776 Mon Sep 17 00:00:00 2001 From: Artem Sokolov Date: Wed, 8 Jun 2022 21:50:06 +0000 Subject: [PATCH 02/16] Draft dockerfile --- Dockerfile | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d3ee30c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM gitpod/workspace-full-vnc:latest + +# Qt5 graphics libraries for napari +RUN sudo apt-get update && \ + sudo apt-get install -y qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools && \ + sudo rm -rf /var/lib/apt/lists/* + +# Install cylinter +COPY . /app +RUN sudo pip install /app From e651178b1134fdd5a236b460c7d82b6c8809af38 Mon Sep 17 00:00:00 2001 From: Artem Sokolov Date: Thu, 9 Jun 2022 01:27:08 +0000 Subject: [PATCH 03/16] .dockerignore --- .dockerignore | 2 ++ Dockerfile | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..9e714e1 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +.git/ +docs/ diff --git a/Dockerfile b/Dockerfile index d3ee30c..3b4685e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,12 @@ FROM gitpod/workspace-full-vnc:latest # Qt5 graphics libraries for napari RUN sudo apt-get update && \ - sudo apt-get install -y qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools && \ + sudo apt-get install -y \ + libpython3.8-dev \ + qtbase5-dev \ + qtchooser \ + qt5-qmake \ + qtbase5-dev-tools && \ sudo rm -rf /var/lib/apt/lists/* # Install cylinter From 9000a70ed2096f264810015e60db89807e11aadf Mon Sep 17 00:00:00 2001 From: Artem Sokolov Date: Thu, 9 Jun 2022 01:45:36 +0000 Subject: [PATCH 04/16] pre-install napari --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index 3b4685e..0c050d0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,8 @@ RUN sudo apt-get update && \ qtbase5-dev-tools && \ sudo rm -rf /var/lib/apt/lists/* +RUN python -m pip install "napari[all]" + # Install cylinter COPY . /app RUN sudo pip install /app From 355baf841d6a1e60a3f08ad5b1c9c2203da7df49 Mon Sep 17 00:00:00 2001 From: Artem Sokolov Date: Thu, 9 Jun 2022 16:37:39 +0000 Subject: [PATCH 05/16] Ownership of /app inside the container --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0c050d0..47a7b11 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,5 +13,5 @@ RUN sudo apt-get update && \ RUN python -m pip install "napari[all]" # Install cylinter -COPY . /app -RUN sudo pip install /app +COPY --chown=gitpod:gitpod . /app +RUN python -m pip install /app From 195dc5bf25b19ff564edaaddfcc393002073515e Mon Sep 17 00:00:00 2001 From: Artem Sokolov Date: Thu, 9 Jun 2022 19:56:57 +0000 Subject: [PATCH 06/16] .gitpod.yml draft --- .gitpod.yml | 8 ++++++++ Dockerfile | 3 +++ 2 files changed, 11 insertions(+) create mode 100644 .gitpod.yml diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 0000000..fbbae95 --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,8 @@ +image: + file: Dockerfile +ports: + - port: 6080 + onOpen: open-preview +tasks: + - init: | + eval $(command gp env -e) diff --git a/Dockerfile b/Dockerfile index 47a7b11..378ac1d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,3 +15,6 @@ RUN python -m pip install "napari[all]" # Install cylinter COPY --chown=gitpod:gitpod . /app RUN python -m pip install /app + +# Client for synapse.org +RUN python -m pip install synapseclient From 5d228c1e58d389d8528323002f76e6c1144e6346 Mon Sep 17 00:00:00 2001 From: Artem Sokolov Date: Thu, 9 Jun 2022 20:26:16 +0000 Subject: [PATCH 07/16] Download test data --- .gitpod.yml | 5 +++++ cylinter/config.yml | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index fbbae95..d18de3b 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -6,3 +6,8 @@ ports: tasks: - init: | eval $(command gp env -e) + synapse -u "$SYN_USER" -p "$SYN_TOKEN" \ + get -r syn25685780 --downloadLocation /workspace/testdata && \ + cp /workspace/cylinter/cylinter/config.yml /workspace/testdata + cylinter /workspace/testdata/config.yml + \ No newline at end of file diff --git a/cylinter/config.yml b/cylinter/config.yml index 3c268d5..577a974 100755 --- a/cylinter/config.yml +++ b/cylinter/config.yml @@ -1,11 +1,11 @@ # GENERAL PROGRAM CONFIGURATIONS -inDir: /Users//Desktop/cylinter_demo +inDir: /workspace/testdata # Path to CyLinter input directory containing multi-channel # image files (TIFF or OME-TIFF), segmentation outlines (OME-TIFF), # segmentation masks (TIFF), and corresponding single-cell feature tables (CSV) -outDir: /Users//Desktop/cylinter_demo/output +outDir: /workspace/testdata/output # CyLinter output directory. Path is created if it does not exist. sampleMetadata: From 978ebc4dbdbf0e7dce2430e3a6a6ec4e29eeea56 Mon Sep 17 00:00:00 2001 From: Artem Sokolov Date: Thu, 9 Jun 2022 16:31:42 -0400 Subject: [PATCH 08/16] Update .gitpod.yml --- .gitpod.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index d18de3b..55a4193 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -9,5 +9,5 @@ tasks: synapse -u "$SYN_USER" -p "$SYN_TOKEN" \ get -r syn25685780 --downloadLocation /workspace/testdata && \ cp /workspace/cylinter/cylinter/config.yml /workspace/testdata - cylinter /workspace/testdata/config.yml - \ No newline at end of file + command: cylinter /workspace/testdata/config.yml + From 8ef77f65febb09275798860bd4f9aa866eb5b09d Mon Sep 17 00:00:00 2001 From: Artem Sokolov Date: Thu, 9 Jun 2022 20:50:06 +0000 Subject: [PATCH 09/16] Reduce example to a single core --- .gitpod.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index 55a4193..edfb261 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -7,7 +7,13 @@ tasks: - init: | eval $(command gp env -e) synapse -u "$SYN_USER" -p "$SYN_TOKEN" \ - get -r syn25685780 --downloadLocation /workspace/testdata && \ - cp /workspace/cylinter/cylinter/config.yml /workspace/testdata - command: cylinter /workspace/testdata/config.yml - + get syn27202293 --downloadLocation /workspace/testdata + synapse -u "$SYN_USER" -p "$SYN_TOKEN" \ + get syn27202298 --downloadLocation /workspace/testdata/csv + synapse -u "$SYN_USER" -p "$SYN_TOKEN" \ + get syn28413455 --downloadLocation /workspace/testdata/mask + synapse -u "$SYN_USER" -p "$SYN_TOKEN" \ + get syn27202398 --downloadLocation /workspace/testdata/seg + synapse -u "$SYN_USER" -p "$SYN_TOKEN" \ + get syn27204544 --downloadLocation /workspace/testdata/tif + cp /workspace/cylinter/cylinter/config.yml /workspace/testdata \ No newline at end of file From 90b80288953fd38cbfe54a570b33a1e15fe3c5c7 Mon Sep 17 00:00:00 2001 From: Artem Sokolov Date: Thu, 9 Jun 2022 20:56:57 +0000 Subject: [PATCH 10/16] Rearrangement --- .gitpod.yml | 5 ++--- Dockerfile | 3 --- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index edfb261..ea44b7e 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,11 +1,10 @@ -image: - file: Dockerfile ports: - port: 6080 onOpen: open-preview tasks: - init: | eval $(command gp env -e) + RUN python -m pip install synapseclient synapse -u "$SYN_USER" -p "$SYN_TOKEN" \ get syn27202293 --downloadLocation /workspace/testdata synapse -u "$SYN_USER" -p "$SYN_TOKEN" \ @@ -16,4 +15,4 @@ tasks: get syn27202398 --downloadLocation /workspace/testdata/seg synapse -u "$SYN_USER" -p "$SYN_TOKEN" \ get syn27204544 --downloadLocation /workspace/testdata/tif - cp /workspace/cylinter/cylinter/config.yml /workspace/testdata \ No newline at end of file + cp /workspace/cylinter/cylinter/config.yml /workspace/testdata diff --git a/Dockerfile b/Dockerfile index 378ac1d..47a7b11 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,6 +15,3 @@ RUN python -m pip install "napari[all]" # Install cylinter COPY --chown=gitpod:gitpod . /app RUN python -m pip install /app - -# Client for synapse.org -RUN python -m pip install synapseclient From 148c749bbb98e28e48d50e7d49a4ff6ee79562d7 Mon Sep 17 00:00:00 2001 From: Artem Sokolov Date: Thu, 9 Jun 2022 21:11:21 +0000 Subject: [PATCH 11/16] GHA to auto-build/push the container --- .github/workflows/dockerhub.yml | 39 +++++++++++++++++++++++++++++++++ .gitpod.yml | 2 +- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/dockerhub.yml diff --git a/.github/workflows/dockerhub.yml b/.github/workflows/dockerhub.yml new file mode 100644 index 0000000..1de107b --- /dev/null +++ b/.github/workflows/dockerhub.yml @@ -0,0 +1,39 @@ +name: dockerhub + +on: + release: + types: [published] + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - + name: Remove leading v from the release tag + id: rmv + run: | + sansv=$(echo ${{ github.event.release.tag_name }} | tr -d v) + echo "::set-output name=tag::${{ github.repository }}:$sansv" + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - + name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + push: true + tags: ${{steps.rmv.outputs.tag}} + - + name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }} + \ No newline at end of file diff --git a/.gitpod.yml b/.gitpod.yml index ea44b7e..25a823d 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -4,7 +4,7 @@ ports: tasks: - init: | eval $(command gp env -e) - RUN python -m pip install synapseclient + pip install synapseclient synapse -u "$SYN_USER" -p "$SYN_TOKEN" \ get syn27202293 --downloadLocation /workspace/testdata synapse -u "$SYN_USER" -p "$SYN_TOKEN" \ From 311d50219043bd009b3769f4cd9570a6b6ea2022 Mon Sep 17 00:00:00 2001 From: Artem Sokolov Date: Thu, 9 Jun 2022 22:13:41 +0000 Subject: [PATCH 12/16] Updated dockerignore --- .dockerignore | 1 + Dockerfile | 4 ++++ cylinter/start.sh | 4 ++++ 3 files changed, 9 insertions(+) create mode 100644 cylinter/start.sh diff --git a/.dockerignore b/.dockerignore index 9e714e1..555190c 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,3 @@ .git/ docs/ +Dockerfile diff --git a/Dockerfile b/Dockerfile index 47a7b11..82b25e8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,3 +15,7 @@ RUN python -m pip install "napari[all]" # Install cylinter COPY --chown=gitpod:gitpod . /app RUN python -m pip install /app + +RUN chmod +x /app/cylinter/start.sh +#CMD [ "/app/cylinter/start.sh" ] +CMD cylinter \ No newline at end of file diff --git a/cylinter/start.sh b/cylinter/start.sh new file mode 100644 index 0000000..01ae29a --- /dev/null +++ b/cylinter/start.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +/usr/bin/gp-vncsession +cylinter /data/config.yml \ No newline at end of file From 43b96dabe4f1e3818e2fcec612a6b08120fcaccc Mon Sep 17 00:00:00 2001 From: Artem Sokolov Date: Sat, 11 Jun 2022 00:50:51 +0000 Subject: [PATCH 13/16] Simpler default data location --- cylinter/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cylinter/config.yml b/cylinter/config.yml index 577a974..45b62d0 100755 --- a/cylinter/config.yml +++ b/cylinter/config.yml @@ -1,11 +1,11 @@ # GENERAL PROGRAM CONFIGURATIONS -inDir: /workspace/testdata +inDir: /data # Path to CyLinter input directory containing multi-channel # image files (TIFF or OME-TIFF), segmentation outlines (OME-TIFF), # segmentation masks (TIFF), and corresponding single-cell feature tables (CSV) -outDir: /workspace/testdata/output +outDir: /data/output # CyLinter output directory. Path is created if it does not exist. sampleMetadata: From cdbb02a87767312dfb723c505b4faf1f740dd643 Mon Sep 17 00:00:00 2001 From: Artem Sokolov Date: Sat, 11 Jun 2022 01:04:07 +0000 Subject: [PATCH 14/16] Interactive bash --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 82b25e8..70c21c9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,5 +17,4 @@ COPY --chown=gitpod:gitpod . /app RUN python -m pip install /app RUN chmod +x /app/cylinter/start.sh -#CMD [ "/app/cylinter/start.sh" ] -CMD cylinter \ No newline at end of file +CMD [ "/bin/bash", "-ci", "/app/cylinter/start.sh" ] From 52b7473c5b336e308a71e4bd2afd74d950e1b0aa Mon Sep 17 00:00:00 2001 From: Artem Sokolov Date: Sat, 11 Jun 2022 01:23:16 +0000 Subject: [PATCH 15/16] Temporary test tag --- .github/workflows/dockerhub.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dockerhub.yml b/.github/workflows/dockerhub.yml index 1de107b..6d05820 100644 --- a/.github/workflows/dockerhub.yml +++ b/.github/workflows/dockerhub.yml @@ -32,7 +32,8 @@ jobs: uses: docker/build-push-action@v2 with: push: true - tags: ${{steps.rmv.outputs.tag}} + tags: labsyspharm/cylinter:test +# tags: ${{steps.rmv.outputs.tag}} - name: Image digest run: echo ${{ steps.docker_build.outputs.digest }} From d531c6166f0685e055fd3d7dd2cd6e071410da26 Mon Sep 17 00:00:00 2001 From: Artem Sokolov Date: Sat, 11 Jun 2022 01:44:40 +0000 Subject: [PATCH 16/16] End of test --- .github/workflows/dockerhub.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/dockerhub.yml b/.github/workflows/dockerhub.yml index 6d05820..1de107b 100644 --- a/.github/workflows/dockerhub.yml +++ b/.github/workflows/dockerhub.yml @@ -32,8 +32,7 @@ jobs: uses: docker/build-push-action@v2 with: push: true - tags: labsyspharm/cylinter:test -# tags: ${{steps.rmv.outputs.tag}} + tags: ${{steps.rmv.outputs.tag}} - name: Image digest run: echo ${{ steps.docker_build.outputs.digest }}