Jupyter: Difference between revisions

From FlowerHouseWiki
Line 109: Line 109:
</syntaxhighlight>
</syntaxhighlight>


<p>As server has no GPU, disable it with environment varible:</p>
<p>As server has no GPU, disable it with environment variable:</p>
<syntaxhighlight lang="console">
<syntaxhighlight lang="console">
export CUDA_VISIBLE_DEVICES="-1"
nano /etc/environment
</syntaxhighlight>
 
<p>Add following line:</p>
<syntaxhighlight lang="console">
CUDA_VISIBLE_DEVICES="-1"
</syntaxhighlight>
</syntaxhighlight>



Revision as of 19:35, 1 March 2022

Juypter.png

Network


IP: 192.168.88.18
MAC: 6A:1B:42:9D:D6:4B
Domain: jupyter.flowerhouse.at

System


OS: Debian Bullseye
RAM: 4096MB
Cores: 4
Privileged: No

The Jupyter-LXC is reachable under 192.168.88.18 which is located in the ServerVLAN.

The subdomain is jupyter.flowerhouse.at which is handled by the ReverseProxy.

Basic Setup

Installation

Install required packages

apt install python3-pip npm

Install JupyterHub, responsible for managing multiple users

python3 -m pip install jupyterhub

Install Proxy needed by JupyterHub

npm install -g configurable-http-proxy

Install webinterface and notebook

python3 -m pip install jupyterlab notebook

Configuration

Create config file

Create folder for config

mkdir /etc/jupyterhub

Generate config file

jupyterhub --generate-config -f /etc/jupyterhub/jupyterhub_config.py

Create systemd service

Create service file

nano /etc/systemd/system/jupyter.service

Add this content to file

[Unit]
Description=Jupyterhub
After=syslog.target network.target

[Service]
User=root
Environment="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/anaconda3/bin"
ExecStart=jupyterhub -f /etc/jupyterhub/jupyterhub_config.py

[Install]
WantedBy=multi-user.target

Reload systemd

systemctl daemon-reload

Start Jupyter and check if its running

systemctl start jupyter
systemctl status jupyter

Start Jupyter at boot

systemctl enable jupyter

Create/Add user

Create new user

adduser [username]

Extensions/Kernels

SageMath

Install SageMath Kernel

apt install sagemath

AI

Tensorflow

Install Tensorflow with pip

pip3 install --upgrade tensorflow requests

Check if installation works

python3 -c "import tensorflow as tf; tf.enable_eager_execution(); print(tf.reduce_sum(tf.random_normal([1000, 1000])))"

As server has no GPU, disable it with environment variable:

nano /etc/environment

Add following line:

CUDA_VISIBLE_DEVICES="-1"

Keras

Install Keras

apt install python3-keras

Sources