mirror of
https://github.com/iiab/iiab.git
synced 2025-02-13 03:32:12 +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
|
||||
jupyter_venv: /opt/iiab/jupyter
|
||||
jupyterhub_url: https://github.com/jupyterhub/the-littlest-jupyterhub
|
||||
jupyterhub_port: 8000
|
||||
|
|
|
@ -3,9 +3,29 @@
|
|||
state: directory
|
||||
path: '{{ item }}'
|
||||
with_items:
|
||||
- '{{ notebook_dir }}/etc/jupyter'
|
||||
- '{{ notebook_dir }}/etc/jupyterhub'
|
||||
- '{{ notebook_dir }}/etc/systemd'
|
||||
- '{{ 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:
|
||||
|
@ -13,6 +33,8 @@
|
|||
- pip
|
||||
- wheel
|
||||
- ipywidgets
|
||||
- jupyterhub
|
||||
- jupyterlab
|
||||
virtualenv: "{{ jupyter_venv }}" # /opt/iiab/jupyter
|
||||
virtualenv_site_packages: no
|
||||
virtualenv_command: /usr/bin/virtualenv
|
||||
|
@ -20,13 +42,11 @@
|
|||
extra_args: "--no-cache-dir"
|
||||
when: internet_available
|
||||
|
||||
- name: Fetch the Littlest JupyterHub code
|
||||
ansible.builtin.git:
|
||||
repo: '{{ jupyterhub_url }}
|
||||
dest: '{{ jupyter_venv }}'
|
||||
|
||||
- name: Install a bootstrap.py that permits installation on other than Ubunt
|
||||
- name: Install the config file for jupyterhub
|
||||
template:
|
||||
src: bootstrap.py
|
||||
dest: '{{ jupyter_venv }}'
|
||||
|
||||
src: jupyterhub_config.py
|
||||
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]
|
||||
User=hubuser
|
||||
Environment="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/iiab/jupyterhub/bin"
|
||||
ExecStart=/opt/iiab/jupyterhub/bin/jupyterhub -f /opt/iiab/jupyterhub/etc/jupyterhub/jupyterhub_config.py
|
||||
Environment="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:{{ jupyter_venv }}/bin"
|
||||
ExecStart={{ jupyter_venv }}/bin/jupyterhub -f {{ jupyter_venv }}/etc/jupyterhub/jupyterhub_config.py
|
||||
|
||||
[Install]
|
||||
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 }}
|
||||
transmission_http_port={{ transmission_http_port }}
|
||||
transmission_peer_port={{ transmission_peer_port }}
|
||||
jupyterhub_port={{ jupyterhub_port }}
|
||||
|
||||
samba_udp_ports={{ samba_udp_ports }}
|
||||
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 $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
|
||||
|
||||
# 4 = ssh + http-or-https + common IIAB services + Samba
|
||||
|
|
Loading…
Reference in a new issue