|
| 1 | +# Deployment |
| 2 | + |
| 3 | +The following are the steps for a reference deployment of the SysML v2 Jupyter tooling in a multi-tenant JupyterHub environment. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +* Server running a Linux distribution, e.g. Ubuntu 20.04 |
| 8 | +* [The Littlest JupyterHub](https://tljh.jupyter.org/en/latest/) |
| 9 | +* Java 11 |
| 10 | + |
| 11 | +## Steps |
| 12 | + |
| 13 | +1. Build Jupyter assets on local machine. |
| 14 | + |
| 15 | +```shell |
| 16 | +cd /path/to/SysML-v2-Pilot-Implementation/ |
| 17 | +git checkout master && git fetch && git pull |
| 18 | +# verify Java 11 |
| 19 | +# java --version |
| 20 | +./mvnw clean package |
| 21 | +``` |
| 22 | + |
| 23 | +2. Upload Jupyter assets to server via SCP. |
| 24 | + |
| 25 | +```shell |
| 26 | +export KEY_PATH=/path/to/private-key.pem |
| 27 | +``` |
| 28 | +```shell |
| 29 | +scp -i $KEY_PATH org.omg.sysml.jupyter.kernel/target/jupyter-sysml-kernel-*.zip ubuntu@jupyter.hostname.com:~ |
| 30 | +scp -i $KEY_PATH org.omg.sysml.jupyter.jupyterlab/target/jupyterlab-sysml-*.tgz ubuntu@jupyter.hostname.com:~ |
| 31 | +``` |
| 32 | + |
| 33 | +3. Connect to server via SSH and extract Jupyter assets. |
| 34 | + |
| 35 | +```shell |
| 36 | +ssh -i $KEY_PATH ubuntu@jupyter.hostname.com |
| 37 | +``` |
| 38 | +```shell |
| 39 | +export SYSML_VERSION=x.y.z |
| 40 | +``` |
| 41 | +```shell |
| 42 | +mkdir "jupyter-sysml-kernel-$SYSML_VERSION" |
| 43 | +cd "jupyter-sysml-kernel-$SYSML_VERSION/" |
| 44 | +unzip "../jupyter-sysml-kernel-$SYSML_VERSION.zip" |
| 45 | +``` |
| 46 | + |
| 47 | +4. Install Jupyter kernel and JupyterLab extension ([ref](https://tljh.jupyter.org/en/latest/howto/env/user-environment.html)) on server. |
| 48 | + |
| 49 | +```shell |
| 50 | +sudo -i |
| 51 | +``` |
| 52 | +```shell |
| 53 | +export SYSML_VERSION=x.y.z |
| 54 | +export API_BASE_PATH=http://sysml-v2-api.hostname.com:9000 |
| 55 | +export PATH=/opt/tljh/user/bin:${PATH} |
| 56 | +``` |
| 57 | +```shell |
| 58 | +cd "/home/ubuntu/jupyter-sysml-kernel-$SYSML_VERSION/" |
| 59 | +jupyter kernelspec remove sysml -f; python install.py --sys-prefix "--api-base-path=$API_BASE_PATH" "--graphviz-path=$(command -v dot)" |
| 60 | +jupyter labextension uninstall jupyterlab-sysml; jupyter labextension install "/home/ubuntu/jupyterlab-sysml-$SYSML_VERSION.tgz" |
| 61 | +``` |
0 commit comments