File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed
Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -21,4 +21,25 @@ source ~/pyhpc-tutorial/.venv/bin/activate
2121# Install Python packages
2222uv pip install -r ~ /pyhpc-tutorial/build/requirements.txt
2323
24- # TODO: Change Jupyter config to set the right working directory, install Nsight Jupyter plugin, and restart Jupyter
24+ # Create a Jupyter service
25+ cat > /etc/systemd/system/jupyterlab.service << 'EOF '
26+ [Unit]
27+ Description=JupyterLab
28+ After=network-online.target
29+ Wants=network-online.target
30+
31+ [Service]
32+ Type=simple
33+ User=ubuntu
34+ WorkingDirectory=/home/ubuntu/pyhpc-tutorial
35+ Environment=HOME=/home/ubuntu
36+ ExecStart=/bin/bash -lc 'source /home/ubuntu/pyhpc-tutorial/.venv/bin/activate; exec python -m jupyter lab --allow-root --ip=0.0.0.0 --no-browser --NotebookApp.token="" --NotebookApp.password="" --NotebookApp.default_url=""'
37+ Restart=on-failure
38+ RestartSec=5
39+
40+ [Install]
41+ WantedBy=multi-user.target
42+ EOF
43+
44+ systemctl daemon-reload
45+ systemctl enable --now jupyterlab.service
You can’t perform that action at this time.
0 commit comments