Skip to content

Commit e6a8ce6

Browse files
authored
Merge pull request #28 from BIOP/on_the_road_to_v0.2.0
On the road to v0.2.0
2 parents d05f024 + 5cae6fa commit e6a8ce6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1734
-487
lines changed

docker/Dockerfile-base

+97-34
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes/rel-23-07.html
22
FROM nvcr.io/nvidia/pytorch:23.07-py3
3+
#FROM nvcr.io/nvidia/pytorch:25.01-py3
4+
5+
USER root
36

47
#################################################################
58
# Install
@@ -23,7 +26,18 @@ RUN apt-get update -y \
2326
emacs \
2427
sudo \
2528
ncdu \
26-
p7zip-full \
29+
p7zip-full \
30+
wget \
31+
bzip2 \
32+
xterm \
33+
# install jdk (for OMERO.insight)
34+
openjdk-11-jdk \
35+
# napari necessary dependencies
36+
&& sudo apt-get install -y libegl1 libdbus-1-3 libxkbcommon-x11-0 \
37+
libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 \
38+
libxcb-render-util0 libxcb-xinerama0 libxcb-xinput0 libxcb-xfixes0 \
39+
x11-utils libxcb-cursor0 libopengl0 \
40+
# cleaning up
2741
&& apt-get autoremove --purge \
2842
&& apt-get clean \
2943
&& rm -rf /var/lib/apt/lists/* \
@@ -67,9 +81,9 @@ COPY --chown=root:root ui.js /opt/noVNC-${novnc_version}/app/ui.js
6781

6882
#################################################################
6983
# Install firefox
70-
RUN wget -q 'https://download.mozilla.org/?product=firefox-latest-ssl&os=linux64' -O /tmp/firefox.tar.bz2 \
71-
&& tar xjf /tmp/firefox.tar.bz2 -C /opt/ \
72-
&& rm -rf /tmp/firefox.tar.bz2 \
84+
RUN wget -q 'https://download.mozilla.org/?product=firefox-latest-ssl&os=linux64' -O /tmp/firefox.tar.xz \
85+
&& tar -xJf /tmp/firefox.tar.xz -C /opt/ \
86+
&& rm -rf /tmp/firefox.tar.xz \
7387
&& ln -sf /opt/firefox/firefox /usr/bin/firefox \
7488
&& apt update \
7589
&& apt install libdbus-glib-1-2 -y \
@@ -80,57 +94,106 @@ RUN wget -q 'https://download.mozilla.org/?product=firefox-latest-ssl&os=linux64
8094
&& find /var/log -type f -exec cp /dev/null \{\} \;
8195
ENV BROWSER=firefox
8296

83-
# Install miniconda
84-
ENV CONDA_DIR /opt/conda
85-
RUN wget -q https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh \
86-
&& /bin/bash ~/miniconda.sh -b -p /opt/conda
97+
#################################################################
98+
# Replace conda with miniforge
8799
#Put conda in path so we can use conda activate
88-
ENV PATH=$PATH:$CONDA_DIR/bin
89-
90-
# Because I coulnd't get mamba to work, changethe libserver , thanks @oli ! ;)
91-
# https://www.anaconda.com/blog/a-faster-conda-for-a-growing-community
92-
RUN conda update -n base conda \
93-
&& conda install -n base conda-libmamba-solver \
94-
&& conda config --set solver libmamba
100+
ENV PATH=$PATH:/opt/conda/bin
101+
RUN wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh \
102+
&& bash Miniforge3-Linux-x86_64.sh -b -p /opt/conda \
103+
&& rm Miniforge3-Linux-x86_64.sh \
104+
&& conda init
95105

96-
97-
# create shortcut to start jupyter lab
98-
RUN mkdir /opt/jupyter
99-
COPY jupyter/start_jupyter.sh /opt/jupyter/start_jupyter.sh
100-
COPY jupyter/jupyter_.png /opt/jupyter/jupyter.png
101-
102-
RUN chmod +x /opt/jupyter/start_jupyter.sh \
103-
&& chown -R biop:biop /opt/jupyter/
104-
105-
RUN mkdir -p /home/biop/Desktop && chown -R biop:biop /home/biop/Desktop \
106-
&& printf '[Desktop Entry]\nVersion=4.2.6\nName=jupyter\nGenericName=jupyter\nX-GNOME-FullName=jupyter\nComment=Scientific Image Analysis\nType=Application\nCategories=Education;Science;ImageProcessing;\nExec=/opt/jupyter/start_jupyter.sh\nTryExec=/opt/jupyter/start_jupyter.sh\nTerminal=true\nStartupNotify=true\nIcon=/opt/jupyter/jupyter.png\nStartupWMClass=jupyter\n' > /home/biop/Desktop/jupyter.desktop \
107-
&& chown -R biop:biop /home/biop \
108-
&& chmod -R a+rwx /home/biop/
106+
#################################################################
107+
# Install VScode
108+
RUN wget https://go.microsoft.com/fwlink/?LinkID=760868 -O /tmp/vscode.deb \
109+
&& apt install -y /tmp/vscode.deb \
110+
&& rm /tmp/vscode.deb
109111

110112
#################################################################
111-
# Install Inkscape
113+
# Install latest Inkscape stable version
112114
RUN sudo apt-get update -y \
115+
&& sudo apt-get install software-properties-common -y \
116+
&& sudo apt-get update -y \
117+
&& sudo add-apt-repository ppa:inkscape.dev/stable -y \
118+
&& sudo apt-get update -y \
113119
&& sudo apt-get install inkscape -y
114120

121+
#################################################################
122+
# Install OMERO.insight standalone
123+
RUN wget -q https://github.com/ome/omero-insight/releases/download/v5.8.6/OMERO.insight-5.8.6.zip \
124+
&& unzip OMERO.insight-5.8.6.zip -d /opt/OMERO.insight \
125+
&& rm OMERO.insight-5.8.6.zip
126+
# to have OMERO EPFL pre-configured
127+
COPY omero-insight/container.xml /opt/OMERO.insight/OMERO.insight-5.8.6/config/container.xml
115128

116129
#################################################################
117-
# OpenCL for clij ...
130+
# # OpenCL for clij ...
118131
RUN apt-get update \
119132
&& apt-get install -y nvidia-opencl-dev \
120-
&& apt remove -y libnvidia-compute-550-server \
133+
&& apt remove -y libnvidia-compute-570-server \
121134
&& apt-get autoremove --purge \
122135
&& apt-get clean \
123136
&& rm -rf /var/lib/apt/lists/* \
124137
&& rm -rf /tmp/* \
125138
&& find /var/log -type f -exec cp /dev/null \{\} \;
126139

140+
# # Load preferences for firefox, removing GPU acceleration
141+
# USER biop
142+
# #################################################################
143+
# # Copy custom pref.js into the Firefox profile
144+
# COPY mozilla/prefs.js /home/biop/prefs.js
145+
146+
# #################################################################
147+
# # Start Firefox once in headless mode to generate profile directory
148+
# RUN firefox --headless --no-remote --setDefaultBrowser & sleep 5 \
149+
# && pkill firefox \
150+
# #################################################################
151+
# # Find the dynamically created profile folder and copy the custom pref.js into it
152+
# && PROFILE_DIR=$(find /home/biop/.mozilla/firefox -type d -name "*.default-release") \
153+
# && mv /home/biop/prefs.js $PROFILE_DIR/prefs.js
154+
# USER root
155+
156+
#################################################################
157+
# # Install miniconda
158+
# ENV CONDA_DIR=/opt/conda
159+
# RUN wget -q https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh \
160+
# && /bin/bash ~/miniconda.sh -b -p /opt/conda
161+
# #Put conda in path so we can use conda activate
162+
# ENV PATH=$PATH:$CONDA_DIR/bin
163+
164+
# TODO : remove this part as conda should have mamba solver by default (https://conda.org/blog/2023-11-06-conda-23-10-0-release/)
165+
# Because I coulnd't get mamba to work, changethe libserver , thanks @oli ! ;)
166+
# https://www.anaconda.com/blog/a-faster-conda-for-a-growing-community
167+
# RUN conda update -n base conda \
168+
# && conda install -n base conda-libmamba-solver\
169+
# && conda config --set solver libmamba
170+
171+
#################################################################
172+
# All icons and *.sh file for the desktop will now be in /opt/icons
173+
RUN mkdir -p /home/biop/Desktop \
174+
&& mkdir /opt/icons
175+
COPY icons/* /opt/icons/
176+
177+
#################################################################
178+
# Create shortcuts
179+
# to start jupyter lab
180+
RUN printf 'jupyter lab\n\$ read -rsp \$"Press enter to continue..."\nPress enter to continue...' > /opt/icons/start_jupyter.sh \
181+
&& printf '[Desktop Entry]\nVersion=3.6.8\nName=jupyter\nGenericName=jupyter\nX-GNOME-FullName=jupyter\nComment=Scientific Image Analysis\nType=Application\nCategories=Education;Science;ImageProcessing;\nExec=/opt/icons/start_jupyter.sh\nTryExec=/opt/icons/start_jupyter.sh\nTerminal=true\nStartupNotify=false\nIcon=/opt/icons/jupyter.png\nStartupWMClass=jupyter\n' > /home/biop/Desktop/jupyter.desktop \
182+
# to start omero.insight
183+
&& printf '#!/bin/bash\n# Navigate to the directory containing the OMERO.insight binary\ncd /opt/OMERO.insight/OMERO.insight-5.8.6/bin\n# Execute the OMERO.insight application\n./omero-insight\n' > /opt/icons/start_omero.sh \
184+
&& printf '[Desktop Entry]\nVersion=5.8.6\nName=OMERO Insight\nGenericName=OMERO Insight\nComment=Scientific Image Analysis\nType=Application\nCategories=Education;Science;ImageProcessing;\nExec=/opt/icons/start_omero.sh\nTryExec=/opt/icons/start_omero.sh\nTerminal=false\nStartupNotify=true\nMimeType=image/*;\nIcon=/opt/icons/omero.png\n' > /home/biop/Desktop/omero.desktop \
185+
# to start VScode
186+
&& printf 'yes | code' > /opt/icons/start_vscode.sh \
187+
&& printf '[Desktop Entry]\nVersion=1.98.2\nName=VScode\nGenericName=VScode\nX-GNOME-FullName=VScode\nComment=Scientific Image Analysis\nType=Application\nCategories=Education;Science;ImageProcessing;\nExec=/opt/icons/start_vscode.sh\nTryExec=/opt/icons/start_vscode.sh\nTerminal=false\nStartupNotify=true\nIcon=/opt/icons/vscode.png\n' > /home/biop/Desktop/vscode.desktop
188+
127189
#################################################################
128-
RUN chown -R biop:biop /home/biop/ \
129-
&& chmod -R a+rwx /home/biop/
190+
RUN chown -R biop:biop /home/biop/ /opt/icons/ /opt/OMERO.insight /usr/lib/jvm/java-11-openjdk-amd64 \
191+
&& chmod -R a+rwx /home/biop/ /opt/icons/ /opt/OMERO.insight /usr/lib/jvm/java-11-openjdk-amd64
130192

131193
#################################################################
132194
# Container start
133195
USER biop
196+
RUN conda init
134197
WORKDIR /home/biop
135198
ENTRYPOINT ["/usr/local/bin/jupyter"]
136-
CMD ["lab", "--allow-root", "--ip=*", "--port=8888", "--no-browser", "--NotebookApp.token=''", "--NotebookApp.allow_origin='*'", "--notebook-dir=/home/biop"]
199+
CMD ["lab", "--allow-root", "--ip=*", "--port=8888", "--no-browser", "--NotebookApp.token=''", "--NotebookApp.allow_origin='*'", "--notebook-dir=/home/biop"]

0 commit comments

Comments
 (0)