File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -21,26 +21,30 @@ source ~/pyhpc-tutorial/.venv/bin/activate
2121# Install Python packages
2222uv pip install -r ~ /pyhpc-tutorial/build/requirements.txt
2323
24- # Create a Jupyter service
25- cat > jupyterlab.service << ' EOF '
24+ # Create the Jupyter service
25+ cat > jupyterlab.service << EOF
2626[Unit]
2727Description=JupyterLab
2828After=network-online.target
2929Wants=network-online.target
3030
3131[Service]
3232Type=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=""'
33+ User=$( whoami )
34+ WorkingDirectory=/home/$( whoami ) /pyhpc-tutorial
35+ Environment=HOME=/home/$( whoami )
36+ ExecStart=/bin/bash -lc 'source /home/$( whoami ) /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=""'
3737Restart=on-failure
3838RestartSec=5
3939
4040[Install]
4141WantedBy=multi-user.target
4242EOF
4343
44+ mkdir -p ~ /.jupyter/lab/user-settings/jupyterlab-nvidia-nsight
45+ ln -fs ~ /pyhpc-tutorial/build/jupyter_server_config.py ~ /.jupyter/jupyter_server_config.py
46+ ln -fs ~ /pyhpc-tutorial/build/jupyter_nsight_plugin_settings.json ~ /.jupyter/lab/user-settings/jupyterlab-nvidia-nsight/plugin.jupyterlab-settings
47+
4448sudo mv jupyterlab.service /etc/systemd/system/jupyterlab.service
4549sudo systemctl daemon-reload
4650sudo systemctl enable --now jupyterlab.service
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ WORKDIR /pyhpc-tutorial/notebooks
77RUN pip install --root-user-action ignore -r /pyhpc-tutorial/build/requirements.txt \
88 && git config --unset-all "http.https://github.com/.extraheader" || { code=$?; [ "$code" = 5 ] || exit "$code"; } \
99 && git config --global --add safe.directory "/pyhpc-tutorial" \
10- && mkdir ~/.jupyter \
10+ && mkdir -p ~/.jupyter/lab/user-settings/jupyterlab-nvidia-nsight \
1111 && mkdir -p ~/.local/state/._bash_history \
1212 && ln -fs /pyhpc-tutorial/build/jupyter_server_config.py ~/.jupyter/jupyter_server_config.py \
1313 && ln -fs /pyhpc-tutorial/build/jupyter_nsight_plugin_settings.json ~/.jupyter/lab/user-settings/jupyterlab-nvidia-nsight/plugin.jupyterlab-settings
You can’t perform that action at this time.
0 commit comments