Skip to content

Commit

Permalink
Merge pull request #19 from BIOP/update_desktop
Browse files Browse the repository at this point in the history
biop-desktop to 0.1.0
  • Loading branch information
romainGuiet authored May 3, 2024
2 parents ffa1ecb + 5557980 commit e424796
Show file tree
Hide file tree
Showing 23 changed files with 501 additions and 65 deletions.
13 changes: 12 additions & 1 deletion docker/Dockerfile-base
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,24 @@ RUN mkdir -p /home/biop/Desktop && chown -R biop:biop /home/biop/Desktop \
&& chown -R biop:biop /home/biop \
&& chmod -R a+rwx /home/biop/


#################################################################
# Install Inkscape
RUN sudo apt-get update -y \
&& sudo apt-get install inkscape -y


#################################################################
# OpenCL for clij ...
RUN apt-get update \
&& apt-get install -y nvidia-opencl-dev \
&& apt remove -y libnvidia-compute-550-server \
&& apt-get autoremove --purge \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/* \
&& find /var/log -type f -exec cp /dev/null \{\} \;

#################################################################
RUN chown -R biop:biop /home/biop/ \
&& chmod -R a+rwx /home/biop/

Expand Down
40 changes: 18 additions & 22 deletions docker/Dockerfile-ms
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
ARG BASE_IMAGE=0.0.3
ARG BASE_IMAGE=0.1.0

ARG ALIAS=biop/

# because COPY --from= doesn't support build-arg (https://github.com/docker/for-mac/issues/2155)
# we can still do a list of all sub-blocks here to be able to use them in the COPY --from=... below
# base needs to be last, Don't Ask Wky ! (I don't know) ! and it seems it need to be named 'base' , D.A:W.2 ! but it works !
ARG QUPATH_VERSION=v0.5.1
ARG QUPATH_VERSION=v0.5.1-01
ARG ILASTIK_VERSION=1.4.0-gpu
ARG FIJI_VERSION=20240325
ARG FIJI_VERSION=20240429
ARG CELLPOSE_VERSION=2.2.2
ARG DEVBIO_VERSION=0.10.1
ARG SAMAPI_VERSION=0.4.0
ARG EM_VERSION=0.2.3
ARG EM_VERSION=1.1.0
ARG STARDIST_VERSION=0.8.5
ARG ABBA_VERSION=0.8.0
ARG ABBA_VERSION=0.8.0-01
ARG CELLPROFILER_VERSION=4.2.6
ARG INKSCAPE_VERSION=0.0.1
ARG OMNI_VERSION=1.0.7-dev
ARG OMNI_VERSION=1.0.7-dev2
ARG BRAINRENDER_VERSION=0.0.3

FROM ${ALIAS}biop-qupath:${QUPATH_VERSION} as qupath-image
FROM ${ALIAS}biop-ilastik:${ILASTIK_VERSION} as ilastik-image
Expand All @@ -29,7 +30,8 @@ FROM ${ALIAS}biop-stardist:${STARDIST_VERSION} as stardist-image
FROM ${ALIAS}biop-abba:${ABBA_VERSION} as abba-image
FROM ${ALIAS}biop-cellprofiler:${CELLPROFILER_VERSION} as cellprofiler-image
FROM ${ALIAS}biop-inkscape:${INKSCAPE_VERSION} as inkscape-image
FROm ${ALIAS}biop-omnipose:${OMNI_VERSION} as omnipose-image
FROM ${ALIAS}biop-omni:${OMNI_VERSION} as omnipose-image
FROM ${ALIAS}biop-brainrender:${BRAINRENDER_VERSION} as brainrender-image

FROM ${ALIAS}biop-vnc-base:${BASE_IMAGE} as base

Expand Down Expand Up @@ -163,8 +165,17 @@ COPY fiji/Fiji_setWrappersPaths.groovy /home/biop/tmp/Fiji_setWrappersPaths.groo
RUN chown -R biop:biop /home/biop/tmp \
&& chmod -R a+rwX /home/biop/tmp

# add brainrender-napari env
COPY --from=brainrender-image /opt/conda/envs/brainrender /opt/conda/envs/brainrender

USER biop
RUN /opt/Fiji.app/ImageJ-linux64 --headless --run /home/biop/tmp/Fiji_setWrappersPaths.groovy

# download allen_mouse_25um atlas from brainrender-napari
RUN source activate brainrender \
&& brainglobe install -a allen_mouse_25um \
&& conda deactivate

USER root
RUN rm -rf /home/biop/tmp

Expand Down Expand Up @@ -195,21 +206,6 @@ COPY --from=omnipose-image /opt/conda/envs/omnipose/ /opt/conda/envs/omnipose/
# To make the different conda env available in jupyter
COPY jupyter/kernels/ /home/biop/.local/share/jupyter/kernels/


#################################################################
# # Install OpenCL ( for clij ... )
# Doesn't work (anymore) on local WSL2 but works on runai !!!
# see https://github.com/NVIDIA/nvidia-container-toolkit/issues/371
# We move at the end so that we can build a normal version and WSL one without it, as it is not supported anyway.
RUN apt-get update \
&& apt-get install -y nvidia-opencl-dev \
&& apt remove -y libnvidia-compute-545 \
&& apt-get autoremove --purge \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/* \
&& find /var/log -type f -exec cp /dev/null \{\} \;

#################################################################
# final chown and chmod
RUN chown -R biop:biop /home/biop/ \
Expand Down
4 changes: 2 additions & 2 deletions docker/QuPath/Dockerfile-qupath
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ RUN chown -R biop:biop /opt/QuPath/QuPath_Common_Data_0.5 \
&& chmod -R a+rwx /opt/QuPath/QuPath_Common_Data_0.5

# # TODO : discuss if we prepare unzip from zenodo, or if we update when container start via a git pull ... (less good for reproducibility but better to keep scripts up-to-date)
RUN wget -q https://zenodo.org/records/10869324/files/QuPath_Common_Data_0.5.zip?download=1 -O ${TEMP_DIR}/QuPath_Common_Data_0.5.zip
RUN wget -q https://zenodo.org/records/11091309/files/QuPath_Common_Data_0.5.zip?download=1 -O ${TEMP_DIR}/QuPath_Common_Data_0.5.zip
RUN unzip ${TEMP_DIR}/QuPath_Common_Data_0.5.zip -d /opt/QuPath/QuPath_Common_Data_0.5 \
&& rm ${TEMP_DIR}/QuPath_Common_Data_0.5.zip



# # Prepare to set QP_prefs
COPY QuPath/QuPath_setPaths.groovy /home/biop/tmp/QuPath_setPaths.groovy
Expand Down
27 changes: 25 additions & 2 deletions docker/abba/Dockerfile-abba
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes/rel-23-07.html
#FROM superelastix/elastix:5.0.1 as elastix-image
ARG QUPATH_VERSION=v0.5.1
ARG FIJI_VERSION=20240325
ARG QUPATH_VERSION=v0.5.1-01
ARG FIJI_VERSION=20240429
ARG DEEPSLICE_VERSION=1.1.5
ARG BRAINRENDER_VERSION=0.0.3
ARG ALIAS=biop/

FROM ${ALIAS}biop-qupath:${QUPATH_VERSION} as qupath-image
FROM ${ALIAS}biop-fiji:${FIJI_VERSION} as fiji-image
FROM ${ALIAS}biop-deepslice:${DEEPSLICE_VERSION} as deepslice-image
FROM ${ALIAS}biop-brainrender:${BRAINRENDER_VERSION} as brainrender-image

FROM ${ALIAS}biop-vnc-base:0.0.3 as base

Expand Down Expand Up @@ -137,6 +139,27 @@ RUN printf '[Desktop Entry]\nVersion=0.8.0\nName=ABBA\nGenericName=ABBA\nX-GNOM
RUN chown -R biop:biop /opt/Fiji.app/ \
&& chmod -R a+rwX /opt/Fiji.app/

# install brainrender
COPY --from=brainrender-image /opt/conda/envs/brainrender /opt/conda/envs/brainrender


USER biop

# adds brainrender kernel
RUN source activate brainrender \
&& python -m ipykernel install --user --name brainrender --display-name "Python (brainrender)" \
&& conda deactivate

# download allen_mouse_25um atlas
RUN source activate brainrender \
&& brainglobe install -a allen_mouse_25um \
&& conda deactivate

USER root

RUN chmod -R a+rwX /home/biop/ \
&& chown -R biop:biop /home/biop/

#################################################################
# Container start
USER biop
Expand Down
4 changes: 3 additions & 1 deletion docker/brainrender/Dockerfile-brainrender
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG BASE_IMAGE=0.0.3
ARG BASE_IMAGE=0.1.0
ARG ALIAS=biop/
FROM ${ALIAS}biop-vnc-base:${BASE_IMAGE}

Expand All @@ -13,10 +13,12 @@ RUN conda env update -n brainrender -f /tmp/env_brainrender.yml \

USER biop

# adds brainrender kernel
RUN source activate brainrender \
&& python -m ipykernel install --user --name brainrender --display-name "Python (brainrender)" \
&& conda deactivate

# download allen_mouse_25um atlas
RUN source activate brainrender \
&& brainglobe install -a allen_mouse_25um \
&& conda deactivate
Expand Down
7 changes: 4 additions & 3 deletions docker/brainrender/env_brainrender.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "devbio"
name: "brainrender-napari"
channels:
- conda-forge
dependencies:
Expand All @@ -7,5 +7,6 @@ dependencies:
- pyqt
- pip
- pip :
- brainrender-napari
prefix: "/opt/conda/envs/devbio"
- brainrender-napari==0.0.3
- bg-atlasapi
prefix: "/opt/conda/envs/brainrender-napari"
42 changes: 42 additions & 0 deletions docker/celldetection/Dockerfile-celldetection
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
ARG BASE_IMAGE=0.0.3
ARG ALIAS=biop/


FROM ${ALIAS}biop-vnc-base:${BASE_IMAGE}


USER root

# install celldetection and download models ( https://celldetection.readthedocs.io/en/latest/models.html )
COPY celldetection/env_celldetection.yml /tmp/env_celldetection.yml
RUN conda env update -n celldetection -f /tmp/env_celldetection.yml \
&& conda clean --all -f -y \
&& conda env export -n "biop" \
&& rm /tmp/env_celldetection.yml

# get model
RUN mkdir -p /home/biop/.cache/torch/hub/checkpoints/
RUN wget https://celldetection.org/torch/models/ginoro_CpnResNeXt101UNet-fbe875f1a3e5ce2c.pt -O /home/biop/.cache/torch/hub/checkpoints/ginoro_CpnResNeXt101UNet-fbe875f1a3e5ce2c.pt
RUN wget https://celldetection.org/torch/models/.pt -O /home/biop/.cache/torch/hub/checkpoints/.pt

RUN mkdir -p /home/biop/celldetection/ \
&& chown -R biop:biop /home/biop/ \
&& chmod -R a+rwX /home/biop/

COPY celldetection/start_celldetection.sh /opt/celldetection/start_celldetection.sh
COPY napari/napari-icon.ico /opt/celldetection/napari-icon.ico

RUN printf '[Desktop Entry]\nVersion=0.0.1\nName=celldetection\nGenericName=celldetection\nX-GNOME-FullName=celldetection\nComment=Scientific Image Analysis\nType=Application\nCategories=Education;Science;ImageProcessing;\nExec=/opt/celldetection/start_celldetection.sh\nTryExec==/opt/celldetection/start_celldetection.sh\nTerminal=true\nStartupNotify=true\nMimeType=image/*;\nIcon=/opt/celldetection/napari-icon.ico\nStartupWMClass=celldetection\n' > /home/biop/Desktop/celldetection.desktop \
&& chown -R biop:biop /home/biop \
&& chmod +x /home/biop/Desktop/celldetection.desktop


RUN chmod -R a+rwX /home/biop/ \
&& chown -R biop:biop /home/biop/

#################################################################
# Container start
USER biop
WORKDIR /home/biop
ENTRYPOINT ["/usr/local/bin/jupyter"]
CMD ["lab", "--allow-root", "--ip=*", "--port=8888", "--no-browser", "--NotebookApp.token=''", "--NotebookApp.allow_origin='*'", "--notebook-dir=/home/biop"]
19 changes: 19 additions & 0 deletions docker/celldetection/env_celldetection.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: "celldetection"
channels:
- pytorch
- nvidia
- conda-forge
- defaults
dependencies:
- python=3.9
- pytorch
- pyqt
- napari
- torchvision
- pytorch-cuda=11.8
- pip
- pip :
- celldetection
- git+https://github.com/FZJ-INM1-BDA/celldetection-napari.git
- ipykernel
prefix: "/opt/conda/envs/celldetection"
4 changes: 4 additions & 0 deletions docker/celldetection/start_celldetection.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source activate celldetection
napari
$ read -rsp $'Press enter to continue...\n'
Press enter to continue...
5 changes: 3 additions & 2 deletions docker/empanada/Dockerfile-empanada
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ARG BASE_IMAGE=0.0.1
FROM biop-vnc-base:${BASE_IMAGE}
ARG BASE_IMAGE=0.0.3
ARG ALIAS=biop/
FROM ${ALIAS}biop-vnc-base:${BASE_IMAGE} as base
#ARG DEBIO_VERSION=0.10.1
#FROM biop-devbio:${DEBIO_VERSION} as base

Expand Down
11 changes: 9 additions & 2 deletions docker/empanada/env_empanada-gpu.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
name: "empanada"
channels:
- ome
- conda-forge
- defaults
dependencies:
- python=3.9
- ome::zeroc-ice36-python
- ipykernel
- napari
- conda-forge::omero-py
- pyqt
- pip
- pip:
- napari[all]
- empanada-napari==0.2.3
- empanada-napari==1.1.0
- scikit-image
- napari-ome-zarr
- ome-zarr
- napari-omero
prefix: "/opt/conda/envs/empanada"
#TODO napari-ome-zarr
22 changes: 2 additions & 20 deletions docker/fiji/Dockerfile-fiji
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes/rel-23-07.html
# FROM nvcr.io/nvidia/pytorch:23.07-py3
ARG BASE_IMAGE=0.0.3
ARG BASE_IMAGE=0.1.0
ARG ALIAS=biop/
FROM ${ALIAS}biop-vnc-base:${BASE_IMAGE}

ENV OMEROIJ_VERSION 5.8.3
ENV SOC_VERSION 5.16.0
ENV SOC_VERSION 5.18.0

USER root

Expand Down Expand Up @@ -49,7 +49,6 @@ RUN wget -q https://github.com/ome/omero-insight/releases/download/v${OMEROIJ_VE
&& chmod -R a+rwX /opt/Fiji.app/plugins

# Install simple-omero-client

RUN wget -q https://github.com/GReD-Clermont/simple-omero-client/releases/download/${SOC_VERSION}/simple-omero-client-${SOC_VERSION}.jar -O /opt/Fiji.app/plugins/simple-omero-client-${SOC_VERSION}.jar \
&& chmod -R a+rwX /opt/Fiji.app/plugins

Expand All @@ -65,23 +64,6 @@ RUN wget -q -q https://www.dropbox.com/sh/dxofkiyseuxn4l4/AADrPjPBbJK_77Ai2WCfaO
# [WARNING] Skipping lib/linux64/libjniclij2fftWrapper.so


# OpenCL installation for clij
# specificy version of "nvidia-opencl-dev" , because of the error : ... usr/lib/x86_64-linux-gnu/libnvidia-ml.so.1: file exists: unknown.
# TODOs : find out which version make it crash !!! https://packages.ubuntu.com/search?suite=default&section=all&arch=any&keywords=+nvidia-opencl-dev&searchon=names
# list :
# - jammy (22.04LTS) : 11.5.1-1ubuntu1 , WORKS ! (https://packages.ubuntu.com/jammy/nvidia-opencl-dev)
# - lunar (23.04) : 11.8.89 , try but can't find it (https://packages.ubuntu.com/lunar/nvidia-opencl-dev)
# - mantic (23.10) : 12.0.140, try but can't find it (https://packages.ubuntu.com/mantic/nvidia-opencl-dev)
# >sudo apt-get update returns, jammy-security ... might be why it can't find others (lunar and mantic)
RUN apt-get update \
&& apt-get install -y nvidia-opencl-dev \
&& apt remove -y libnvidia-compute-545 \
&& apt-get autoremove --purge \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/* \
&& find /var/log -type f -exec cp /dev/null \{\} \;

# create icon
RUN mkdir -p /home/biop/Desktop && chown -R biop:biop /home/biop/Desktop \
&& printf '[Desktop Entry]\nVersion=1.0\nName=ImageJ\nGenericName=ImageJ\nX-GNOME-FullName=ImageJ\nComment=Scientific Image Analysis\nType=Application\nCategories=Education;Science;ImageProcessing;\nExec=/opt/Fiji.app/ImageJ-linux64 %F\nTryExec=/opt/Fiji.app/ImageJ-linux64\nTerminal=false\nStartupNotify=true\nMimeType=image/*;\nIcon=/opt/Fiji.app/images/icon.png\nStartupWMClass=net-imagej-launcher-ClassLauncher\n' > /home/biop/Desktop/Fiji.desktop
Expand Down
14 changes: 14 additions & 0 deletions docker/jupyter/kernels/brainrender/kernel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"argv": [
"/opt/conda/envs/brainrender/bin/python",
"-m",
"ipykernel_launcher",
"-f",
"{connection_file}"
],
"display_name": "brainrender",
"language": "python",
"metadata": {
"debugger": true
}
}
Binary file added docker/jupyter/kernels/brainrender/logo-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docker/jupyter/kernels/brainrender/logo-64x64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit e424796

Please sign in to comment.