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

feat(cli): new deployment monitoring #8165

Merged
merged 7 commits into from
Jun 17, 2020
Merged

Conversation

rix0rrr
Copy link
Contributor

@rix0rrr rix0rrr commented May 22, 2020

Implement a new stack monitor, which updates the screen in-place and
shows the resources currently being deployed plus a progress bar,
instead of dumping a giant history of all events to the screen.

The new monitor can is activated automatically if the output is a TTY,
if we're not on Windows, and if we're not doing a verbose run.

Fix in both old and new stack monitors: detect rollback events, and
instead of increasing the event counter (leading to a progress of
84/45 resources done), roll the counter backwards as resources are
being rolled back.

anim


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

Implement a new stack monitor, which updates the screen in-place and
shows the resources currently being deployed plus a progress bar,
instead of dumping a giant history of all events to the screen.

The new monitor can be activated by setting `$CDK_FANCY_MONITOR` to a
truthy value. We might consider making it the default (I do think it's
better) but it might not work properly on Windows and on narrow screens.

Fix in both old and new stack monitors: detect rollback events, and
instead of increasing the event counter (leading to a progress of
`84/45` resources done), roll the counter backwards as resources are
being rolled back.
@rix0rrr rix0rrr requested a review from a team May 22, 2020 18:22
@rix0rrr rix0rrr self-assigned this May 22, 2020
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label May 22, 2020
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 5f6755c
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@rix0rrr
Copy link
Contributor Author

rix0rrr commented May 25, 2020

I did not write tests for this as, to be quite frank... I'm not sure how.

It's purely a UI thing, it'll be hard to write tests for.

Not saying it's not worth testing... just don't really know how.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 66b827b
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 22fcee6
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Copy link
Contributor

@eladb eladb left a comment

Choose a reason for hiding this comment

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

Progress bar should be above and not below, so it won't jump up and down...

@rix0rrr
Copy link
Contributor Author

rix0rrr commented May 27, 2020

Good call

@rix0rrr rix0rrr requested a review from eladb May 28, 2020 08:46
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 03793f2
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 7c57825
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@rix0rrr rix0rrr added the pr-linter/exempt-readme The PR linter will not require README changes label Jun 1, 2020
@rix0rrr rix0rrr requested a review from a team June 8, 2020 09:53
Copy link
Contributor

@RomainMuller RomainMuller left a comment

Choose a reason for hiding this comment

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

I love it, need it!

@RomainMuller
Copy link
Contributor

RomainMuller commented Jun 9, 2020

Side Q though - have you smoke tested how this behaves when an update fails and rolls back?

Edit: the PR description seems to suggest you did. Cool!

@rix0rrr rix0rrr added the pr-linter/exempt-test The PR linter will not require test changes label Jun 17, 2020
@mergify
Copy link
Contributor

mergify bot commented Jun 17, 2020

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit f066c52 into master Jun 17, 2020
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 4691188
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot deleted the huijbers/cli-monitoring branch June 17, 2020 13:28
@robertd
Copy link
Contributor

robertd commented Jun 21, 2020

It's not working really well on iTerm2 with zsh (using robbierussel/oh-my-zsh)?

Is there a way to use more verbose output (for CI/CD purposes too)?

➜  sipp-api-cdk git:(master) ✗ cdk deploy
SippApiStack: deploying...
SippApiStack: creating CloudFormation changeset...








 ✅  SippApiStack

Outputs:
SippApiStack.ServiceServiceURL250C0FB6 = https://sipp-api-alb.acme.com
SippApiStack.ServiceLoadBalancerDNSEC5B149E = internal-SippA-Servi-1X2ZSXSR3W328-1234567890.us-west-2.elb.amazonaws.com

Stack ARN:
arn:aws:cloudformation:us-west-2:1234567890:stack/SippApiStack/3841b3e0-b271-11ea-aae2-065639e88e5c

.
.
.

edit: Luckily everything looks fine in Gitlab's CI/CD pipeline.

image

@slotnick
Copy link

Encountering exactly the same here. Is there an option to disable this mode and revert to the previous display? It’s also useful to understand what happened during the build, which is lost with this update. My working model is to kick off a build, then check back after awhile to see what happened. This change makes that very difficult.

@nija-at
Copy link
Contributor

nija-at commented Jun 23, 2020

@slotnick & @robertd - I've opened a separate issue here to track this - #8696.

@rohinigaonkar
Copy link

Love this. Would like to request adding monitoring for destroying a stack too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS. pr-linter/exempt-readme The PR linter will not require README changes pr-linter/exempt-test The PR linter will not require test changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants