Skip to content
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

Produce console output while waiting for slow-to-create resources #6574

Closed
floyd-may opened this issue Mar 18, 2021 · 8 comments · Fixed by #8996
Closed

Produce console output while waiting for slow-to-create resources #6574

floyd-may opened this issue Mar 18, 2021 · 8 comments · Fixed by #8996
Assignees
Labels
area/cli UX of using the CLI (args, output, logs) kind/enhancement Improvements or new features resolution/fixed This issue was fixed
Milestone

Comments

@floyd-may
Copy link

When resources are slow to create, the pulumi CLI produces no console output while waiting for those resources. When running pulumi in a hosted CI environment like, say, CircleCI, that can cause the CI job to be forcibly terminated. CircleCI, for instance, kills jobs that produce no console output after 10 minutes. Naturally, that means the Pulumi update needs to be cancelled via pulumi cancel because it was forcibly killed while it was still running. Therefore, subsequent CI jobs will fail immediately.

Proposed feature: --logwaitmessages[=<interval>] flag

I propose that a flag for the pulumi CLI be added so that a "waiting..." message (or similar) will be output to stdout at least every interval seconds, with a sane default (30?). This will prevent pulumi from being auto-killed for producing no output for too long.

@floyd-may floyd-may added the kind/enhancement Improvements or new features label Mar 18, 2021
@viveklak viveklak added kind/enhancement Improvements or new features area/cli UX of using the CLI (args, output, logs) and removed kind/enhancement Improvements or new features labels Mar 18, 2021
@susanev
Copy link
Contributor

susanev commented Feb 8, 2022

@dixler heres a few recommendations, pls only take what is useful to you...

  • consider displaying feedback messages by default and then having a flag to turn off the feedback messages instead of what is proposed in the issue
  • use feedback messages that give as much context and information as possible (e.g, provisioning 2/4 resources...); note the ... is a standard pattern to communicate that something is happening so lets try and append that if possible
  • display the feedback messages every 10 minutes even if another resources has not yet been provisioned (see comments, but this is important for liveness checks)

@Frassle
Copy link
Member

Frassle commented Feb 9, 2022

if we cant provide a count, consider displaying feedback messages using the Fibonacci sequence for lengths of time, so after 1 minute, 2 minutes, 3 minutes, 5 minutes, 8 minutes, 13 minutes, etc... maxing out at 55 minutes. (e.g, provisioning...)

That's questionable. A lot of CI systems are going to use a fixed timespan for liveness checks and as soon as we are silent beyond that we'd get killed.

@susanev
Copy link
Contributor

susanev commented Feb 9, 2022

@Frassle okay, we can do a fixed time instead. @dixler and i were chatting about wanting to max out, do ya think that's not needed?

@floyd-may
Copy link
Author

My preference would be to leave the behavior unchanged with regard to maxing out; i.e. if a slow-to-create resource currently causes Pulumi to time out and give up, I'd say preserve that behavior; otherwise, if Pulumi will currently wait indefinitely, keep that behavior.

@dixler
Copy link
Contributor

dixler commented Feb 15, 2022

Any ideas on why the spinner is basically disabled in non-interactive mode?

if stdout == os.Stdout && stderr == os.Stderr && opts.IsInteractive {
spinner, ticker = cmdutil.NewSpinnerAndTicker(prefix, nil, 8 /*timesPerSecond*/)
} else {
spinner = &nopSpinner{}
ticker = time.NewTicker(math.MaxInt64)
}

@Frassle

@Frassle
Copy link
Member

Frassle commented Feb 15, 2022

Any ideas on why the spinner is basically disabled in non-interactive mode?

The spinner assumes it can mutate the screen buffer by sending backspace chars to Printf. That only works if stdout is pointing to a tty (Which is basically what IsInteractive is reporting).

Having said that NewSpinnerAndTicker already has code to check if IsInteractive is true and falls back to just printing plain dots if we don't have a tty. So I'm not sure why this outer check is also here.

@floyd-may
Copy link
Author

@dixler @pgavlin @Frassle thank you, thank you, thank you for this! Can one of you possibly tell me when to expect this to be available in the Pulumi CLI?

@Frassle
Copy link
Member

Frassle commented Feb 16, 2022

The next scheduled release is next Wednesday (23rd)

@dixler dixler self-assigned this Mar 2, 2022
@mikhailshilkov mikhailshilkov added this to the 0.69 milestone Mar 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli UX of using the CLI (args, output, logs) kind/enhancement Improvements or new features resolution/fixed This issue was fixed
Projects
None yet
7 participants