Skip to content

Change agent startup script behavior from being never-ending to indicating the workspace is ready on end #5749

Closed as not planned

Description

@mafredri

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:

Final steps:

We will focus on implementing the start-states first, stop will come later.

Activity

  1. bpmct commented on Jan 17, 2023

    @bpmct
    Member

    Introduce new WorkspaceAgentStatus: starting, start_timeout, started, (stopping, stop_timeout, stopped)

    Will agents still have connecting, and disconnected?

    Allow waiting via CLI, e.g. coder ssh --wait-ready

    Hmm, perhaps the default behavior should wait until its ready?

  2. kylecarbs commented on Jan 17, 2023

    @kylecarbs
    Member

    @bpmct

    Hmm, perhaps the default behavior should wait until its ready?

    This would break most existing deployments that fork off our templates. Since we launch code-server, it would never let anyone SSH in.

  3. mafredri commented on Jan 17, 2023

    @mafredri
    MemberAuthor

    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.

  4. kylecarbs commented on Jan 17, 2023

    @kylecarbs
    Member

    @mafredri all this sounds good to me.

    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.

  5. mtojek commented on Jan 19, 2023

    @mtojek
    Member

    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...

  6. mafredri commented on Jan 19, 2023

    @mafredri
    MemberAuthor

    @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

  7. github-actions commented on Apr 28, 2023

    @github-actions
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiArea: HTTP APIcliArea: CLIstaleThis issue is like stale bread.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions