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
617c716ee8
commit
ce3e4247f2
4 changed files with 1266 additions and 14 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
Loading…
Add table
Reference in a new issue