From 2c8bf9fb980ba4b5ad9cdd008947e1df354ebfdd Mon Sep 17 00:00:00 2001 From: Chris Golden <551285+cirego@users.noreply.github.com> Date: Wed, 23 Apr 2025 16:11:56 -0700 Subject: [PATCH 1/2] Get full path to jupyter-lab if already installed If the `jupyter-lab` binary already exists in $PATH, as found by `command -v jupyter-lab`, then we skip installing using `pipx` or `uv`. By skipping the install path, we leave `${JUPYTERPATH}` unset, which then leads to a broken module unless `jupyter-lab` just so happens to be installed at `/jupyter-lab`. Fix this by calculating the full path to the binary, either from the install locations of `pipx`, `uv` or, in the case that it was preinstalled, from the preinstalled location. --- jupyterlab/run.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/jupyterlab/run.sh b/jupyterlab/run.sh index 2dd34ace..be686e55 100755 --- a/jupyterlab/run.sh +++ b/jupyterlab/run.sh @@ -34,21 +34,22 @@ if ! command -v jupyter-lab > /dev/null 2>&1; then uv) uv pip install -q jupyterlab \ && printf "%s\n" "🥳 jupyterlab has been installed" - JUPYTERPATH="$HOME/.venv/bin/" + JUPYTER="$HOME/.venv/bin/jupyter-lab" ;; pipx) pipx install jupyterlab \ && printf "%s\n" "🥳 jupyterlab has been installed" - JUPYTERPATH="$HOME/.local/bin" + JUPYTER="$HOME/.local/bin/jupyter-lab" ;; esac else printf "%s\n\n" "🥳 jupyterlab is already installed" + JUPYTER=$(command -v jupyter-lab) fi printf "👷 Starting jupyterlab in background..." printf "check logs at ${LOG_PATH}" -$JUPYTERPATH/jupyter-lab --no-browser \ +$JUPYTER --no-browser \ "$BASE_URL_FLAG" \ --ServerApp.ip='*' \ --ServerApp.port="${PORT}" \ From 00cc2cf35251259b56653829da63e6be3fc783a6 Mon Sep 17 00:00:00 2001 From: M Atif Ali Date: Thu, 24 Apr 2025 11:22:36 +0500 Subject: [PATCH 2/2] bump version --- jupyterlab/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jupyterlab/README.md b/jupyterlab/README.md index 8c2af03f..abebdc82 100644 --- a/jupyterlab/README.md +++ b/jupyterlab/README.md @@ -17,7 +17,7 @@ A module that adds JupyterLab in your Coder template. module "jupyterlab" { count = data.coder_workspace.me.start_count source = "registry.coder.com/modules/jupyterlab/coder" - version = "1.0.30" + version = "1.0.31" agent_id = coder_agent.example.id } ```