Skip to content

Enable startup log streaming in coder ssh #7767

Closed
@mafredri

Description

@mafredri

When startup_script_behavior => blocking (#7757) or workspace agent lifecycle is startup_error, we want to stream/show the startup log the same way provisioning logs are currently streamed.

  • Update messaging to match provisioner log output
  • Show startup script log when startup_script_behavior => blocking
  • Show startup script log when lifecycle is start_error

Example (blocking):

✔ Setting up [2805ms]
> ⧗  Planning infrastructure
  data.coder_provisioner.me: Refreshing...
  ...
✔ Starting workspace [3726ms]
✔ Cleaning Up [26ms]
✔ Waiting for workspace agent to connect [500ms]
> ⧗  Running workspace agent startup script
  + echo Running apt-get update
  Running apt-get update
  + sudo apt-get update
  ...
  + echo Installing iperf3
  Installing iperf3
  + sudo apt-get install iperf3 --yes
  Reading package lists... Done
  ...
✔ Running workspace agent startup script [999999ms]

user@workspace #

Example (non-blocking), when logging in before workspace agent has connected (this allows us to give users a hint whilst not changing any of the current functionality):

...
✔ Starting workspace [3726ms]
✔ Cleaning Up [26ms]
✔ Waiting for workspace agent to connect [500ms]
> ⧗  Running workspace agent startup script (non-blocking)
  Notice: Startup script is still running and some things may be missing or not fully set up
  For more information and troubleshooting, see https://coder.com/docs/coder-oss/latest/templates#startup-sccript-is-still-executing

user@workspace #

Example (error):

✘ Running workspace agent startup script [999999ms]
  + echo Running apt-get update
  Running apt-get update
  + sudo apt-get update
  ...
  + echo Installing iperf3
  Installing iperf2
  + sudo apt-get install iperf2 --yes
  ...
  E: Unable to locate package iperf2

  Warning: The startup script exited with an error and your workspace may be in an incomplete state, you may inspect the log output above for what went wrong
  For more information and troubleshooting, see https://coder.com/docs/v2/latest/templates#agent-does-not-become-ready

user@workspace #

Metadata

Metadata

Assignees

Labels

cliArea: CLI

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions