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
21
21
# Install Python packages
22
22
uv pip install -r ~ /pyhpc-tutorial/build/requirements.txt
23
23
24
- # Create a Jupyter service
25
- cat > jupyterlab.service << ' EOF '
24
+ # Create the Jupyter service
25
+ cat > jupyterlab.service << EOF
26
26
[Unit]
27
27
Description=JupyterLab
28
28
After=network-online.target
29
29
Wants=network-online.target
30
30
31
31
[Service]
32
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=""'
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=""'
37
37
Restart=on-failure
38
38
RestartSec=5
39
39
40
40
[Install]
41
41
WantedBy=multi-user.target
42
42
EOF
43
43
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
+
44
48
sudo mv jupyterlab.service /etc/systemd/system/jupyterlab.service
45
49
sudo systemctl daemon-reload
46
50
sudo systemctl enable --now jupyterlab.service
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ WORKDIR /pyhpc-tutorial/notebooks
7
7
RUN pip install --root-user-action ignore -r /pyhpc-tutorial/build/requirements.txt \
8
8
&& git config --unset-all "http.https://github.com/.extraheader" || { code=$?; [ "$code" = 5 ] || exit "$code"; } \
9
9
&& git config --global --add safe.directory "/pyhpc-tutorial" \
10
- && mkdir ~/.jupyter \
10
+ && mkdir -p ~/.jupyter/lab/user-settings/jupyterlab-nvidia-nsight \
11
11
&& mkdir -p ~/.local/state/._bash_history \
12
12
&& ln -fs /pyhpc-tutorial/build/jupyter_server_config.py ~/.jupyter/jupyter_server_config.py \
13
13
&& 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