From 909a695d3129df3afebaee9291741f7ad2de645a Mon Sep 17 00:00:00 2001 From: dionperd Date: Thu, 21 Sep 2023 20:47:19 +0200 Subject: [PATCH] Removed hbp_deploy --- docker/hbp_deploy/Dockerfile | 129 ----- docker/hbp_deploy/Dockerfile-dev-branch | 129 ----- docker/hbp_deploy/Dockerfile-nest2 | 151 ------ docker/hbp_deploy/Jenkinsfile-dev-branch | 45 -- docker/hbp_deploy/Jenkinsfile-master-branch | 45 -- .../hbp_deploy/jupyterhub-deployer-nest2.json | 508 ------------------ docker/hbp_deploy/jupyterhub-deployer.json | 508 ------------------ docker/hbp_deploy/jupyterhub_config.py | 37 -- 8 files changed, 1552 deletions(-) delete mode 100644 docker/hbp_deploy/Dockerfile delete mode 100644 docker/hbp_deploy/Dockerfile-dev-branch delete mode 100644 docker/hbp_deploy/Dockerfile-nest2 delete mode 100644 docker/hbp_deploy/Jenkinsfile-dev-branch delete mode 100644 docker/hbp_deploy/Jenkinsfile-master-branch delete mode 100644 docker/hbp_deploy/jupyterhub-deployer-nest2.json delete mode 100644 docker/hbp_deploy/jupyterhub-deployer.json delete mode 100644 docker/hbp_deploy/jupyterhub_config.py diff --git a/docker/hbp_deploy/Dockerfile b/docker/hbp_deploy/Dockerfile deleted file mode 100644 index f8542838d..000000000 --- a/docker/hbp_deploy/Dockerfile +++ /dev/null @@ -1,129 +0,0 @@ -# -# TVB & NEST simulations environment for OpenShift -# -# Prepare conda env, install NEST, then tvb-library from Pypi -# Finally tvb-multiscale from Github sources -# - -FROM jupyter/minimal-notebook:2022-02-17 -MAINTAINER lia.domide@codemart.ro - -ENV LANG=C.UTF-8 - -USER root -RUN apt-get update; apt-get install -y build-essential cmake git vim octave wget \ - libltdl7-dev libreadline6-dev libncurses5-dev libgsl0-dev openmpi-bin libopenmpi-dev \ - zip unzip; \ - apt-get clean - -USER $NB_UID -RUN mkdir -m777 $HOME/packages - -# Create a dedicated Python env for working in it -RUN conda create -y --name env_nest setuptools cython h5py python=3.9 -RUN conda install -y --name env_nest pandas pytest pytest-cov pytest-benchmark sqlalchemy -RUN conda install -y --name env_nest numba matplotlib -RUN /opt/conda/envs/env_nest/bin/pip install --upgrade pip -RUN /opt/conda/envs/env_nest/bin/pip install xarray oct2py elephant scikit-learn scipy - -WORKDIR $HOME/packages -RUN wget https://zenodo.org/record/3688773/files/tvb-data.zip?download=1 -O tvb_data.zip; \ - mkdir tvb_data; unzip tvb_data.zip -d tvb_data; rm tvb_data.zip; \ - cd tvb_data; \ - /opt/conda/envs/env_nest/bin/python setup.py develop - -# Install NEST3, specific dev version (October 2020) -ENV NEST_SHA=c545255f7252308d6e73a851ddeece4f2dffc812 -ENV NEST=nest-simulator -ENV NEST_SRC=$HOME/packages/$NEST - -USER root -ARG NEST_BRANCH=master -RUN git clone --depth 1 --branch $NEST_BRANCH https://github.com/nest/nest-simulator.git -RUN cd $NEST; \ - git fetch origin && git checkout $NEST_SHA && cd ..; \ - source activate env_nest && cmake $NEST_SRC; \ - make; make install - -USER $NB_UID -ARG TVB_BRANCH=master -RUN git clone --depth 1 --branch $TVB_BRANCH https://github.com/the-virtual-brain/tvb-root.git -ARG LAST_SHA_TVB=LATEST -RUN cd tvb-root; \ - git pull;\ - cd tvb_library; \ - /opt/conda/envs/env_nest/bin/python setup.py develop; \ - cd ../tvb_framework; \ - /opt/conda/envs/env_nest/bin/python setup.py develop; \ - cd ../tvb_contrib; \ - /opt/conda/envs/env_nest/bin/python setup.py develop; - -# Install extra tvb-multiscale packages: - -RUN git clone --depth 1 https://github.com/mariomulansky/PySpike.git; \ - cd PySpike; \ - /opt/conda/envs/env_nest/bin/python setup.py build_ext install - -RUN /opt/conda/envs/env_nest/bin/pip install elephant dill - -# TVB-NETPYNE: -RUN /opt/conda/envs/env_nest/bin/pip install netpyne neuron - -# TVB-ANNARCHY: -RUN /opt/conda/envs/env_nest/bin/pip install sympy pyqtgraph lxml pandoc tensorboardX; -RUN /opt/conda/envs/env_nest/bin/pip install ANNarchy; - -ARG MULTISCALE_BRANCH=master -RUN git clone --depth 1 --branch $MULTISCALE_BRANCH https://github.com/the-virtual-brain/tvb-multiscale.git -ARG LAST_SHA_MULTISCALE=LATEST -RUN cd tvb-multiscale; \ - git pull; \ - /opt/conda/envs/env_nest/bin/python setup.py develop --no-deps; - -# Compile tvb-netpyne .mod files -RUN cd tvb-multiscale; \ - /opt/conda/envs/env_nest/bin/nrnivmodl tvb_multiscale/tvb_netpyne/netpyne/mod; - -RUN mkdir -p -m777 /home/jovyan/.tvb-temp /home/jovyan/.local -RUN mkdir -p -m777 /home/jovyan/.local/share -RUN mkdir -p -m777 /home/jovyan/.local/share/jupyter -RUN mkdir -p -m777 /home/jovyan/.local/share/jupyter/runtime - -WORKDIR $HOME - -## Install local tvb-multiscale: -ENV MYMODULES_DIR=$HOME/packages/tvb-multiscale/tvb_multiscale/tvb_nest/nest/modules -ENV MYMODULES_BLD_DIR=$HOME/packages/nest_modules_builds -RUN cp -r ${MYMODULES_DIR} ${MYMODULES_BLD_DIR} - -ARG WORK_DIR=/home/jovyan/packages/notebooks -ARG TVB_NEST_Examples=/home/jovyan/packages/notebooks/TVB-Multiscale-Examples - -RUN mkdir -m777 $WORK_DIR -RUN mkdir -m777 $TVB_NEST_Examples -RUN cp -r /home/jovyan/packages/tvb-multiscale/docs/notebooks $TVB_NEST_Examples -RUN cp -r /home/jovyan/packages/tvb-multiscale/examples $TVB_NEST_Examples -RUN chmod -R 777 $WORK_DIR -RUN chmod -R 777 $TVB_NEST_Examples -RUN chmod -R 777 /home/jovyan/packages/tvb-multiscale/examples/tvb_nest -RUN chown -R jovyan: $TVB_NEST_Examples -RUN chown -R jovyan: /home/jovyan/packages/tvb-multiscale/examples/tvb_nest - -USER root -RUN chmod -R 777 /home/jovyan/.jupyter -RUN chown -R jovyan: /home/jovyan/.jupyter -USER $NB_UID - -# Extend the output data rate limit for all images to be loaded in the notebooks -#RUN echo "c.NotebookApp.iopub_data_rate_limit = 10000000" >> /etc/jupyter/jupyter_notebook_config.py -#RUN echo "c.NotebookApp.trust_xheaders = True" >> /etc/jupyter/jupyter_notebook_config.py - -RUN /opt/conda/envs/env_nest/bin/python -m ipykernel install --user - -# Necessary only because they are retrieved in tvb-multiscale code -ENV NEST_INSTALL_DIR=/opt/conda/envs/env_nest -ENV NEST_PYTHON_PREFIX=${NEST_INSTALL_DIR}/lib/python3.10/site-packages - -WORKDIR $WORK_DIR - -# CMD is defined in the base image: jupyter/minimal-notebook \ No newline at end of file diff --git a/docker/hbp_deploy/Dockerfile-dev-branch b/docker/hbp_deploy/Dockerfile-dev-branch deleted file mode 100644 index a677fc77e..000000000 --- a/docker/hbp_deploy/Dockerfile-dev-branch +++ /dev/null @@ -1,129 +0,0 @@ -# -# TVB & NEST simulations environment for OpenShift -# -# Prepare conda env, install NEST, then tvb-library from Pypi -# Finally tvb-multiscale from Github sources -# - -FROM jupyter/minimal-notebook:2022-02-17 -MAINTAINER paula.prodan@codemart.ro - -ENV LANG=C.UTF-8 - -USER root -RUN apt-get update; apt-get install -y build-essential cmake git vim octave wget \ - libltdl7-dev libreadline6-dev libncurses5-dev libgsl0-dev openmpi-bin libopenmpi-dev \ - zip unzip; \ - apt-get clean - -USER $NB_UID -RUN mkdir -m777 $HOME/packages - -# Create a dedicated Python env for working in it -RUN conda create -y --name env_nest setuptools cython h5py python=3.9 -RUN conda install -y --name env_nest pandas pytest pytest-cov pytest-benchmark sqlalchemy -RUN conda install -y --name env_nest numba matplotlib -RUN /opt/conda/envs/env_nest/bin/pip install --upgrade pip -RUN /opt/conda/envs/env_nest/bin/pip install xarray oct2py elephant scikit-learn scipy - -WORKDIR $HOME/packages -RUN wget https://zenodo.org/record/3688773/files/tvb-data.zip?download=1 -O tvb_data.zip; \ - mkdir tvb_data; unzip tvb_data.zip -d tvb_data; rm tvb_data.zip; \ - cd tvb_data; \ - /opt/conda/envs/env_nest/bin/python setup.py develop - -# Install NEST3, specific dev version (October 2020) -ENV NEST_SHA=c545255f7252308d6e73a851ddeece4f2dffc812 -ENV NEST=nest-simulator -ENV NEST_SRC=$HOME/packages/$NEST - -USER root -ARG NEST_BRANCH=master -RUN git clone --depth 1 --branch $NEST_BRANCH https://github.com/nest/nest-simulator.git -RUN cd $NEST; \ - git fetch origin && git checkout $NEST_SHA && cd ..; \ - source activate env_nest && cmake $NEST_SRC; \ - make; make install - -USER $NB_UID -ARG TVB_BRANCH=master -RUN git clone --depth 1 --branch $TVB_BRANCH https://github.com/the-virtual-brain/tvb-root.git -ARG LAST_SHA_TVB=LATEST -RUN cd tvb-root; \ - git pull;\ - cd tvb_library; \ - /opt/conda/envs/env_nest/bin/python setup.py develop; \ - cd ../tvb_framework; \ - /opt/conda/envs/env_nest/bin/python setup.py develop; \ - cd ../tvb_contrib; \ - /opt/conda/envs/env_nest/bin/python setup.py develop; - -# Install extra tvb-multiscale packages: - -RUN git clone --depth 1 https://github.com/mariomulansky/PySpike.git; \ - cd PySpike; \ - /opt/conda/envs/env_nest/bin/python setup.py build_ext install - -RUN /opt/conda/envs/env_nest/bin/pip install elephant dill - -# TVB-NETPYNE: -RUN /opt/conda/envs/env_nest/bin/pip install netpyne neuron - -# TVB-ANNARCHY: -RUN /opt/conda/envs/env_nest/bin/pip install sympy pyqtgraph lxml pandoc tensorboardX; -RUN /opt/conda/envs/env_nest/bin/pip install ANNarchy; - -ARG MULTISCALE_BRANCH=dev -RUN git clone --depth 1 --branch $MULTISCALE_BRANCH https://github.com/the-virtual-brain/tvb-multiscale.git -ARG LAST_SHA_MULTISCALE=LATEST -RUN cd tvb-multiscale; \ - git pull; \ - /opt/conda/envs/env_nest/bin/python setup.py develop --no-deps; - -# Compile tvb-netpyne .mod files -RUN cd tvb-multiscale; \ - /opt/conda/envs/env_nest/bin/nrnivmodl tvb_multiscale/tvb_netpyne/netpyne/mod; - -RUN mkdir -p -m777 /home/jovyan/.tvb-temp /home/jovyan/.local -RUN mkdir -p -m777 /home/jovyan/.local/share -RUN mkdir -p -m777 /home/jovyan/.local/share/jupyter -RUN mkdir -p -m777 /home/jovyan/.local/share/jupyter/runtime - -WORKDIR $HOME - -## Install local tvb-multiscale: -ENV MYMODULES_DIR=$HOME/packages/tvb-multiscale/tvb_multiscale/tvb_nest/nest/modules -ENV MYMODULES_BLD_DIR=$HOME/packages/nest_modules_builds -RUN cp -r ${MYMODULES_DIR} ${MYMODULES_BLD_DIR} - -ARG WORK_DIR=/home/jovyan/packages/notebooks -ARG TVB_NEST_Examples=/home/jovyan/packages/notebooks/TVB-Multiscale-Examples - -RUN mkdir -m777 $WORK_DIR -RUN mkdir -m777 $TVB_NEST_Examples -RUN cp -r /home/jovyan/packages/tvb-multiscale/docs/notebooks $TVB_NEST_Examples -RUN cp -r /home/jovyan/packages/tvb-multiscale/examples $TVB_NEST_Examples -RUN chmod -R 777 $WORK_DIR -RUN chmod -R 777 $TVB_NEST_Examples -RUN chmod -R 777 /home/jovyan/packages/tvb-multiscale/examples/tvb_nest -RUN chown -R jovyan: $TVB_NEST_Examples -RUN chown -R jovyan: /home/jovyan/packages/tvb-multiscale/examples/tvb_nest - -USER root -RUN chmod -R 777 /home/jovyan/.jupyter -RUN chown -R jovyan: /home/jovyan/.jupyter -USER $NB_UID - -# Extend the output data rate limit for all images to be loaded in the notebooks -#RUN echo "c.NotebookApp.iopub_data_rate_limit = 10000000" >> /etc/jupyter/jupyter_notebook_config.py -#RUN echo "c.NotebookApp.trust_xheaders = True" >> /etc/jupyter/jupyter_notebook_config.py - -RUN /opt/conda/envs/env_nest/bin/python -m ipykernel install --user - -# Necessary only because they are retrieved in tvb-multiscale code -ENV NEST_INSTALL_DIR=/opt/conda/envs/env_nest -ENV NEST_PYTHON_PREFIX=${NEST_INSTALL_DIR}/lib/python3.10/site-packages - -WORKDIR $WORK_DIR - -# CMD is defined in the base image: jupyter/minimal-notebook \ No newline at end of file diff --git a/docker/hbp_deploy/Dockerfile-nest2 b/docker/hbp_deploy/Dockerfile-nest2 deleted file mode 100644 index c0b22c231..000000000 --- a/docker/hbp_deploy/Dockerfile-nest2 +++ /dev/null @@ -1,151 +0,0 @@ -# -# TVB & NEST simulations environment -# -# Prepare conda env, install NEST, then tvb-library from Pypi -# Finally link tvb-scripts and tvb-nest from Github sources -# - -FROM jupyter/minimal-notebook -MAINTAINER lia.domide@codemart.ro - -ENV DEBIAN_FRONTEND noninteractive -ENV LANG=C.UTF-8 - -USER root -RUN apt-get update; apt-get install -y automake libtool build-essential git vim octave \ - wget python3.7 libpython3.7 libpython3-dev libncurses5-dev libreadline-dev libgsl0-dev cython3 \ - python3.7-dev python3-pip python3-numpy python3-scipy python3-matplotlib python3-nose \ - ipython3 python3-venv python-virtualenv python3-pyqt5 python3-dev libgsl-dev libncurses-dev \ - subversion cmake zip unzip; \ - apt-get clean - -RUN wget -q http://www.mpich.org/static/downloads/3.1.4/mpich-3.1.4.tar.gz \ - && tar xf mpich-3.1.4.tar.gz \ - && cd mpich-3.1.4 \ - && ./configure --disable-fortran --enable-fast=all,O3 --prefix=/usr \ - && make -j$(nproc) \ - && make install \ - && ldconfig \ - && cd .. \ - && rm -rf mpich-3.1.4 \ - && rm mpich-3.1.4.tar.gz - -RUN mkdir -m777 $HOME/env; mkdir -m777 $HOME/packages - -USER $NB_UID -# Create a dedicated Python env for working in it -ENV VENV=$HOME/env/neurosci -ENV CONDAENV_NAME nestenv -ENV CONDAENV /opt/conda/envs/nestenv -ENV CONDAENV_PYTHON /opt/conda/envs/nestenv/bin/python -ENV CONDAENV_PIP /opt/conda/envs/nestenv/bin/pip - -RUN conda create -n $CONDAENV_NAME python=3 -RUN conda install --name $CONDAENV_NAME cython setuptools -RUN $CONDAENV_PIP install parameters quantities neo "django<1.9" django-tagging future hgapi gitpython sumatra nixio -RUN $CONDAENV_PIP install --upgrade nose ipython -# django<1.9 is needed for pynest - september 2019 - NEST 2.18 - -# Install from sources libneurosim (NEST boost dependency) -WORKDIR $HOME/packages -RUN git clone --depth 1 https://github.com/INCF/libneurosim.git; \ - cd libneurosim; ./autogen.sh; \ - mkdir $VENV/build -WORKDIR $VENV/build -RUN mkdir libneurosim; \ - cd libneurosim; \ - PYTHON=$CONDAENV_PYTHON $HOME/packages/libneurosim/configure --prefix=$VENV; \ - make; make install; ls $VENV/lib $VENV/include; \ - ln -s /usr/lib/python3.7/config-x86_64-linux-gnu/libpython3.7.so $VENV/lib/ - - -# Install NEST, latest stable version (July 2019) -ENV NEST_VER=2.20.0 -ENV NEST=nest-simulator-$NEST_VER -ENV NEST_SRC=$HOME/packages/$NEST -ENV NEST_INSTALL_DIR=$VENV/nest_build -ENV NEST_PYTHON_PREFIX=${NEST_INSTALL_DIR}/lib/python3.7/site-packages -ENV NEST_MODULE_PATH=${NEST_INSTALL_DIR}/lib/nest - -WORKDIR $HOME/packages -RUN wget https://github.com/nest/nest-simulator/archive/v2.20.0.tar.gz -O $HOME/packages/$NEST.tar.gz; \ - tar xzf $NEST.tar.gz; rm $NEST.tar.gz; \ - cd $NEST; \ - cmake -DCMAKE_INSTALL_PREFIX=$NEST_INSTALL_DIR \ - -Dwith-python=3 \ - -Dwith-libneurosim=$VENV \ - -DPYTHON_EXECUTABLE=$CONDAENV/bin/python3 \ - -DPYTHON_LIBRARY=$CONDAENV/lib \ - -DPYTHON_INCLUDE_DIR=$CONDAENV/include/python3.8 \ - $NEST_SRC; \ - make; make install - -# Install nestml -RUN git clone --depth 1 https://github.com/nest/nestml.git; \ - cd nestml; \ - $CONDAENV_PYTHON setup.py install - -# Install TVB specific packages -WORKDIR $HOME/packages -RUN $CONDAENV_PIP install pandas xarray pytest pytest-cov pytest-benchmark oct2py scikit-learn scipy; \ - $CONDAENV_PIP install --ignore-installed entrypoints - -RUN wget https://zenodo.org/record/3688773/files/tvb-data.zip?download=1 -O tvb_data.zip; \ - mkdir tvb_data; unzip tvb_data.zip -d tvb_data; rm tvb_data.zip; \ - cd tvb_data; \ - $CONDAENV_PYTHON setup.py develop - -RUN git clone --depth 1 --branch tvb-multiscale-cosim https://github.com/the-virtual-brain/tvb-root.git -ARG LAST_SHA_ROOT=LATEST -RUN cd tvb-root; \ - git pull origin tvb-multiscale-cosim --allow-unrelated-histories; \ - cd scientific_library; \ - $CONDAENV_PYTHON setup.py develop; - -RUN git clone --depth 1 https://github.com/the-virtual-brain/tvb-multiscale.git -ARG LAST_SHA_MULTISCALE=LATEST -RUN cd tvb-multiscale; \ - git pull; \ - $CONDAENV_PYTHON setup.py develop --no-deps; - -RUN mkdir -m777 /home/jovyan/.tvb-temp /home/jovyan/.local -RUN mkdir -m777 /home/jovyan/.local/share -RUN mkdir -m777 /home/jovyan/.local/share/jupyter -RUN mkdir -m777 /home/jovyan/.local/share/jupyter/runtime - -# Register conda env python as jupyerhub kernel -RUN $CONDAENV_PIP install --user ipykernel -RUN $CONDAENV_PYTHON -m ipykernel install --user - -WORKDIR $HOME - -ENV NEST_INSTALL_DIR=${NEST_INSTALL_DIR} -ENV NEST_PYTHON_PREFIX=${NEST_INSTALL_DIR}/lib/python3.8/site-packages -ENV PYTHONPATH=$PYTHONPATH:$VENV:${NEST_PYTHON_PREFIX} -# Note that the following are automatically reset if NEST is imported -# via a call to tvb_nest.simulator_nest.nest_factory.load_nest() -ENV NEST_DATA_DIR=${NEST_INSTALL_DIR}/share/nest -ENV SLI_PATH=${NEST_INSTALL_DIR}/share/nest/sli -ENV NEST_MODULE_PATH=${NEST_MODULE_PATH} -ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${NEST_MODULE_PATH} -ENV NEST_DOC_DIR=${NEST_INSTALL_DIR}/share/doc/nest - -## Install local tvb-multiscale: -ENV MYMODULES_DIR=$HOME/packages/tvb-multiscale/tvb_nest/nest/modules -ENV MYMODULES_BLD_DIR=$HOME/packages/nest_modules_builds -RUN cp -r ${MYMODULES_DIR} ${MYMODULES_BLD_DIR} - -ARG WORK_DIR=/home/jovyan/packages/notebooks -ARG TVB_NEST_Examples=/home/jovyan/packages/notebooks/TVB-NEST-Examples - -RUN mkdir -m777 $WORK_DIR -RUN mkdir -m777 $TVB_NEST_Examples -RUN cp -r /home/jovyan/packages/tvb-multiscale/docs/documented_example_notebook/* $TVB_NEST_Examples -RUN chmod -R 777 $WORK_DIR -RUN chmod -R 777 $TVB_NEST_Examples -RUN chmod -R 777 /home/jovyan/packages/tvb-multiscale/tvb_nest/examples -RUN chown -R jovyan: $TVB_NEST_Examples -RUN chown -R jovyan: /home/jovyan/packages/tvb-multiscale/tvb_nest/examples - -WORKDIR $WORK_DIR -# CMD is defined in the base image: jupyter/minimal-notebook \ No newline at end of file diff --git a/docker/hbp_deploy/Jenkinsfile-dev-branch b/docker/hbp_deploy/Jenkinsfile-dev-branch deleted file mode 100644 index 3964c761a..000000000 --- a/docker/hbp_deploy/Jenkinsfile-dev-branch +++ /dev/null @@ -1,45 +0,0 @@ -pipeline { - agent { - label 'docker_build' - } - - environment { - FULL_DOCKER_IMAGE_NAME = 'thevirtualbrain/tvb-multiscale' - TVB_BRANCH = 'master' - MULTISCALE_BRANCH = 'dev' - } - - stages { - stage('Build and push docker image on docker hub'){ - steps { - script { - LAST_SHA_TVB = sh (script: "curl -s 'https://api.github.com/repos/the-virtual-brain/tvb-root/commits?sha=${TVB_BRANCH}' | grep sha | head -1 | cut -d ':' -f2 | tr -d '\",'", returnStdout: true).trim() - LAST_SHA_MULTISCALE = sh (script: "curl -s 'https://api.github.com/repos/the-virtual-brain/tvb-multiscale/commits?sha=${MULTISCALE_BRANCH}' | grep sha | head -1 | cut -d ':' -f2 | tr -d '\",'", returnStdout: true).trim() - VERSION_NO = sh(script: "curl -s 'https://raw.githubusercontent.com/the-virtual-brain/tvb-multiscale/dev/setup.py' | grep VERSION | head -1 | tr -d 'VERSION = \"'", returnStdout: true).trim() - VERSION_TAG = "dev-'${VERSION_NO}'-'${LAST_SHA_MULTISCALE}'" - withDockerRegistry(credentialsId: 'tvb_on_docker_hub') { - def dockerfile = 'docker/hbp_deploy/Dockerfile-dev-branch' - def dockerImage = docker.build("${FULL_DOCKER_IMAGE_NAME}:${VERSION_TAG}", "--build-arg TVB_BRANCH='${TVB_BRANCH}' --build-arg MULTISCALE_BRANCH='${MULTISCALE_BRANCH}' --build-arg LAST_SHA_TVB='${LAST_SHA_TVB}' --build-arg LAST_SHA_MULTISCALE='${LAST_SHA_MULTISCALE}' -f ${dockerfile} .") - dockerImage.push() - dockerImage.push('dev-latest') - } - } - } - } - } - - post { - changed { - mail to: 'paula.prodan@codemart.ro lia.domide@codemart.ro', - subject: "Jenkins Pipeline ${currentBuild.fullDisplayName} changed status", - body: """ - Result: ${currentBuild.result} - Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' - Check console output at ${env.BUILD_URL}""" - } - - success { - echo 'Build finished successfully' - } - } -} \ No newline at end of file diff --git a/docker/hbp_deploy/Jenkinsfile-master-branch b/docker/hbp_deploy/Jenkinsfile-master-branch deleted file mode 100644 index b7990b011..000000000 --- a/docker/hbp_deploy/Jenkinsfile-master-branch +++ /dev/null @@ -1,45 +0,0 @@ -pipeline { - agent { - label 'docker_build' - } - - environment { - FULL_DOCKER_IMAGE_NAME = 'thevirtualbrain/tvb-multiscale' - TVB_BRANCH = 'master' - MULTISCALE_BRANCH = 'master' - } - - stages { - stage('Build and push docker image on docker hub'){ - steps { - script { - VERSION_NO = sh(script: "curl -s 'https://raw.githubusercontent.com/the-virtual-brain/tvb-multiscale/master/setup.py' | grep VERSION | head -1 | tr -d 'VERSION = \"'", returnStdout: true).trim() - LAST_SHA_TVB = sh (script: "curl -s 'https://api.github.com/repos/the-virtual-brain/tvb-root/commits?sha=${TVB_BRANCH}' | grep sha | head -1 | tr '\"' '_'", returnStdout: true).trim() - LAST_SHA_MULTISCALE = sh (script: "curl -s 'https://api.github.com/repos/the-virtual-brain/tvb-multiscale/commits?sha=${MULTISCALE_BRANCH}' | grep sha | head -1 | cut -d ':' -f2 | tr -d '\",'", returnStdout: true).trim() - VERSION_TAG = "${VERSION_NO}-${LAST_SHA_MULTISCALE}" - withDockerRegistry(credentialsId: 'tvb_on_docker_hub') { - def dockerfile = 'docker/hbp_deploy/Dockerfile' - def dockerImage = docker.build("${FULL_DOCKER_IMAGE_NAME}:${VERSION_TAG}", "--build-arg TVB_BRANCH='${TVB_BRANCH}' --build-arg MULTISCALE_BRANCH='${MULTISCALE_BRANCH}' --build-arg LAST_SHA_TVB='${LAST_SHA_TVB}' --build-arg LAST_SHA_MULTISCALE='${LAST_SHA_MULTISCALE}' -f ${dockerfile} .") - dockerImage.push() - dockerImage.push('latest') - } - } - } - } - } - - post { - changed { - mail to: 'paula.prodan@codemart.ro lia.domide@codemart.ro', - subject: "Jenkins Pipeline ${currentBuild.fullDisplayName} changed status", - body: """ - Result: ${currentBuild.result} - Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' - Check console output at ${env.BUILD_URL}""" - } - - success { - echo 'Build finished successfully' - } - } -} diff --git a/docker/hbp_deploy/jupyterhub-deployer-nest2.json b/docker/hbp_deploy/jupyterhub-deployer-nest2.json deleted file mode 100644 index 7eec1ba23..000000000 --- a/docker/hbp_deploy/jupyterhub-deployer-nest2.json +++ /dev/null @@ -1,508 +0,0 @@ -{ - "kind": "Template", - "apiVersion": "template.openshift.io/v1", - "metadata": { - "name": "jupyterhub-deployer", - "annotations": { - "openshift.io/display-name": "JupyterHub", - "description": "Template for deploying a JupyterHub instance.", - "iconClass": "icon-python", - "tags": "python,jupyter,jupyterhub" - } - }, - "parameters": [ - { - "name": "APPLICATION_NAME", - "value": "jupyterhub", - "required": true - }, - { - "name": "JUPYTERHUB_IMAGE", - "value": "jupyterhub:3.4.0", - "required": true - }, - { - "name": "NOTEBOOK_IMAGE", - "value": "s2i-minimal-notebook:3.6", - "required": true - }, - { - "name": "KEYCLOAK_CLIENT_SECRET", - "value": "", - "required": true - }, - { - "name": "JUPYTERHUB_CONFIG", - "value": "", - "required": false - }, - { - "name": "JUPYTERHUB_ENVVARS", - "value": "", - "required": false - }, - { - "name": "DATABASE_PASSWORD", - "generate": "expression", - "from": "[a-zA-Z0-9]{16}", - "required": true - }, - { - "name": "COOKIE_SECRET", - "generate": "expression", - "from": "[a-f0-9]{32}", - "required": true - }, - { - "name": "JUPYTERHUB_MEMORY", - "description": "Amount of memory available to JupyterHub.", - "value": "512Mi", - "required": true - }, - { - "name": "DATABASE_MEMORY", - "description": "Amount of memory available to PostgreSQL.", - "value": "512Mi", - "required": true - }, - { - "name": "NOTEBOOK_MEMORY", - "description": "Amount of memory available to each notebook.", - "value": "3Gi", - "required": true - } - ], - "objects": [ - { - "kind": "ConfigMap", - "apiVersion": "v1", - "metadata": { - "name": "${APPLICATION_NAME}-cfg", - "labels": { - "app": "${APPLICATION_NAME}" - } - }, - "data": { - "jupyterhub_config.py": "${JUPYTERHUB_CONFIG}", - "jupyterhub_config.sh": "${JUPYTERHUB_ENVVARS}" - } - }, - { - "kind": "ServiceAccount", - "apiVersion": "v1", - "metadata": { - "name": "${APPLICATION_NAME}-hub", - "labels": { - "app": "${APPLICATION_NAME}" - }, - "annotations": { - "serviceaccounts.openshift.io/oauth-redirectreference.first": "{\"kind\":\"OAuthRedirectReference\",\"apiVersion\":\"v1\",\"reference\":{\"kind\":\"Route\",\"name\":\"${APPLICATION_NAME}\"}}", - "serviceaccounts.openshift.io/oauth-redirecturi.first": "hub/oauth_callback", - "serviceaccounts.openshift.io/oauth-want-challenges": "false" - } - } - }, - { - "kind": "RoleBinding", - "apiVersion": "authorization.openshift.io/v1", - "metadata": { - "name": "${APPLICATION_NAME}-edit", - "labels": { - "app": "${APPLICATION_NAME}" - } - }, - "subjects": [ - { - "kind": "ServiceAccount", - "name": "${APPLICATION_NAME}-hub" - } - ], - "roleRef": { - "apiGroup": "rbac.authorization.k8s.io", - "kind": "ClusterRole", - "name": "edit" - } - }, - { - "kind": "DeploymentConfig", - "apiVersion": "apps.openshift.io/v1", - "metadata": { - "name": "${APPLICATION_NAME}", - "labels": { - "app": "${APPLICATION_NAME}" - } - }, - "spec": { - "strategy": { - "type": "Recreate" - }, - "triggers": [ - { - "type": "ConfigChange" - }, - { - "type": "ImageChange", - "imageChangeParams": { - "automatic": true, - "containerNames": [ - "wait-for-database", - "jupyterhub" - ], - "from": { - "kind": "ImageStreamTag", - "name": "${JUPYTERHUB_IMAGE}" - } - } - } - ], - "replicas": 1, - "selector": { - "app": "${APPLICATION_NAME}", - "deploymentconfig": "${APPLICATION_NAME}" - }, - "template": { - "metadata": { - "annotations": { - "alpha.image.policy.openshift.io/resolve-names": "*" - }, - "labels": { - "app": "${APPLICATION_NAME}", - "deploymentconfig": "${APPLICATION_NAME}" - } - }, - "spec": { - "serviceAccountName": "${APPLICATION_NAME}-hub", - "initContainers": [ - { - "name": "wait-for-database", - "image": "${JUPYTERHUB_IMAGE}", - "command": [ - "wait-for-database" - ], - "resources": { - "limits": { - "memory": "${JUPYTERHUB_MEMORY}" - } - }, - "env": [ - { - "name": "JUPYTERHUB_DATABASE_PASSWORD", - "value": "${DATABASE_PASSWORD}" - }, - { - "name": "JUPYTERHUB_DATABASE_HOST", - "value": "${APPLICATION_NAME}-db" - }, - { - "name": "JUPYTERHUB_DATABASE_NAME", - "value": "postgres" - } - ] - } - ], - "containers": [ - { - "name": "jupyterhub", - "image": "${JUPYTERHUB_IMAGE}", - "ports": [ - { - "containerPort": 8080, - "protocol": "TCP" - } - ], - "resources": { - "limits": { - "memory": "${JUPYTERHUB_MEMORY}" - } - }, - "env": [ - { - "name": "APPLICATION_NAME", - "value": "${APPLICATION_NAME}" - }, - { - "name": "JUPYTERHUB_NOTEBOOK_IMAGE", - "value": "${NOTEBOOK_IMAGE}" - }, - { - "name": "JUPYTERHUB_NOTEBOOK_MEMORY", - "value": "${NOTEBOOK_MEMORY}" - }, - { - "name": "JUPYTERHUB_DATABASE_PASSWORD", - "value": "${DATABASE_PASSWORD}" - }, - { - "name": "JUPYTERHUB_DATABASE_HOST", - "value": "${APPLICATION_NAME}-db" - }, - { - "name": "JUPYTERHUB_DATABASE_NAME", - "value": "postgres" - }, - { - "name": "JUPYTERHUB_COOKIE_SECRET", - "value": "${COOKIE_SECRET}" - }, - { - "name": "KEYCLOAK_CLIENT_SECRET", - "value": "${KEYCLOAK_CLIENT_SECRET}" - }, - { - "name": "OAUTH2_TOKEN_URL", - "value": "https://iam.humanbrainproject.eu/auth/realms/hbp/protocol/openid-connect/token" - }, - { - "name": "OAUTH2_AUTHORIZE_URL", - "value": "https://iam.humanbrainproject.eu/auth/realms/hbp/protocol/openid-connect/auth" - }, - { - "name": "OAUTH2_USERDATA_URL", - "value": "https://iam.humanbrainproject.eu/auth/realms/hbp/protocol/openid-connect/userinfo" - }, - { - "name": "OAUTH_CALLBACK_URL", - "value": "https://tvb-nest2.apps.hbp.eu/hub/oauth_callback" - } - ], - "volumeMounts": [ - { - "name": "config", - "mountPath": "/opt/app-root/configs" - } - ] - } - ], - "volumes": [ - { - "name": "config", - "configMap": { - "name": "${APPLICATION_NAME}-cfg", - "defaultMode": 420 - } - } - ] - } - } - } - }, - { - "kind": "Service", - "apiVersion": "v1", - "metadata": { - "name": "${APPLICATION_NAME}", - "labels": { - "app": "${APPLICATION_NAME}" - } - }, - "spec": { - "ports": [ - { - "name": "8080-tcp", - "protocol": "TCP", - "port": 8080, - "targetPort": 8080 - }, - { - "name": "8081-tcp", - "protocol": "TCP", - "port": 8081, - "targetPort": 8081 - } - ], - "selector": { - "app": "${APPLICATION_NAME}", - "deploymentconfig": "${APPLICATION_NAME}" - } - } - }, - { - "kind": "Route", - "apiVersion": "route.openshift.io/v1", - "metadata": { - "name": "${APPLICATION_NAME}", - "labels": { - "app": "${APPLICATION_NAME}" - } - }, - "spec": { - "host": "tvb-nest2.apps.hbp.eu", - "to": { - "kind": "Service", - "name": "${APPLICATION_NAME}", - "weight": 100 - }, - "port": { - "targetPort": "8080-tcp" - }, - "tls": { - "termination": "edge", - "insecureEdgeTerminationPolicy": "Redirect" - } - } - }, - { - "kind": "PersistentVolumeClaim", - "apiVersion": "v1", - "metadata": { - "name": "${APPLICATION_NAME}-db", - "annotations": { - "volume.beta.kubernetes.io/storage-class": "managed-nfs-storage", - "volume.beta.kubernetes.io/storage-provisioner": "fuseim.pri/ifs" - }, - "labels": { - "app": "${APPLICATION_NAME}" - } - }, - "spec": { - "accessModes": [ - "ReadWriteOnce" - ], - "resources": { - "requests": { - "storage": "1Gi" - } - } - } - }, - { - "kind": "DeploymentConfig", - "apiVersion": "apps.openshift.io/v1", - "metadata": { - "name": "${APPLICATION_NAME}-db", - "labels": { - "app": "${APPLICATION_NAME}" - } - }, - "spec": { - "replicas": 1, - "selector": { - "app": "${APPLICATION_NAME}", - "deploymentconfig": "${APPLICATION_NAME}-db" - }, - "strategy": { - "type": "Recreate" - }, - "template": { - "metadata": { - "labels": { - "app": "${APPLICATION_NAME}", - "deploymentconfig": "${APPLICATION_NAME}-db" - } - }, - "spec": { - "containers": [ - { - "name": "postgresql", - "env": [ - { - "name": "POSTGRESQL_USER", - "value": "jupyterhub" - }, - { - "name": "POSTGRESQL_PASSWORD", - "value": "${DATABASE_PASSWORD}" - }, - { - "name": "POSTGRESQL_DATABASE", - "value": "postgres" - } - ], - "livenessProbe": { - "tcpSocket": { - "port": 5432 - } - }, - "ports": [ - { - "containerPort": 5432, - "protocol": "TCP" - } - ], - "resources": { - "limits": { - "memory": "${DATABASE_MEMORY}" - } - }, - "readinessProbe": { - "exec": { - "command": [ - "/bin/sh", - "-i", - "-c", - "psql -h 127.0.0.1 -U $POSTGRESQL_USER -q -d $POSTGRESQL_DATABASE -c 'SELECT 1'" - ] - } - }, - "volumeMounts": [ - { - "mountPath": "/var/lib/pgsql/data", - "name": "data" - } - ] - } - ], - "volumes": [ - { - "name": "data", - "persistentVolumeClaim": { - "claimName": "${APPLICATION_NAME}-db" - } - }, - { - "name": "config", - "configMap": { - "name": "${APPLICATION_NAME}-cfg", - "defaultMode": 420 - } - } - ] - } - }, - "triggers": [ - { - "imageChangeParams": { - "automatic": true, - "containerNames": [ - "postgresql" - ], - "from": { - "kind": "ImageStreamTag", - "name": "postgresql:9.6", - "namespace": "openshift" - } - }, - "type": "ImageChange" - }, - { - "type": "ConfigChange" - } - ] - } - }, - { - "kind": "Service", - "apiVersion": "v1", - "metadata": { - "name": "${APPLICATION_NAME}-db", - "labels": { - "app": "${APPLICATION_NAME}" - } - }, - "spec": { - "ports": [ - { - "name": "5432-tcp", - "protocol": "TCP", - "port": 5432, - "targetPort": 5432 - } - ], - "selector": { - "app": "${APPLICATION_NAME}", - "deploymentconfig": "${APPLICATION_NAME}-db" - } - } - } - ] -} \ No newline at end of file diff --git a/docker/hbp_deploy/jupyterhub-deployer.json b/docker/hbp_deploy/jupyterhub-deployer.json deleted file mode 100644 index d1fb46430..000000000 --- a/docker/hbp_deploy/jupyterhub-deployer.json +++ /dev/null @@ -1,508 +0,0 @@ -{ - "kind": "Template", - "apiVersion": "template.openshift.io/v1", - "metadata": { - "name": "jupyterhub-deployer", - "annotations": { - "openshift.io/display-name": "JupyterHub", - "description": "Template for deploying a JupyterHub instance.", - "iconClass": "icon-python", - "tags": "python,jupyter,jupyterhub" - } - }, - "parameters": [ - { - "name": "APPLICATION_NAME", - "value": "jupyterhub", - "required": true - }, - { - "name": "JUPYTERHUB_IMAGE", - "value": "jupyterhub:3.4.0", - "required": true - }, - { - "name": "NOTEBOOK_IMAGE", - "value": "s2i-minimal-notebook:3.6", - "required": true - }, - { - "name": "KEYCLOAK_CLIENT_SECRET", - "value": "", - "required": true - }, - { - "name": "JUPYTERHUB_CONFIG", - "value": "", - "required": false - }, - { - "name": "JUPYTERHUB_ENVVARS", - "value": "", - "required": false - }, - { - "name": "DATABASE_PASSWORD", - "generate": "expression", - "from": "[a-zA-Z0-9]{16}", - "required": true - }, - { - "name": "COOKIE_SECRET", - "generate": "expression", - "from": "[a-f0-9]{32}", - "required": true - }, - { - "name": "JUPYTERHUB_MEMORY", - "description": "Amount of memory available to JupyterHub.", - "value": "512Mi", - "required": true - }, - { - "name": "DATABASE_MEMORY", - "description": "Amount of memory available to PostgreSQL.", - "value": "512Mi", - "required": true - }, - { - "name": "NOTEBOOK_MEMORY", - "description": "Amount of memory available to each notebook.", - "value": "3Gi", - "required": true - } - ], - "objects": [ - { - "kind": "ConfigMap", - "apiVersion": "v1", - "metadata": { - "name": "${APPLICATION_NAME}-cfg", - "labels": { - "app": "${APPLICATION_NAME}" - } - }, - "data": { - "jupyterhub_config.py": "${JUPYTERHUB_CONFIG}", - "jupyterhub_config.sh": "${JUPYTERHUB_ENVVARS}" - } - }, - { - "kind": "ServiceAccount", - "apiVersion": "v1", - "metadata": { - "name": "${APPLICATION_NAME}-hub", - "labels": { - "app": "${APPLICATION_NAME}" - }, - "annotations": { - "serviceaccounts.openshift.io/oauth-redirectreference.first": "{\"kind\":\"OAuthRedirectReference\",\"apiVersion\":\"v1\",\"reference\":{\"kind\":\"Route\",\"name\":\"${APPLICATION_NAME}\"}}", - "serviceaccounts.openshift.io/oauth-redirecturi.first": "hub/oauth_callback", - "serviceaccounts.openshift.io/oauth-want-challenges": "false" - } - } - }, - { - "kind": "RoleBinding", - "apiVersion": "authorization.openshift.io/v1", - "metadata": { - "name": "${APPLICATION_NAME}-edit", - "labels": { - "app": "${APPLICATION_NAME}" - } - }, - "subjects": [ - { - "kind": "ServiceAccount", - "name": "${APPLICATION_NAME}-hub" - } - ], - "roleRef": { - "apiGroup": "rbac.authorization.k8s.io", - "kind": "ClusterRole", - "name": "edit" - } - }, - { - "kind": "DeploymentConfig", - "apiVersion": "apps.openshift.io/v1", - "metadata": { - "name": "${APPLICATION_NAME}", - "labels": { - "app": "${APPLICATION_NAME}" - } - }, - "spec": { - "strategy": { - "type": "Recreate" - }, - "triggers": [ - { - "type": "ConfigChange" - }, - { - "type": "ImageChange", - "imageChangeParams": { - "automatic": true, - "containerNames": [ - "wait-for-database", - "jupyterhub" - ], - "from": { - "kind": "ImageStreamTag", - "name": "${JUPYTERHUB_IMAGE}" - } - } - } - ], - "replicas": 1, - "selector": { - "app": "${APPLICATION_NAME}", - "deploymentconfig": "${APPLICATION_NAME}" - }, - "template": { - "metadata": { - "annotations": { - "alpha.image.policy.openshift.io/resolve-names": "*" - }, - "labels": { - "app": "${APPLICATION_NAME}", - "deploymentconfig": "${APPLICATION_NAME}" - } - }, - "spec": { - "serviceAccountName": "${APPLICATION_NAME}-hub", - "initContainers": [ - { - "name": "wait-for-database", - "image": "${JUPYTERHUB_IMAGE}", - "command": [ - "wait-for-database" - ], - "resources": { - "limits": { - "memory": "${JUPYTERHUB_MEMORY}" - } - }, - "env": [ - { - "name": "JUPYTERHUB_DATABASE_PASSWORD", - "value": "${DATABASE_PASSWORD}" - }, - { - "name": "JUPYTERHUB_DATABASE_HOST", - "value": "${APPLICATION_NAME}-db" - }, - { - "name": "JUPYTERHUB_DATABASE_NAME", - "value": "postgres" - } - ] - } - ], - "containers": [ - { - "name": "jupyterhub", - "image": "${JUPYTERHUB_IMAGE}", - "ports": [ - { - "containerPort": 8080, - "protocol": "TCP" - } - ], - "resources": { - "limits": { - "memory": "${JUPYTERHUB_MEMORY}" - } - }, - "env": [ - { - "name": "APPLICATION_NAME", - "value": "${APPLICATION_NAME}" - }, - { - "name": "JUPYTERHUB_NOTEBOOK_IMAGE", - "value": "${NOTEBOOK_IMAGE}" - }, - { - "name": "JUPYTERHUB_NOTEBOOK_MEMORY", - "value": "${NOTEBOOK_MEMORY}" - }, - { - "name": "JUPYTERHUB_DATABASE_PASSWORD", - "value": "${DATABASE_PASSWORD}" - }, - { - "name": "JUPYTERHUB_DATABASE_HOST", - "value": "${APPLICATION_NAME}-db" - }, - { - "name": "JUPYTERHUB_DATABASE_NAME", - "value": "postgres" - }, - { - "name": "JUPYTERHUB_COOKIE_SECRET", - "value": "${COOKIE_SECRET}" - }, - { - "name": "KEYCLOAK_CLIENT_SECRET", - "value": "${KEYCLOAK_CLIENT_SECRET}" - }, - { - "name": "OAUTH2_TOKEN_URL", - "value": "https://iam.humanbrainproject.eu/auth/realms/hbp/protocol/openid-connect/token" - }, - { - "name": "OAUTH2_AUTHORIZE_URL", - "value": "https://iam.humanbrainproject.eu/auth/realms/hbp/protocol/openid-connect/auth" - }, - { - "name": "OAUTH2_USERDATA_URL", - "value": "https://iam.humanbrainproject.eu/auth/realms/hbp/protocol/openid-connect/userinfo" - }, - { - "name": "OAUTH_CALLBACK_URL", - "value": "https://tvb-multiscale.apps.hbp.eu/hub/oauth_callback" - } - ], - "volumeMounts": [ - { - "name": "config", - "mountPath": "/opt/app-root/configs" - } - ] - } - ], - "volumes": [ - { - "name": "config", - "configMap": { - "name": "${APPLICATION_NAME}-cfg", - "defaultMode": 420 - } - } - ] - } - } - } - }, - { - "kind": "Service", - "apiVersion": "v1", - "metadata": { - "name": "${APPLICATION_NAME}", - "labels": { - "app": "${APPLICATION_NAME}" - } - }, - "spec": { - "ports": [ - { - "name": "8080-tcp", - "protocol": "TCP", - "port": 8080, - "targetPort": 8080 - }, - { - "name": "8081-tcp", - "protocol": "TCP", - "port": 8081, - "targetPort": 8081 - } - ], - "selector": { - "app": "${APPLICATION_NAME}", - "deploymentconfig": "${APPLICATION_NAME}" - } - } - }, - { - "kind": "Route", - "apiVersion": "route.openshift.io/v1", - "metadata": { - "name": "${APPLICATION_NAME}", - "labels": { - "app": "${APPLICATION_NAME}" - } - }, - "spec": { - "host": "tvb-multiscale.apps.hbp.eu", - "to": { - "kind": "Service", - "name": "${APPLICATION_NAME}", - "weight": 100 - }, - "port": { - "targetPort": "8080-tcp" - }, - "tls": { - "termination": "edge", - "insecureEdgeTerminationPolicy": "Redirect" - } - } - }, - { - "kind": "PersistentVolumeClaim", - "apiVersion": "v1", - "metadata": { - "name": "${APPLICATION_NAME}-db", - "annotations": { - "volume.beta.kubernetes.io/storage-class": "managed-nfs-storage", - "volume.beta.kubernetes.io/storage-provisioner": "fuseim.pri/ifs" - }, - "labels": { - "app": "${APPLICATION_NAME}" - } - }, - "spec": { - "accessModes": [ - "ReadWriteOnce" - ], - "resources": { - "requests": { - "storage": "1Gi" - } - } - } - }, - { - "kind": "DeploymentConfig", - "apiVersion": "apps.openshift.io/v1", - "metadata": { - "name": "${APPLICATION_NAME}-db", - "labels": { - "app": "${APPLICATION_NAME}" - } - }, - "spec": { - "replicas": 1, - "selector": { - "app": "${APPLICATION_NAME}", - "deploymentconfig": "${APPLICATION_NAME}-db" - }, - "strategy": { - "type": "Recreate" - }, - "template": { - "metadata": { - "labels": { - "app": "${APPLICATION_NAME}", - "deploymentconfig": "${APPLICATION_NAME}-db" - } - }, - "spec": { - "containers": [ - { - "name": "postgresql", - "env": [ - { - "name": "POSTGRESQL_USER", - "value": "jupyterhub" - }, - { - "name": "POSTGRESQL_PASSWORD", - "value": "${DATABASE_PASSWORD}" - }, - { - "name": "POSTGRESQL_DATABASE", - "value": "postgres" - } - ], - "livenessProbe": { - "tcpSocket": { - "port": 5432 - } - }, - "ports": [ - { - "containerPort": 5432, - "protocol": "TCP" - } - ], - "resources": { - "limits": { - "memory": "${DATABASE_MEMORY}" - } - }, - "readinessProbe": { - "exec": { - "command": [ - "/bin/sh", - "-i", - "-c", - "psql -h 127.0.0.1 -U $POSTGRESQL_USER -q -d $POSTGRESQL_DATABASE -c 'SELECT 1'" - ] - } - }, - "volumeMounts": [ - { - "mountPath": "/var/lib/pgsql/data", - "name": "data" - } - ] - } - ], - "volumes": [ - { - "name": "data", - "persistentVolumeClaim": { - "claimName": "${APPLICATION_NAME}-db" - } - }, - { - "name": "config", - "configMap": { - "name": "${APPLICATION_NAME}-cfg", - "defaultMode": 420 - } - } - ] - } - }, - "triggers": [ - { - "imageChangeParams": { - "automatic": true, - "containerNames": [ - "postgresql" - ], - "from": { - "kind": "ImageStreamTag", - "name": "postgresql:9.6", - "namespace": "openshift" - } - }, - "type": "ImageChange" - }, - { - "type": "ConfigChange" - } - ] - } - }, - { - "kind": "Service", - "apiVersion": "v1", - "metadata": { - "name": "${APPLICATION_NAME}-db", - "labels": { - "app": "${APPLICATION_NAME}" - } - }, - "spec": { - "ports": [ - { - "name": "5432-tcp", - "protocol": "TCP", - "port": 5432, - "targetPort": 5432 - } - ], - "selector": { - "app": "${APPLICATION_NAME}", - "deploymentconfig": "${APPLICATION_NAME}-db" - } - } - } - ] -} \ No newline at end of file diff --git a/docker/hbp_deploy/jupyterhub_config.py b/docker/hbp_deploy/jupyterhub_config.py deleted file mode 100644 index f65c6cfc5..000000000 --- a/docker/hbp_deploy/jupyterhub_config.py +++ /dev/null @@ -1,37 +0,0 @@ -# keycloak integration -import os -from oauthenticator.generic import GenericOAuthenticator -c.JupyterHub.authenticator_class = GenericOAuthenticator -c.GenericOAuthenticator.login_service = 'keycloak' - -c.OAuthenticator.client_id= "tvb-multiscale" -c.OAuthenticator.scope = ["profile"] -c.OAuthenticator.client_secret= os.environ['KEYCLOAK_CLIENT_SECRET'] -c.GenericOAuthenticator.token_url= "https://iam.humanbrainproject.eu/auth/realms/hbp/protocol/openid-connect/token" -c.GenericOAuthenticator.userdata_url= "https://iam.humanbrainproject.eu/auth/realms/hbp/protocol/openid-connect/userinfo" -c.GenericOAuthenticator.userdata_method= "GET" -c.GenericOAuthenticator.userdata_params= {'state': 'state'} -c.GenericOAuthenticator.username_key= "preferred_username" - -# persistent storage for the notebooks -c.KubeSpawner.user_storage_pvc_ensure = True - -c.KubeSpawner.pvc_name_template = 'pvc-{username}' -c.KubeSpawner.user_storage_capacity = '1Gi' -c.KubeSpawner.storage_class = 'managed-nfs-storage' - -c.KubeSpawner.volumes = [ - { - 'name': 'data', - 'persistentVolumeClaim': { - 'claimName': c.KubeSpawner.pvc_name_template - } - } -] - -c.KubeSpawner.volume_mounts = [ - { - 'name': 'data', - 'mountPath': '/home/jovyan/packages/notebooks/Contributed-Notebooks' - } -] \ No newline at end of file