Skip to content
Snippets Groups Projects
Commit 025caea4 authored by EXT Soraya Arias's avatar EXT Soraya Arias
Browse files

Modif to include fidle datasets + test scripts + jupytrerlab config settings

parent 80b39224
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python3
## Some tests to check fidle installation is ok
##
import tensorflow as tf
import sys, os
# Check data set is found
datasets_dir = os.getenv('FIDLE_DATASETS_DIR', False)
if datasets_dir is False:
print("FIDLE_DATASETS_DIR not found - Should be /data/fidle_datasets/")
sys.exit(1)
print("FIDLE_DATASETS_DIR = ", os.path.expanduser(datasets_dir))
# Check Python version
print("Python version = {}.{}".format(sys.version_info[0], sys.version_info[1]))
# Check tensorflow version
print("Tensorflow version = ", tf.__version__)
sys.exit(0)
FROM python:3.7-slim
#
#
ARG PYTHON_VERSION=3.7
ARG docker_image_base=python:${PYTHON_VERSION}-slim
FROM ${docker_image_base}
MAINTAINER soraya.arias@inria.fr
LABEL maintainer=soraya.arias@inria.fr
# Ensure a sane environment
......@@ -11,6 +17,7 @@ RUN apt update --fix-missing && \
apt clean && \
rm -fr /var/lib/apt/lists/*
# Get Python requirement packages list
COPY requirements.txt /root/requirements.txt
# Add & Update Python tools and install requirements packages
......@@ -18,27 +25,34 @@ RUN pip install --upgrade pip && \
pip install -I --upgrade setuptools && \
pip install -r /root/requirements.txt
# Get Fidle datasets
RUN mkdir /data && \
wget -c https://fidle.cnrs.fr/fidle-datasets.tar && tar -xf fidle-datasets.tar -C /data/ && \
rm fidle-datasets.tar
# Notebooks as a volume
RUN mkdir /notebooks/; cd /notebooks && \
git clone https://gricad-gitlab.univ-grenoble-alpes.fr/talks/fidle.git
# Add Jupyter configuration (no browser, listen all interfaces, ...)
COPY jupyter_notebook_config.py /root/.jupyter/jupyter_notebook_config.py
#COPY jupyter_notebook_config.py /root/.jupyter/jupyter_notebook_config.py
COPY notebook.json /root/.jupyter/nbconfig/notebook.json
COPY fidle_env_test.py /root/fidle_env_test.py
# Notebooks as a volume
RUN mkdir /notebooks/; cd /notebooks && \
git clone https://gricad-gitlab.univ-grenoble-alpes.fr/talks/fidle.git
# Jupyter notebook uses 8888
EXPOSE 8888
VOLUME /notebooks
WORKDIR /notebooks
#COPY data/fidle-datasets /data
# Set a folder in the volume as Python Path
ENV PYTHONPATH=/notebooks/python_path:$PYTHONPATH
ENV PYTHONPATH=/notebooks/fidle/:$PYTHONPATH
# Force bash as the default shell (useful in the notebooks)
ENV SHELL=/bin/bash
# Set Fidle dataset directory variable
ENV FIDLE_DATASETS_DIR=/data
ENV FIDLE_DATASETS_DIR=/data/fidle-datasets
# Run a notebook by default
CMD ["jupyter", "notebook", "--port=8888", "--ip=0.0.0.0"]
CMD ["jupyter", "notebook", "--port=8888", "--ip=*", "--allow-root", "--notebook-dir=/notebooks/fidle", "--no-browser"]
......@@ -15,23 +15,23 @@ c.Application.log_level = 'INFO'
c.NotebookApp.ip = '*'
# Password to access the server
c.NotebookApp.password = ''
c.NotebookApp.allow_password_change = False
c.Notebook.password = ''
c.Notebook.allow_password_change = False
## The directory to use for notebooks and kernels.
c.NotebookApp.notebook_dir = '/notebooks'
c.NotebookApp.notebook_dir = '/notebooks/fidle'
## Whether to open in a browser after starting. The specific browser used is
# platform dependent and determined by the python standard library `webbrowser`
# module, unless it is overridden using the --browser (NotebookApp.browser)
# configuration option.
c.NotebookApp.open_browser = False
c.NotebookApp.open_browser = True
## The port the notebook server will listen on.
c.NotebookApp.port = 8888
c.Notebook.port = 8888
## Allow running as root
c.NotebookApp.allow_root = True
c.Notebook.allow_root = True
## Disable the "Quit" button on the Web UI (shuts down the server)
c.NotebookApp.quit_button = False
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment