You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Change agent startup script behavior from being never-ending to indicating the workspace is ready on end #5749
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 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. during ssh 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)
Will agents still have connecting, and disconnected?
At first I thought we would combine the status as one field. But on second thought, we should supports states like disconnected and starting (at which point starting might become unknown).
I think renaming the current status to connection_status would make a lot of sense.
The new functionality could be put under status (or something like lifecycle_status not to conflict).
Hmm, perhaps the default behavior should wait until its ready?
I would prefer this as well, I was thinking about potential breakage for current users, which is why I proposed --wait-ready, but --no-wait is a valid option.
I think we should add a startup_script_allow_connect or something (that's a bad name), and change our templates to use it so our users start too. Maybe in a few releases we make it the default to block.
Introduce new WorkspaceAgentStatus: starting, start_timeout, started, (stopping, stop_timeout, stopped)
This seems to be a complex change to introduce, affecting many places. Did you have a chance to analyze the task complexity? I'm curious how safe it is to implement without getting you lost for a month...
This issue is becoming stale. In order to keep the tracker readable and actionable, I'm going close to this issue in 7 days if there isn't more activity.
Activity
bpmct commentedon Jan 17, 2023
Will agents still have
connecting, anddisconnected?Hmm, perhaps the default behavior should wait until its ready?
kylecarbs commentedon Jan 17, 2023
@bpmct
This would break most existing deployments that fork off our templates. Since we launch code-server, it would never let anyone SSH in.
mafredri commentedon Jan 17, 2023
At first I thought we would combine the status as one field. But on second thought, we should supports states like
disconnectedandstarting(at which pointstartingmight becomeunknown).I think renaming the current
statustoconnection_statuswould make a lot of sense.The new functionality could be put under
status(or something likelifecycle_statusnot to conflict).I would prefer this as well, I was thinking about potential breakage for current users, which is why I proposed
--wait-ready, but--no-waitis a valid option.kylecarbs commentedon Jan 17, 2023
@mafredri all this sounds good to me.
I think we should add a
startup_script_allow_connector something (that's a bad name), and change our templates to use it so our users start too. Maybe in a few releases we make it the default to block.feat: Add `startup_script_timeout` and `allow_login_before_ready`
mtojek commentedon Jan 19, 2023
This seems to be a complex change to introduce, affecting many places. Did you have a chance to analyze the task complexity? I'm curious how safe it is to implement without getting you lost for a month...
mafredri commentedon Jan 19, 2023
@mtojek That part is still a WIP but I should have it finished by today or tomorrow. Opened up a (wip) PR if you want to have a look: #5785
feat: Add `startup_script_timeout` and `delay_login_until_ready` (#84)
fix(site): Hide agent lifecycle unless opted in via `delay_login_unti…
feat(cli): Add support for `delay_login_until_ready`
docs: Document agent startup (script) issues
docs: Document agent readiness issues (startup script) (#5877)
github-actions commentedon Apr 28, 2023
This issue is becoming stale. In order to keep the tracker readable and actionable, I'm going close to this issue in 7 days if there isn't more activity.
feat: Add `startup_script_timeout` and `delay_login_until_ready` (#84)