Skip to content

feat: add agent log streaming and follow provisioner format #8170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jun 28, 2023

Conversation

mafredri
Copy link
Member

@mafredri mafredri commented Jun 22, 2023

This PR unifies the output between provisioner jobs and waiting on the agent via a simple shared struct, based on the concept of "stages" from provisioner jobs.

The following changes have been implemented:

  • Refactor "stage logger" from provisioner jobs into re-usable component
  • Print coder ssh connecting status in the same way as provisioner jobs
  • Show startup log in blocking and non-blocking mode (partial)
  • Show timestamps for logs (both provisioner and ssh)

The following has been removed:

  • Support for showing "don't panic" after a timeout
  • Support for messaging about "startup script timeout", we can re-introduce it if it becomes a requested feature, but for now it adds complexity for very little gain in this new format

The tests are a good place to inspect expected output sequences in different scenarios.

Fixes #7767

image

Here's an example output stream from logging in during provision:

image

@mafredri mafredri force-pushed the mafredri/feat-cli-ssh-add-logs branch from ec14004 to 049f063 Compare June 26, 2023 14:17
@mafredri mafredri force-pushed the mafredri/feat-cli-ssh-add-logs branch from 794e7c7 to 175206a Compare June 26, 2023 16:18
@mafredri mafredri changed the title feat(cli/cliui): add agent log streaming and new format feat: add agent log streaming and follow provisioner format Jun 26, 2023
@mafredri mafredri marked this pull request as ready for review June 26, 2023 17:49
@mafredri mafredri requested review from kylecarbs, mtojek and bpmct June 26, 2023 17:49
Copy link
Member

@mtojek mtojek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't found anything blocking here, but it was much easier to review by reading the target file agent.go :)

@mafredri mafredri force-pushed the mafredri/feat-cli-ssh-add-logs branch from c10c045 to f9842c7 Compare June 27, 2023 13:33
@mafredri mafredri force-pushed the mafredri/feat-cli-ssh-add-logs branch from f9842c7 to 249b5fd Compare June 27, 2023 14:12
@mtojek
Copy link
Member

mtojek commented Jun 28, 2023

Let's not wait for other reviews. This is already in good shape.

@mtojek mtojek merged commit d3c39b6 into main Jun 28, 2023
@mtojek mtojek deleted the mafredri/feat-cli-ssh-add-logs branch June 28, 2023 08:54
@github-actions github-actions bot locked and limited conversation to collaborators Jun 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable startup log streaming in coder ssh
2 participants