diff --git a/README.md b/README.md index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..260282a72902ebc701104d50f621cbc6c0b020db 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,48 @@ +# Raspberry Pi Setup + +### This ansible Playbook does the following things: +- Install pip3 +- Install jupyter-lab +- Setup a systemd service for jupyter-lab, enable it (autostart) and start it +- Jupyter-lab is served on `0.0.0.0:8888` with an empty password. This of course has security implications and should be discussed +- Install the following python3 packages: + - numpy + - sklearn + - matplotlib + - pandas + - Pillow +- On the desktop version of Raspberry Pi OS, `pil` and `numpy` are preinstalled from the APT repository and will be removed in favour the `pip3` versions. This behavior should be discussed, as there might be further problems caused by incompatible packages depending on the use of either APT or pip python packages + +### The project is structured as follows: +- [local.yml](./local.yml): The main playbook file, can be seen as the entry point + - [roles](./roles): Contains multiple roles (can be seen as small task specific playbooks). The + roles are called in the [local.yml](./local.yml) + - [jupyter-lab](./roles/jupyter-lab/tasks/main.yml): Install jupyter-lab and configure it with a systemd service and autostart + - [misc-applications](./roles/misc-applications/tasks/main.yml): Install additional extra applications + - [ml-python-packages](./roles/ml-python-packages/tasks/main.yml): Install the machine learning python packages + + + +# Using the ansible playbook on Raspberry Pi OS + +Steps to run the ansible script on a fresh (or not fresh) installation of raspberry pi os: +```sh +# Update the APT repo sources +sudo apt update +# Install ansible and git. git is already present on the desktop os version +sudo apt install -y --no-install-recommends ansible git + +# Pull and run the ansible scripts from git +# NOTE: Since the repository is currently private, the gitlab login prompt will shown. When using +# 2FA for gitlab the password login is not possible and an access token is needed. This will be +# fixed in the future +sudo ansible-pull -U https://code.fbi.h-da.de/pse-ai-at-the-edge/raspberry-pi-setup.git +``` + +# Notes + +## 64-Bit Raspberry Pi OS (Desktop) + +There were major problems when trying to install the software on 64-Bit Pi OS. Multiple python packages started to compile C/C++ library code on the device which caused extreme increases of installation times and full failures due to the 1GB RAM on model 3B beeing completely used up. Jupyter-lab also needed an additional dependency (`libffi-dev`) to compile its backend. This behavior occurred when installing packages using `pip3`, but not when using APT. Since some packages are not available, or too old on APT pip can't be fully avoided. + +This might be caused by those python libraries depending on C/C++ code which is either shipped precompile or build on device. In this case there might be a precompiled version available for armv7 (32-bit) but not for aarch64 (64-bit), causing the C/C++ code to be compiled on device with the 64-bit OS and not with the 32-bit OS.