Closed as not planned
Closed as not planned
Description
A new requirement came up in relation to #2957. We need a way to discern between a workspace being ready and not. This is also relevant for vscode-coder
where we might start a workspace for a user and want to wait for it to become ready.
This requirement has also come up in #5171.
After discussing with @kylecarbs potential implementation, we came up with the following proposal:
- Introduce new property describing workspace agent state,
WorkspaceAgentLifecycle
: (created
,)starting
,start_timeout
,start_error
,ready
, (stopping
,stop_timeout
,stop_error
,stopped
)
feat: Add workspace agent lifecycle state reporting #5785- This property describes the current state of the agent and is independent of status (which describes the connection status), it can be thought of as a lifecycle status / readyness status
- And additional
created
state could be added to indicate an initial state of the agent, before it has reported it's initial state - Example usage of state:
- If state is
starting
, keep users waiting e.g. duringssh coder.workspace
(loading indicator) - If state is
start_timeout
, show users a warning - If startup script exits with non-zero status, the
start_error
state lets us direct users towards inspecting the startup log (Add startup logs to build log UI #2957)
- If state is
- Introduce a new provider parameter
coder_agent.startup_script_timeout
with a default value (say 5min) (shutdown_script_timeout
for feat: Add support for shutdown_script #5171)
feat: Addstartup_script_timeout
anddelay_login_until_ready
terraform-provider-coder#84- This is a soft-timeout after which we warn
- Show warning in dashboard
refactor(site): update agent status to include the lifecycle #5835
fix(site): Hide agent lifecycle unless opted in viadelay_login_until_ready
#5850 - Show warning in CLI, e.g. when SSH:ing into the workspace
NOTE: Not applicable until Final steps
Partially handled by: feat(cli): Add support fordelay_login_until_ready
#5851
- Introduce a new provider parameter
coder_agent.delay_login_until_ready
feat: Addstartup_script_timeout
anddelay_login_until_ready
terraform-provider-coder#84- This will delay logins until agent is ready, will default to false and changed to true in a future release
- Delay login in web Terminal
- Delay login in
coder ssh
feat(cli): Add support fordelay_login_until_ready
#5851 - Delay login in
ssh
(coder config-ssh
)
feat(cli): Add support fordelay_login_until_ready
#5851 - Add
--skip-delay-login-until-ready
flag
feat(cli): Add support fordelay_login_until_ready
#5851
- Add example(s) with non-blocking startup scripts
chore(examples): Addlogin_before_ready
andstartup_script_timeout
#5880- Consider
/etc/init.d/svc start
,nohup /path/to/svc &
, "fake systemd", etc.
- Consider
- Add documentation for troubleshooting agent lifecycles
docs: Document agent readiness issues (startup script) #5877
Final steps:
- Create a breaking PR:
- Revert fix(site): Hide agent lifecycle unless opted in via
delay_login_until_ready
#5850 to show agents with timed out startup scripts by default
- Revert fix(site): Hide agent lifecycle unless opted in via
We will focus on implementing the start-states first, stop will come later.