Commit 20037742 authored by eric pellegrini's avatar eric pellegrini

added conda_install_dir as a user variable for jupyterhub related roles

parent 2d8a5851
......@@ -9,3 +9,5 @@
- import_role:
name: roles/conda
vars:
conda_install_dir: "{{ ansible_env.HOME }}/conda"
......@@ -10,6 +10,7 @@
- import_role:
name: roles/jupyterhub
vars:
conda_install_dir: "{{ ansible_env.HOME }}/conda"
keycloak_url: "{{ jupyterhub.keycloak.url }}"
keycloak_admin: "{{ jupyterhub.keycloak.admin }}"
keycloak_admin_password: "{{ jupyterhub.keycloak.password }}"
......
......@@ -9,4 +9,6 @@
- import_role:
name: roles/jupyterhub-kernels
vars:
conda_install_dir: "{{ ansible_env.HOME }}/conda"
---
# defaults file for roles/conda
# conda installation directory
conda_install_dir: "{{ ansible_env.HOME }}/miniconda3"
......@@ -6,6 +6,6 @@
- "{{ conda_exe }} install -y -c anaconda setuptools"
- "{{ conda_exe }} update -y conda"
vars:
conda_exe: "{{ ansible_env.HOME }}/miniconda3/bin/conda"
conda_exe: "{{ conda_install_dir }}/bin/conda"
---
- name: remove previous conda installation if any
file:
path: "{{ conda_install_dir }}"
state: absent
- name: download latest miniconda
get_url:
url: https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
dest: "{{ ansible_env.HOME }}/Miniconda3-latest-Linux-x86_64.sh"
dest: "/tmp/Miniconda3-latest-Linux-x86_64.sh"
mode: "755"
force: True
- name: remove previous conda installation if any
file:
path: "{{ ansible_env.HOME }}/miniconda3"
state: absent
- name: install conda
command: "{{ ansible_env.HOME }}/Miniconda3-latest-Linux-x86_64.sh -b"
command: "/tmp/Miniconda3-latest-Linux-x86_64.sh -b -p {{ conda_install_dir }}"
---
# defaults file for roles/jupyterhub-kernels
\ No newline at end of file
# defaults file for roles/jupyterhub-kernels
conda_install_dir: "{{ ansible_env.HOME }}/miniconda3"
......@@ -11,6 +11,6 @@
- include: setup-octave-environment.yml
- include: setup-r-environment.yml
vars:
conda_envs_dir: "{{ ansible_env.HOME }}/miniconda3/envs"
conda_exe: "{{ ansible_env.HOME }}/miniconda3/bin/conda"
conda_root: "{{ ansible_env.HOME }}/miniconda3"
conda_envs_dir: "{{ conda_install_dir }}/envs"
conda_exe: "{{ conda_install_dir }}/bin/conda"
......@@ -5,7 +5,7 @@
- name: setup the conda environment for bash
shell: |
source "{{ conda_root }}/etc/profile.d/conda.sh"
source "{{ conda_install_dir }}/etc/profile.d/conda.sh"
conda clean --all -y
conda env create -f /tmp/environment_bash.yml --force
conda activate bash
......
......@@ -5,7 +5,7 @@
- name: setup the conda environment for cpp
shell: |
source "{{ conda_root }}/etc/profile.d/conda.sh"
source "{{ conda_install_dir }}/etc/profile.d/conda.sh"
conda clean --all -y
conda env create -f /tmp/environment_cpp.yml --force
conda activate cpp
......
......@@ -5,7 +5,7 @@
- name: setup the conda environment for data analysis
shell: |
source "{{ conda_root }}/etc/profile.d/conda.sh"
source "{{ conda_install_dir }}/etc/profile.d/conda.sh"
conda clean --all -y
conda env create -f /tmp/environment_data_analysis.yml --force
args:
......
......@@ -5,7 +5,7 @@
- name: setup the conda environment for data reduction
shell: |
source "{{ conda_root }}/etc/profile.d/conda.sh"
source "{{ conda_install_dir }}/etc/profile.d/conda.sh"
conda clean --all -y
conda env create -f /tmp/environment_data_reduction.yml --force
args:
......
......@@ -5,7 +5,7 @@
- name: setup the conda environment for fortran
shell: |
source "{{ conda_root }}/etc/profile.d/conda.sh"
source "{{ conda_install_dir }}/etc/profile.d/conda.sh"
conda clean --all -y
conda env create -f /tmp/environment_fortran.yml --force
conda activate fortran
......
......@@ -5,7 +5,7 @@
- name: setup the conda environment for julia
shell: |
source "{{ conda_root }}/etc/profile.d/conda.sh"
source "{{ conda_install_dir }}/etc/profile.d/conda.sh"
conda clean --all -y
conda env create -f /tmp/environment_julia.yml --force
conda activate julia
......
......@@ -5,7 +5,7 @@
- name: setup the conda environment for MDANSE
shell: |
source "{{ conda_root }}/etc/profile.d/conda.sh"
source "{{ conda_install_dir }}/etc/profile.d/conda.sh"
conda clean --all -y
conda env create -f /tmp/environment_mdanse.yml --force
conda activate mdanse
......@@ -34,7 +34,7 @@
- name: install ScientificPython package
shell: |
source "{{ conda_root }}/etc/profile.d/conda.sh"
source "{{ conda_install_dir }}/etc/profile.d/conda.sh"
conda activate mdanse
python2 setup.py build --netcdf_prefix="{{ conda_envs_dir }}/mdanse/"
python2 setup.py install
......@@ -61,7 +61,7 @@
- name: install MMTK package
shell: |
source "{{ conda_root }}/etc/profile.d/conda.sh"
source "{{ conda_install_dir }}/etc/profile.d/conda.sh"
conda activate mdanse
python2 setup.py build
python2 setup.py install
......@@ -82,7 +82,7 @@
- name: install MDANSE package
shell: |
source "{{ conda_root }}/etc/profile.d/conda.sh"
source "{{ conda_install_dir }}/etc/profile.d/conda.sh"
conda activate mdanse
python2 setup.py build
python2 setup.py install
......
......@@ -5,7 +5,7 @@
- name: setup the conda environment for octave
shell: |
source "{{ conda_root }}/etc/profile.d/conda.sh"
source "{{ conda_install_dir }}/etc/profile.d/conda.sh"
conda clean --all -y
conda env create -f /tmp/environment_octave.yml --force
conda activate octave
......
......@@ -5,7 +5,7 @@
- name: setup the conda environment for R
shell: |
source "{{ conda_root }}/etc/profile.d/conda.sh"
source "{{ conda_install_dir }}/etc/profile.d/conda.sh"
conda clean --all -y
conda env create -f /tmp/environment_r.yml --force
conda activate r
......
---
# defaults file for roles/jupyterhub
\ No newline at end of file
# defaults file for roles/jupyterhub
conda_install_dir: "{{ ansible_env.HOME }}/miniconda3"
......@@ -36,11 +36,11 @@
- name: template the python script for fetching keycloak client info
template:
src: "get_client_info.py.j2"
dest: "~/get_client_info.py"
dest: "/tmp/get_client_info.py"
force: True
- name: run the script
command: "python3 ~/get_client_info.py {{ keycloak_admin_password }}"
command: "python3 /tmp/get_client_info.py {{ keycloak_admin_password }}"
register: get_client_info
- name: set facts about keycloak client id and secret
......@@ -56,5 +56,5 @@
dest: "{{ conda_envs_dir }}/visa-jupyter/etc/jupyter/jupyterhub_config.py"
force: True
vars:
conda_envs_dir: "{{ ansible_env.HOME }}/miniconda3/envs"
conda_envs_dir: "{{ conda_install_dir }}/envs"
......@@ -22,7 +22,7 @@
- name: update jupyterlab and jupyterhub and install jupyter labextension
shell: |
source "{{ conda_root }}/etc/profile.d/conda.sh"
source "{{ conda_install_dir }}/etc/profile.d/conda.sh"
conda activate visa-jupyter
conda update -y jupyterlab
conda update -y jupyterhub
......@@ -30,5 +30,5 @@
args:
executable: /bin/bash
vars:
conda_exe: "{{ ansible_env.HOME }}/miniconda3/bin/conda"
conda_root: "{{ ansible_env.HOME }}/miniconda3"
conda_exe: "{{ conda_install_dir }}/bin/conda"
......@@ -9,9 +9,8 @@
- name: copy the jupyter start script
template:
src: start_jupyterhub.sh.j2
dest: "~/start_jupyterhub.sh"
dest: "{{ ansible_env.HOME }}/start_jupyterhub.sh"
mode: u+x
notify: restart visa-jupyter
vars:
conda_root: "{{ ansible_env.HOME }}/miniconda3"
conda_envs_dir: "{{ ansible_env.HOME }}/miniconda3/envs"
conda_envs_dir: "{{ conda_install_dir }}/envs"
......@@ -138,8 +138,8 @@ c.OAuthenticator.client_secret = "{{ client_secret }}"
# Here are the jupyter infrastructure admins
c.Authenticator.admin_users = {"pellegrini","pinet","hall","caunt","perrin"}
c.JupyterHub.template_paths = ["{{ conda_envs_dir }}/visa-jupyter/share/jupyterhub/templates"]
c.JupyterHub.logo_file = "{{ conda_envs_dir }}/visa-jupyter/share/jupyterhub/templates/ill_logo.jpg"
c.JupyterHub.template_paths = ["{{ conda_install_dir }}/envs/visa-jupyter/share/jupyterhub/templates"]
c.JupyterHub.logo_file = "{{ conda_install_dir }}/envs/visa-jupyter/share/jupyterhub/templates/ill_logo.jpg"
c.Spawner.default_url = "/lab"
c.Spawner.cmd = ['jupyter-labhub']
{
"hub_prefix": "{{ ansible_env.HOME }}"
"hub_prefix": "/"
}
#/bin/bash
source "{{ conda_root }}/etc/profile.d/conda.sh"
source "{{ conda_install_dir }}/etc/profile.d/conda.sh"
conda activate visa-jupyter
cd
jupyterhub -f "{{ conda_envs_dir }}/visa-jupyter/etc/jupyter/jupyterhub_config.py"
jupyterhub -f "{{ conda_install_dir }}/envs/visa-jupyter/etc/jupyter/jupyterhub_config.py"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment