Skip to content
Snippets Groups Projects
Commit 6b4ebe18 authored by Daniel Müller's avatar Daniel Müller :speech_balloon:
Browse files

Add tasks

parent 0d172614
Branches
No related tags found
No related merge requests found
--- ---
- hosts: localhost - hosts: localhost
pre_tasks: pre_tasks:
- name: Upgrade packages # - name: Upgrade packages
become: true # become: true
apt: # apt:
upgrade: true # upgrade: true
update_cache: true # update_cache: true
force_apt_get: true # force_apt_get: true
roles: # - name: Install pip3
- jupyter-lab # become: true
- ml-python-packages # apt:
- misc-applications # update_cache: true
# name:
# - python3-pip
# - libffi-dev # This is needed for jupyter on aarch64 to compile its C backend
# state: present
roles:
- jupyter-lab
- ml-python-packages
- misc-applications
[Unit]
Description=Jupyter Lab
[Service]
Type=simple
PIDFile=/run/jupyter.pid
# Password: [empty string]
ExecStart=/usr/bin/python3 -m jupyterlab --ip="0.0.0.0" --notebook-dir=/home/pi/notebooks --no-browser --NotebookApp.password='sha1:9a2d316959ac:843b251c27024afb46174ce40ce0ebebcf29217b'
User=pi
Group=pi
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
--- ---
# roles/jupyter-lab # roles/jupyter-lab
- name: Notebooks dir
file:
path: /home/pi/notebooks
state: directory
owner: pi
group: pi
# This should be optimized so that only one check / install is needed
# Still we should make sure that pip3 is actually installed before trying to use it
- name: Install dependecies
become: true
apt:
name:
- python3-pip
state: present
update_cache: true
- name: Install jupyter-lab
become: true
pip:
executable: pip3
name: jupyterlab
state: present
- name: Install systemd service
become: true
copy:
src: files/jupyter.service
dest: /etc/systemd/system/jupyter.service
mode: '0644'
- name: Start Jupyter-Lab service
become: true
systemd:
name: jupyter
state: started
enabled: true
daemon_reload: true
--- ---
# roles/misc-applications # roles/misc-applications
--- ---
# roles/ml-python-packages # roles/ml-python-packages
# This should be optimized so that only one check / install for pip3 is needed
# Still we should make sure that pip3 is actually installed before trying to use it
- name: Install dependecies
become: true
apt:
name:
- python3-pip
- libatlas-base-dev
state: present
update_cache: true
- name: Remove conflicting apt packages
become: true
apt:
name:
- python3-pil
- python3-numpy
state: absent
- name: Install ml python packages
become: true
pip:
executable: pip3
name:
- numpy
- sklearn
- matplotlib
- pandas
- Pillow
# - torch
# - torchvision
# - fastai
state: present
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment