From d52af54d814910e4559ab53af3133b17aed8c38b Mon Sep 17 00:00:00 2001 From: "blink-so[bot]" <211532188+blink-so[bot]@users.noreply.github.com> Date: Wed, 20 Aug 2025 17:18:47 +0000 Subject: [PATCH 1/2] Add healthcheck to JupyterLab module Adds /api/status healthcheck to prevent the app from showing as ready before JupyterLab server is fully started and responding. Fixes: https://github.com/coder/registry/issues/345 --- registry/coder/modules/jupyterlab/main.tf | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/registry/coder/modules/jupyterlab/main.tf b/registry/coder/modules/jupyterlab/main.tf index 1237d980d..47fce2547 100644 --- a/registry/coder/modules/jupyterlab/main.tf +++ b/registry/coder/modules/jupyterlab/main.tf @@ -79,4 +79,13 @@ resource "coder_app" "jupyterlab" { share = var.share order = var.order group = var.group -} + + # Healthcheck ensures JupyterLab is fully ready before showing as available + # Test with: git clone https://github.com/coder/registry.git && cd registry/registry/coder/modules/jupyterlab + # Then use this module in a template to verify the app only appears when JupyterLab is responding + healthcheck { + url = "http://localhost:${var.port}/api/status" + interval = 5 + threshold = 6 + } +} \ No newline at end of file From 7979582e3c082c72503977f57a0a0d4c3cb32a44 Mon Sep 17 00:00:00 2001 From: "blink-so[bot]" <211532188+blink-so[bot]@users.noreply.github.com> Date: Wed, 20 Aug 2025 17:33:42 +0000 Subject: [PATCH 2/2] Address review feedback - Remove testing comment as requested - Update healthcheck URL to handle both subdomain true/false cases - Match the same URL pattern as the main app URL --- registry/coder/modules/jupyterlab/main.tf | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/registry/coder/modules/jupyterlab/main.tf b/registry/coder/modules/jupyterlab/main.tf index 47fce2547..701bcd0fa 100644 --- a/registry/coder/modules/jupyterlab/main.tf +++ b/registry/coder/modules/jupyterlab/main.tf @@ -80,11 +80,8 @@ resource "coder_app" "jupyterlab" { order = var.order group = var.group - # Healthcheck ensures JupyterLab is fully ready before showing as available - # Test with: git clone https://github.com/coder/registry.git && cd registry/registry/coder/modules/jupyterlab - # Then use this module in a template to verify the app only appears when JupyterLab is responding healthcheck { - url = "http://localhost:${var.port}/api/status" + url = var.subdomain ? "http://localhost:${var.port}/api/status" : "http://localhost:${var.port}/@${data.coder_workspace_owner.me.name}/${data.coder_workspace.me.name}/apps/jupyterlab/api/status" interval = 5 threshold = 6 }