mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
displayed the ted notebook on raspi-os
This commit is contained in:
parent
67a19a6eb5
commit
abeae78259
5 changed files with 1269 additions and 15 deletions
|
@ -1,3 +1,4 @@
|
||||||
notebook_dir: /opt/iiab/notebook
|
notebook_dir: /opt/iiab/notebook
|
||||||
jupyter_venv: /opt/iiab/jupyter
|
jupyter_venv: /opt/iiab/jupyter
|
||||||
jupyterhub_url: https://github.com/jupyterhub/the-littlest-jupyterhub
|
jupyterhub_url: https://github.com/jupyterhub/the-littlest-jupyterhub
|
||||||
|
jupyterhub_port: 8000
|
||||||
|
|
|
@ -3,9 +3,29 @@
|
||||||
state: directory
|
state: directory
|
||||||
path: '{{ item }}'
|
path: '{{ item }}'
|
||||||
with_items:
|
with_items:
|
||||||
- '{{ notebook_dir }}/etc/jupyter'
|
- '{{ jupyter_venv }}/etc/jupyter'
|
||||||
- '{{ notebook_dir }}/etc/jupyterhub'
|
- '{{ jupyter_venv }}/etc/jupyterhub'
|
||||||
- '{{ notebook_dir }}/etc/systemd'
|
- '{{ 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
|
- name: Use pip to install into a virtual environment
|
||||||
pip:
|
pip:
|
||||||
|
@ -13,6 +33,8 @@
|
||||||
- pip
|
- pip
|
||||||
- wheel
|
- wheel
|
||||||
- ipywidgets
|
- ipywidgets
|
||||||
|
- jupyterhub
|
||||||
|
- jupyterlab
|
||||||
virtualenv: "{{ jupyter_venv }}" # /opt/iiab/jupyter
|
virtualenv: "{{ jupyter_venv }}" # /opt/iiab/jupyter
|
||||||
virtualenv_site_packages: no
|
virtualenv_site_packages: no
|
||||||
virtualenv_command: /usr/bin/virtualenv
|
virtualenv_command: /usr/bin/virtualenv
|
||||||
|
@ -20,13 +42,11 @@
|
||||||
extra_args: "--no-cache-dir"
|
extra_args: "--no-cache-dir"
|
||||||
when: internet_available
|
when: internet_available
|
||||||
|
|
||||||
- name: Fetch the Littlest JupyterHub code
|
- name: Install the config file for jupyterhub
|
||||||
ansible.builtin.git:
|
|
||||||
repo: '{{ jupyterhub_url }}
|
|
||||||
dest: '{{ jupyter_venv }}'
|
|
||||||
|
|
||||||
- name: Install a bootstrap.py that permits installation on other than Ubunt
|
|
||||||
template:
|
template:
|
||||||
src: bootstrap.py
|
src: jupyterhub_config.py
|
||||||
dest: '{{ jupyter_venv }}'
|
dest: '{{ jupyter_venv }}/env/jupyterhub/'
|
||||||
|
- name: Use systemd to start jupyterhub
|
||||||
|
template:
|
||||||
|
src: jupyter.service
|
||||||
|
dest: /etc/systemd/system/
|
||||||
|
|
|
@ -4,8 +4,8 @@ After=syslog.target network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
User=hubuser
|
User=hubuser
|
||||||
Environment="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/iiab/jupyterhub/bin"
|
Environment="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:{{ jupyter_venv }}/bin"
|
||||||
ExecStart=/opt/iiab/jupyterhub/bin/jupyterhub -f /opt/iiab/jupyterhub/etc/jupyterhub/jupyterhub_config.py
|
ExecStart={{ jupyter_venv }}/bin/jupyterhub -f {{ jupyter_venv }}/etc/jupyterhub/jupyterhub_config.py
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
1231
roles/jupyter/templates/jupyterhub_config.py
Normal file
1231
roles/jupyter/templates/jupyterhub_config.py
Normal file
File diff suppressed because it is too large
Load diff
|
@ -73,6 +73,7 @@ pbx_data_ports={{ pbx_data_ports }}
|
||||||
sugarizer_port={{ sugarizer_port }}
|
sugarizer_port={{ sugarizer_port }}
|
||||||
transmission_http_port={{ transmission_http_port }}
|
transmission_http_port={{ transmission_http_port }}
|
||||||
transmission_peer_port={{ transmission_peer_port }}
|
transmission_peer_port={{ transmission_peer_port }}
|
||||||
|
jupyterhub_port={{ jupyterhub_port }}
|
||||||
|
|
||||||
samba_udp_ports={{ samba_udp_ports }}
|
samba_udp_ports={{ samba_udp_ports }}
|
||||||
samba_tcp_mports={{ samba_tcp_mports }}
|
samba_tcp_mports={{ samba_tcp_mports }}
|
||||||
|
@ -159,7 +160,8 @@ if [ "$wan" != "none" ]; then
|
||||||
|
|
||||||
$IPTABLES -A INPUT -p tcp --dport $sugarizer_port -m state --state NEW -i $wan -j ACCEPT
|
$IPTABLES -A INPUT -p tcp --dport $sugarizer_port -m state --state NEW -i $wan -j ACCEPT
|
||||||
$IPTABLES -A INPUT -p tcp --dport $transmission_http_port -m state --state NEW -i $wan -j ACCEPT
|
$IPTABLES -A INPUT -p tcp --dport $transmission_http_port -m state --state NEW -i $wan -j ACCEPT
|
||||||
$IPTABLES -A INPUT -p tcp --dport $transmission_peer_port -m state --state NEW -i $wan -j ACCEPT
|
$IPTABLES -A INPUT -p tcp --dport $transmission_http_port -m state --state NEW -i $wan -j ACCEPT
|
||||||
|
$IPTABLES -A INPUT -p tcp --dport $jupyterhub_port -m state --state NEW -i $wan -j ACCEPT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 4 = ssh + http-or-https + common IIAB services + Samba
|
# 4 = ssh + http-or-https + common IIAB services + Samba
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue