Title: Add health-check for `coder_apps` · Issue #2662 · coder/coder · GitHub
Open Graph Title: Add health-check for `coder_apps` · Issue #2662 · coder/coder
X Title: Add health-check for `coder_apps` · Issue #2662 · coder/coder
Description: edited by @bpmct Problem statement Throughout Coder's documentation and examples, the startup_script is used to install web IDEs onto the workspace, such as code-server, Jetbrains Projector, JupyterLab, etc. From there, users connect via...
Open Graph Description: edited by @bpmct Problem statement Throughout Coder's documentation and examples, the startup_script is used to install web IDEs onto the workspace, such as code-server, Jetbrains Projector, Jupyte...
X Description: edited by @bpmct Problem statement Throughout Coder's documentation and examples, the startup_script is used to install web IDEs onto the workspace, such as code-server, Jetbrains Projector, Ju...
Opengraph URL: https://github.com/coder/coder/issues/2662
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add health-check for `coder_apps`","articleBody":"edited by @bpmct \r\n\r\n## Problem statement\r\n\r\nThroughout Coder's documentation and examples, the [startup_script](https://registry.terraform.io/providers/coder/coder/latest/docs/resources/agent#startup_script) is used to [install web IDEs onto the workspace](https://coder.com/docs/coder-oss/latest/ides/configuring-web-ides), such as code-server, Jetbrains Projector, JupyterLab, etc. From there, users connect via links in the dashboard. In the template, this is defined via the [coder_app](https://registry.terraform.io/providers/coder/coder/latest/docs/resources/app) resource.\r\n\r\nWhen the workspace starts, it takes 15-60s for the IDEs to install before a user can get to the page. When they click it before the app loads, there's a 404 page: \r\n\r\n\u003cimg width=\"400\" alt=\"Screen Shot 2022-08-01 at 5 00 55 PM\" src=\"https://user-images.githubusercontent.com/22407953/182253361-4bc7c804-c99d-4cb7-baca-63c46416c9bf.png\">\r\n\r\nHowever, when you refresh 30 seconds later, it works!\r\n\r\n\u003cimg width=\"400\" alt=\"Screen Shot 2022-08-01 at 5 02 13 PM\" src=\"https://user-images.githubusercontent.com/22407953/182253481-0f6f65b3-1991-4e3a-b604-5333479e8267.png\">\r\n\r\n\r\n## Definition of done\r\n\r\nFrom the dashboard, the app cannot be opened until the health check passes, or the app is eventually deemed unhealthy.\r\n\r\n## Prior art\r\n\r\nHealth checks are implemented for [generic apps in Coder Classic](https://coder.com/docs/coder/latest/workspaces/applications#application-specification-file) with support for `exec` and `http` based health checks, but with a hardcoded interval/timeout/unhealthy threshold. There is not a loading indicator in the Ui, but when an app is clicked, the tab loads for `x` seconds until the health check passes/fails.\r\n\r\n## Ideas\r\n\r\n@bpmct: Unlike health checks in Coder Classic, I think health checks would benefit from a configurable `unhealthy threshold` since applications will often be installed during runtime, leading to longer-than-normal \"wait times.\" [GCP follows this pattern](https://cloud.google.com/load-balancing/docs/health-check-concepts)\r\n\r\n- Some apps may depend on a process starting (e.g code-server, http.server) so it can be considered unhealthy in 15 seconds\r\n- Some apps may depend on IntelliJ downloading and could take 60+ seconds\r\n\r\nAdd health check to `coder_app` resource\r\n\r\n```diff\r\nresource \"coder_app\" \"code_server\" {\r\n # ...\r\n+ health_check {\r\n+ # actual schema TBD\r\n+ enabled = true\r\n+ unhealthy_threshold = \"60s\"\r\n+ }\r\n}\r\n```\r\n\r\nBefore the unhealthy threshold, a loading indicator could be present making it clear to users the app is still unhealthy/loading until the health check passes or times out. Perhaps the app is also unclickable\r\n\r\n\u003cimg width=\"464\" alt=\"Screen Shot 2022-08-01 at 5 27 45 PM\" src=\"https://user-images.githubusercontent.com/22407953/182256653-906947c4-6d15-41ab-8121-c5685054c073.png\">\r\n \r\nAfter the threshold is exceeded (e.g 3 mins), the app can have a red/error indicator if the health check never passes:\r\n\r\n\u003cimg width=\"475\" alt=\"Screen Shot 2022-08-01 at 5 30 55 PM\" src=\"https://user-images.githubusercontent.com/22407953/182256502-b76fc7ad-21aa-45d1-beab-6de4d93f1a04.png\">.","author":{"url":"https://github.com/sharkymark","@type":"Person","name":"sharkymark"},"datePublished":"2022-06-26T19:29:30Z","url":"https://github.com/coder/coder/issues/2662"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:bb08d4a8-51f7-4609-b954-ab98dd489af4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D140:842EC:219DD2A:2CCE6D7:6B018AF9 |
| html-safe-nonce | a38bf54e970dd0450d4d2767a2b6837262c1aa52eb7616bc013d7670889fb406 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMTQwOjg0MkVDOjIxOUREMkE6MkNDRTZENzo2QjAxOEFGOSIsInZpc2l0b3JfaWQiOiI1MDg1MjM2NzM2MTgzODY0MDU3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 20398dc2c3f427078648642244e05e66f6bc0f53be2bee850ac54699968b7e7e |
| hovercard-subject-tag | issue:1285010333 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/coder/coder/2662/issue_layout |
| twitter:image | https://opengraph.githubassets.com/88ec86a8bc039b8c091e50c7f43b51236794ab71cef3a2eca85b165be3fb2bd0/coder/coder/issues/2662 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/88ec86a8bc039b8c091e50c7f43b51236794ab71cef3a2eca85b165be3fb2bd0/coder/coder/issues/2662 |
| og:image:alt | edited by @bpmct Problem statement Throughout Coder's documentation and examples, the startup_script is used to install web IDEs onto the workspace, such as code-server, Jetbrains Projector, Jupyte... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sharkymark |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/coder/coder git https://github.com/coder/coder.git |
| octolytics-dimension-user_id | 95932066 |
| octolytics-dimension-user_login | coder |
| octolytics-dimension-repository_id | 440752086 |
| octolytics-dimension-repository_nwo | coder/coder |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 440752086 |
| octolytics-dimension-repository_network_root_nwo | coder/coder |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width