From f1704f2771de54ab46a97c0bffbdb11a5306e9b8 Mon Sep 17 00:00:00 2001 From: Seth Foster Date: Wed, 31 Jan 2024 12:52:17 -0500 Subject: [PATCH] move unit, fix options, remove packagegroup This hopefully should be the last step to getting everything working and sane. We don't need the packagegroup (something was breaking everything anyway) and we need to fix up a couple things in the install process so the unit goes in the same place as everything else, actually runs jupyter directly so journald logging tags it properly, and we get the user package path. --- .../packagegroup-python3-jupyter-opentrons.bb | 26 ------------------- .../images/opentrons-ot3-image.bb | 2 +- .../files/jupyter-notebook.service | 4 +-- .../opentrons-jupyter-notebook.bb | 11 ++++---- 4 files changed, 8 insertions(+), 35 deletions(-) delete mode 100644 layers/meta-opentrons/recipes-core/packagegroups/packagegroup-python3-jupyter-opentrons.bb diff --git a/layers/meta-opentrons/recipes-core/packagegroups/packagegroup-python3-jupyter-opentrons.bb b/layers/meta-opentrons/recipes-core/packagegroups/packagegroup-python3-jupyter-opentrons.bb deleted file mode 100644 index bf14e88b..00000000 --- a/layers/meta-opentrons/recipes-core/packagegroups/packagegroup-python3-jupyter-opentrons.bb +++ /dev/null @@ -1,26 +0,0 @@ -DESCRIPTION = "Python packages to build jupyter notebook for OT Flex" - -inherit packagegroup python3-dir - -RDEPENDS:${PN} = " \ - ${PYTHON_PN}-matplotlib \ - ${PYTHON_PN}-pillow \ - ${PYTHON_PN}-numpy \ - ${PYTHON_PN}-psutil \ - ${PYTHON_PN}-pandas \ - ${PYTHON_PN}-ipywidgets \ - ${PYTHON_PN}-requests \ - ${PYTHON_PN}-jupyter-server \ - ${PYTHON_PN}-notebook-shim \ - ${PYTHON_PN}-anyio \ - ${PYTHON_PN}-sniffio \ - ${PYTHON_PN}-nbclassic \ - ${PYTHON_PN}-nbclient \ - ${PYTHON_PN}-charset-normalizer \ - ${PYTHON_PN}-nest-asyncio \ - ${PYTHON_PN}-websocket-client \ - ${PYTHON_PN}-matplotlib-inline \ - ${PYTHON_PN}-argon2-cffi \ - ${PYTHON_PN}-argon2-cffi-bindings \ - opentrons-jupyter-notebook \ - " diff --git a/layers/meta-opentrons/recipes-images/images/opentrons-ot3-image.bb b/layers/meta-opentrons/recipes-images/images/opentrons-ot3-image.bb index 33dc3eaa..8bf42122 100644 --- a/layers/meta-opentrons/recipes-images/images/opentrons-ot3-image.bb +++ b/layers/meta-opentrons/recipes-images/images/opentrons-ot3-image.bb @@ -56,7 +56,7 @@ IMAGE_INSTALL += " \ python3-pip \ plymouth \ mosquitto \ - opentrons-jupyter-notebook python3-nest-asyncio \ + opentrons-jupyter-notebook \ " # We do NOT want the toradex libusbgx packages that autoconfigure the OTG USB diff --git a/layers/meta-opentrons/recipes-robot/opentrons-jupyter-notebook/files/jupyter-notebook.service b/layers/meta-opentrons/recipes-robot/opentrons-jupyter-notebook/files/jupyter-notebook.service index 4ee68a2b..932e3612 100644 --- a/layers/meta-opentrons/recipes-robot/opentrons-jupyter-notebook/files/jupyter-notebook.service +++ b/layers/meta-opentrons/recipes-robot/opentrons-jupyter-notebook/files/jupyter-notebook.service @@ -5,7 +5,7 @@ Description=Jupyter notebook server Type=simple Restart=always RestartSec=1 -ExecStart=/bin/sh -c "jupyter notebook --allow-root --config=%E/jupyter/jupyter_notebook_config.py --notebook-dir=%S/jupyter/notebooks 2>&1" +ExecStart=/usr/bin/jupyter notebook --allow-root --config=%E/jupyter/jupyter_notebook_config.py --notebook-dir=%S/jupyter/notebooks PIDFile=%t/jupyter/jupyter.pid SupplementaryGroups=dialout StateDirectory=jupyter jupyter/notebooks jupyter/data jupyter/config ipython @@ -13,7 +13,7 @@ RuntimeDirectory=jupyter Environment=RUNNING_ON_VERDIN=true Environment=OT_SYSTEM_VERSION=##OT_SYSTEM_VERSION## Environment=OT_API_FF_enableOT3HardwareController=true -Environment=PYTHONPATH=/opt/opentrons-robot-server:/usr/lib/python3.10/site-packages +Environment=PYTHONPATH=/opt/opentrons-robot-server/:/usr/lib/python3.10/site-packages/:/var/user-packages/usr/lib/python3.10/site-packages/ Environment=JUPYTER_RUNTIME_DIR=%t/jupyter Environment=JUPYTER_CONFIG_DIR=%S/jupyter/config Environment=JUPYTER_DATA_DIR=%S/jupyter/data diff --git a/layers/meta-opentrons/recipes-robot/opentrons-jupyter-notebook/opentrons-jupyter-notebook.bb b/layers/meta-opentrons/recipes-robot/opentrons-jupyter-notebook/opentrons-jupyter-notebook.bb index a8d5787d..4912dde5 100644 --- a/layers/meta-opentrons/recipes-robot/opentrons-jupyter-notebook/opentrons-jupyter-notebook.bb +++ b/layers/meta-opentrons/recipes-robot/opentrons-jupyter-notebook/opentrons-jupyter-notebook.bb @@ -15,16 +15,15 @@ SRC_URI += "file://jupyter_notebook_config.py \ do_install:append() { install -d ${D}/${sysconfdir}/jupyter - install -d ${D}/${sysconfdir}/systemd/system install -m 644 ${WORKDIR}/jupyter_notebook_config.py ${D}/${sysconfdir}/jupyter/jupyter_notebook_config.py - install -m 644 ${WORKDIR}/jupyter-notebook.service ${D}/${sysconfdir}/systemd/system/jupyter-notebook.service - - # set the system version env variable - sed -i 's/##OT_SYSTEM_VERSION##/${OT_SYSTEM_VERSION}/' ${D}/${sysconfdir}/systemd/system/jupyter-notebook.service + install -d ${D}${systemd_system_unitdir} + install -m 644 ${WORKDIR}/jupyter-notebook.service ${D}${systemd_system_unitdir}/jupyter-notebook.service + # set the system version env variable + sed -i 's/##OT_SYSTEM_VERSION##/${OT_SYSTEM_VERSION}/' ${D}/${systemd_system_unitdir}/jupyter-notebook.service } FILES:${PN} += "${sysconfdir}/jupyter/jupyter_notebook_config.py \ ${sysconfdir}/systemd/system/jupyter-notebook.service \ " -RDEPENDS:${PN} += " python3-jupyter python3-nbclient python3-jupyterlab-pygments python3-psutil " +RDEPENDS:${PN} += " python3-jupyter python3-nbclient python3-jupyterlab-pygments python3-psutil python3-nest-asyncio "