mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
remove the jupyter<->jupyterhub conflict. Make all jupyterhub
This commit is contained in:
parent
da40d2d162
commit
c2dfe965cc
10 changed files with 5 additions and 1401 deletions
|
@ -1,4 +0,0 @@
|
||||||
notebook_dir: /opt/iiab/notebook
|
|
||||||
jupyter_venv: /opt/iiab/jupyter
|
|
||||||
jupyterhub_url: https://github.com/jupyterhub/the-littlest-jupyterhub
|
|
||||||
jupyterhub_port: 8000
|
|
|
@ -1,6 +0,0 @@
|
||||||
### Jupyter Notebooks on Rpi Server
|
|
||||||
* Jupyter Notebooks are widely used in the scientific community.
|
|
||||||
* This IIAB package permits individal users to start using their own notebook on the server without needing an individual server account.
|
|
||||||
* Once a user signs in with a user name, and password, these credentials are stored, and are used thereafter to gain access to the user's files.
|
|
||||||
* Individual folders are created for all student work in the path /var/lib/protected/. Individual students will only be able to see their own work in that directory.
|
|
||||||
* Students will not have any priviletes outside of their own folder.
|
|
|
@ -1,41 +0,0 @@
|
||||||
- name: systemd daemon-reload
|
|
||||||
systemd:
|
|
||||||
daemon_reload: yes
|
|
||||||
|
|
||||||
|
|
||||||
# enable or disable
|
|
||||||
- name: Enable & Restart jupyterhub
|
|
||||||
systemd:
|
|
||||||
name: "{{ item }}"
|
|
||||||
enabled: yes
|
|
||||||
state: restarted
|
|
||||||
with_items:
|
|
||||||
- jupyter
|
|
||||||
when: jupyter_enabled
|
|
||||||
|
|
||||||
- name: Disable jupyterhub
|
|
||||||
systemd:
|
|
||||||
name: "{{ item }}"
|
|
||||||
enabled: no
|
|
||||||
state: stopped
|
|
||||||
with_items:
|
|
||||||
- jupyter
|
|
||||||
when: not jupyter_enabled
|
|
||||||
|
|
||||||
|
|
||||||
- name: Put the nginx config file in place
|
|
||||||
template:
|
|
||||||
src: jupyter-nginx.conf
|
|
||||||
dest: "{{ nginx_conf_dir }}/"
|
|
||||||
when: jupyter_enabled
|
|
||||||
|
|
||||||
- name: Disable jupyterhub
|
|
||||||
file:
|
|
||||||
path: "{{ nginx_conf_dir }}/jupyter-nginx.conf"
|
|
||||||
state: absent
|
|
||||||
when: not jupyter_enabled
|
|
||||||
|
|
||||||
- name: Restart 'nginx' systemd service
|
|
||||||
systemd:
|
|
||||||
name: nginx
|
|
||||||
state: restarted
|
|
|
@ -1,55 +0,0 @@
|
||||||
- name: Make the directories to hold jupyter config
|
|
||||||
file:
|
|
||||||
state: directory
|
|
||||||
path: '{{ item }}'
|
|
||||||
with_items:
|
|
||||||
- '{{ jupyter_venv }}/etc/jupyter'
|
|
||||||
- '{{ jupyter_venv }}/etc/jupyterhub'
|
|
||||||
- '{{ jupyter_venv }}/etc/systemd'
|
|
||||||
|
|
||||||
- name: "Set 'nodejs_install: True' and 'nodejs_enabled: True'"
|
|
||||||
set_fact:
|
|
||||||
nodejs_install: True
|
|
||||||
nodejs_enabled: True
|
|
||||||
|
|
||||||
- name: NODEJS - run 'nodejs' role (attempt to install & enable Node.js)
|
|
||||||
include_role:
|
|
||||||
name: nodejs
|
|
||||||
|
|
||||||
- name: FAIL (STOP THE INSTALL) IF 'nodejs_installed is undefined'
|
|
||||||
fail:
|
|
||||||
msg: "Jupyter install cannot proceed, as Node.js is not installed."
|
|
||||||
when: nodejs_installed is undefined
|
|
||||||
|
|
||||||
- name: use npm to install configurable http proxy
|
|
||||||
npm:
|
|
||||||
name: configurable-http-proxy
|
|
||||||
global: yes
|
|
||||||
state: latest
|
|
||||||
|
|
||||||
- name: Use pip to install into a virtual environment
|
|
||||||
pip:
|
|
||||||
name:
|
|
||||||
- pip
|
|
||||||
- wheel
|
|
||||||
- ipywidgets
|
|
||||||
- jupyterhub
|
|
||||||
- jupyterlab
|
|
||||||
- jupyterhub_firstuseauthenticator
|
|
||||||
- jupyterhub-systemdspawner
|
|
||||||
virtualenv: "{{ jupyter_venv }}" # /opt/iiab/jupyter
|
|
||||||
virtualenv_site_packages: no
|
|
||||||
virtualenv_command: /usr/bin/virtualenv
|
|
||||||
virtualenv_python: python3
|
|
||||||
extra_args: "--no-cache-dir"
|
|
||||||
when: internet_available
|
|
||||||
|
|
||||||
- name: Install the config file for jupyterhub
|
|
||||||
template:
|
|
||||||
src: jupyterhub_config.py
|
|
||||||
dest: '{{ jupyter_venv }}/etc/jupyterhub/'
|
|
||||||
|
|
||||||
- name: Use systemd to start jupyterhub
|
|
||||||
template:
|
|
||||||
src: jupyter.service
|
|
||||||
dest: /etc/systemd/system/
|
|
|
@ -1,23 +0,0 @@
|
||||||
- name: Install Jupyter if jupyter_installed not defined, e.g. in {{ iiab_state_file }} # /etc/iiab/iiab_state.yml
|
|
||||||
include_tasks: install.yml
|
|
||||||
when: jupyter_installed is undefined
|
|
||||||
|
|
||||||
|
|
||||||
- include_tasks: enable-or-disable.yml
|
|
||||||
|
|
||||||
|
|
||||||
- name: Add 'jupyter' variable values to {{ iiab_ini_file }}
|
|
||||||
ini_file:
|
|
||||||
path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini
|
|
||||||
section: jupyter
|
|
||||||
option: "{{ item.option }}"
|
|
||||||
value: "{{ item.value | string }}"
|
|
||||||
with_items:
|
|
||||||
- option: name
|
|
||||||
value: Jupyter
|
|
||||||
- option: description
|
|
||||||
value: '"Raspberry Pi Jupyter python programming environment"'
|
|
||||||
- option: install
|
|
||||||
value: "{{ jupyter_install }}"
|
|
||||||
- option: enabled
|
|
||||||
value: "{{ jupyter_enabled }}"
|
|
|
@ -1,20 +0,0 @@
|
||||||
location /jupyterhub {
|
|
||||||
proxy_pass http://127.0.0.1:8000;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
#proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-NginX-Proxy true;
|
|
||||||
|
|
||||||
|
|
||||||
# websocket headers
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
|
||||||
#proxy_set_header Connection $connection_upgrade;
|
|
||||||
proxy_set_header X-Scheme $scheme;
|
|
||||||
|
|
||||||
proxy_buffering off;
|
|
||||||
}
|
|
||||||
# Managing requests to verify letsencrypt host
|
|
||||||
location ~ /.well-known {
|
|
||||||
allow all;
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
[Unit]
|
|
||||||
Description=JupyterHub
|
|
||||||
After=syslog.target network.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
User=root
|
|
||||||
Environment="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:{{ jupyter_venv }}/bin"
|
|
||||||
ExecStart={{ jupyter_venv }}/bin/python3 -m jupyterhub -f {{ jupyter_venv }}/etc/jupyterhub/jupyterhub_config.py
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,2 +1,4 @@
|
||||||
jupyterhub_venv: /opt/iiab/jupyterhub
|
notebook_dir: /opt/iiab/notebook
|
||||||
|
jupyterhub_venv: /opt/iiab/jupyter
|
||||||
|
jupyterhub_url: https://github.com/jupyterhub/the-littlest-jupyterhub
|
||||||
jupyterhub_port: 8000
|
jupyterhub_port: 8000
|
||||||
|
|
|
@ -564,8 +564,8 @@ phpmyadmin_enabled: False
|
||||||
vnstat_install: False
|
vnstat_install: False
|
||||||
vnstat_enabled: False
|
vnstat_enabled: False
|
||||||
|
|
||||||
jupyter_install: False
|
jupyterhub_install: False
|
||||||
jupyter_enabled: False
|
jupyterhub_enabled: False
|
||||||
|
|
||||||
# 9-LOCAL-ADDONS
|
# 9-LOCAL-ADDONS
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue