diff --git a/docker/Dockerfile b/docker/Dockerfile index 2a7de3625114b87f9fb0432325689bb046d67f94..c3754230633fa3f421619e7afa10fc7e6a34e6e7 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,16 +1,18 @@ # base image -ARG PYTHON_VERSION=3.8 +ARG PYTHON_VERSION=3.9 ARG docker_image_base=python:${PYTHON_VERSION}-slim FROM ${docker_image_base} # maintainers -LABEL maintainer1=soraya.arias@inria.fr maintainer2=achille.mbogol-touye@grenoble-inp.fr +LABEL maintainer1=soraya.arias@inria.fr maintainer2=jean-luc.parouty@simap.grenoble-inp.fr + +ARG ARCH_VERSION=cpu # Ensure a sane environment ENV TZ=Europe/Paris LANG=C.UTF-8 LC_ALL=C.UTF-8 DEBIAN_FRONTEND=noninteractive RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && \ apt update --fix-missing && \ - apt install -y --no-install-recommends apt-utils vim \ + apt install -y --no-install-recommends apt-utils \ python3-venv \ python3-pip && \ apt -y dist-upgrade && \ @@ -18,31 +20,34 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone & rm -fr /var/lib/apt/lists/* # copy Python requirement packages list in docker image -COPY requirements_packages.txt /root/requirements_packages.txt +COPY requirements_packages_${ARCH_VERSION}.txt /root/requirements_packages_${ARCH_VERSION}.txt # Update Python tools and install requirements packages RUN python3 -m pip install --upgrade pip && \ - pip install --no-cache-dir --upgrade -r /root/requirements_packages.txt + pip3 install --no-cache-dir --upgrade -r /root/requirements_packages_${ARCH_VERSION}.txt +# Special case to deal with keras_cv and keras3 ! +RUN pip3 install --no-cache-dir --upgrade keras-cv tensorflow && \ + pip3 install --no-cache-dir --upgrade keras -# install tensorboard & update jypyter -RUN pip install --no-cache-dir --upgrade tensorboard tensorboardX jupyter ipywidgets +# Install tensorboard & update jupyter +RUN pip3 install --no-cache-dir --upgrade tensorboard tensorboardX jupyter ipywidgets -# move default logo python +# Move default logo python RUN bin/rm /usr/local/share/jupyter/kernels/python3/logo* # Change default logo and name kernels COPY images/env-fidle.png /usr/local/share/jupyter/kernels/python3/logo-64x64.png COPY images/env-fidle.svg /usr/local/share/jupyter/kernels/python3/logo-svg.svg - # Get Fidle datasets RUN mkdir /data && \ fid install_datasets --quiet --install_dir /data -# Get Fidle notebooks +# Get Fidle notebooks and create link RUN mkdir /notebooks/ && \ - fid install_notebooks --quiet --install_dir /notebooks + fid install_notebooks --notebooks fidle-pre-master --quiet --install_dir /notebooks && \ + ln -s /notebooks/fidle-pre-master-3.0.0 /notebooks/fidle-master # Add Jupyter configuration (no browser, listen all interfaces, ...) COPY jupyter_lab_config.py /root/.jupyter/jupyter_lab_config.py @@ -58,7 +63,8 @@ VOLUME /notebooks WORKDIR /notebooks # Set a folder in the volume as Python Path -ENV PYTHONPATH=/notebooks/fidle-master-2.4.1/:$PYTHONPATH +ENV KERAS_BACKEND torch +ENV PYTHONPATH=/notebooks/fidle-master/:$PYTHONPATH # Force bash as the default shell (useful in the notebooks) ENV SHELL=/bin/bash @@ -67,4 +73,4 @@ ENV SHELL=/bin/bash ENV FIDLE_DATASETS_DIR=/data/datasets-fidle # Run a notebook by default -CMD ["jupyter", "lab"] +CMD ["jupyter", "lab"] \ No newline at end of file diff --git a/docker/jupyter_lab_config.py b/docker/jupyter_lab_config.py index f49470e62f8d53eff37fcffc5ee063a25718396e..688c382b87a379c8c7670d9c71c246d60307973f 100644 --- a/docker/jupyter_lab_config.py +++ b/docker/jupyter_lab_config.py @@ -903,11 +903,11 @@ c.ServerApp.quit_button = True import os -os.environ['FIDLE_MASTER_VERSION'] = '2.4.1' +#os.environ['FIDLE_MASTER_VERSION'] = '2.4.1' -fidle_master_version = os.environ.get('FIDLE_MASTER_VERSION') +#fidle_master_version = os.environ.get('FIDLE_MASTER_VERSION') -c.ServerApp.root_dir = f'/notebooks/fidle-master-{fidle_master_version}' +c.ServerApp.root_dir = f'/notebooks/fidle-master' ## The session manager class to use. # Default: 'jupyter_server.services.sessions.sessionmanager.SessionManager' diff --git a/docker/requirements_packages.txt b/docker/requirements_packages_cpu.txt similarity index 87% rename from docker/requirements_packages.txt rename to docker/requirements_packages_cpu.txt index 64bcfca315259f6efcc23205d7a54a80143d2c18..1161e9414d1140ea1b0b6ab886f3f19ee8a335e1 100644 --- a/docker/requirements_packages.txt +++ b/docker/requirements_packages_cpu.txt @@ -11,20 +11,25 @@ # To install your Fidle env, see https://fidle.cnrs.fr/installation # # Keras 3 / PyTorch version (Python 3.9.2) +# keras +# keras_cv - keras + + --extra-index-url https://download.pytorch.org/whl/cpu torch torchvision torchaudio + lightning tensorboard + numpy Scikit-image Scikit-learn Matplotlib plotly barviz - numpy + pyarrow Pandas Pandoc pyyaml Jupyterlab - fidle \ No newline at end of file + fidle