Working on Orin locally with matplotlib

main
Drew Bednar 3 weeks ago
parent a0d8f6e692
commit 3740db3bbc

@ -1,2 +1,22 @@
# jetson-jupyterlab # jetson-jupyterlab
Simple hosting of Jupyterlab on Jetson Orin
## Install
If you are ever using a Jetpack version that doesn't have pre-built images yet, you will want to install https://github.com/dusty-nv/jetson-containers and use the commands to build your own docker containers.
This repo simply hosts a docker-compose file and a systemd service file to ensure the docker-compose services are started on boot.
```
sudo mkdir -p /opt/jupyterlab
sudo cp docker-compose-jupyterlab.yaml /opt/jupyterlab/docker-compose-jupyterlab.yaml
```
```
sudo cp jupyterlab.service /etc/systemd/system/jupyterlab.service
sudo systemctl enable jupyterlab.service
sudo systemctl start jupyterlab.service
```

@ -0,0 +1,29 @@
version: '3'
services:
jupyterlab:
# image: androiddrew/jupyterlab:r36.4.0
image: androiddrew/jupyterlab:r36.4.0-extended
runtime: nvidia
ports:
- 18888:8888
command:
- "/bin/sh"
- "-c"
- "/start_jupyter && sleep infinity"
environment:
# - JUPYTER_ROOT=/jupyterlab
- JUPYTER_PORT=8888
- JUPYTER_LOGS=/jupyterlab/jupyterlab.log
- JUPYTER_PASSWORD=notebooks
volumes:
- /opt/jupyterlab/:/jupyterlab
- /opt/jupyterlab/data:/data
restart: unless-stopped
networks:
- jupyter-docker
networks:
jupyter-docker:
external: false

@ -0,0 +1,4 @@
FROM androiddrew/jupyterlab:r36.4.0
RUN pip install matplotlib

@ -0,0 +1,4 @@
# Building and extended image with additional dependencies
docker build --tag androiddrew/jupyterlab:r36.4.0-extended -f Dockerfile.jupyterlab-extended .

@ -0,0 +1,16 @@
[Unit]
Description=Jupyterlab Notebook Service
Requires=docker.service
After=docker.service
[Service]
Type=oneshot
RemainAfterExit=yes
WorkingDirectory=/opt/jupyterlab
ExecStartPre=/bin/sh -c 'echo JUPYTERLAB_HOSTNAME=$(hostname) > /opt/jupyterlab/.env'
ExecStart=docker compose --env-file /opt/jupyterlab/.env -f /opt/jupyterlab/docker-compose-jupyterlab.yaml up -d
ExecStop=docker compose -f /opt/jupyterlab/docker-compose-jupyterlab.yaml down
[Install]
WantedBy=multi-user.target
Loading…
Cancel
Save