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

[RPD-273] Improvements to the provision user experience #173

Merged
merged 5 commits into from
Jul 26, 2023

Conversation

JonoCX
Copy link
Member

@JonoCX JonoCX commented Jul 24, 2023

While provision is running, there isn't much output to the user besides the spinner. This is great, it gives them a sense of time but there's no context. In this PR, we add some output to the provision process to improve the experience for the user.

There's a set of facts in the backend about the stack and Matcha (the drink) which are randomly selected and displayed to the user at a regular interval. For this to work, a separate thread is created while the apply call is running. This is then terminated once Terraform has finished.

This PR also introduces TerraformResult which is an object containing the outcome of the calls to the Terraform Python library.

Checklist

Please ensure you have done the following:

  • I have read the CONTRIBUTING guide.
  • I have updated the documentation if required.
  • I have added tests which cover my changes.

Type of change

Tick all those that apply:

  • Bug Fix (non-breaking change, fixing an issue)
  • New feature (non-breaking change to add functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Other (add details above)

@JonoCX JonoCX added the enhancement New feature or request label Jul 24, 2023
@JonoCX JonoCX self-assigned this Jul 24, 2023
@JonoCX JonoCX changed the base branch from develop to feature/bug-fixes-july-2023 July 24, 2023 14:03
Copy link
Member

@Christopher-Norman Christopher-Norman left a comment

Choose a reason for hiding this comment

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

Looking good so far, are the INFRA_FACTS meant to stack?:

✔ Matcha 🍵 initialized!

Samurai's drank Matcha before battles
Did you know that Matcha tea was created by accident?
Everything being provisioned is fully open source
Everything being provisioned is fully open source
The brewing temperature of the affects the taste of Matcha
Samurai's drank Matcha before battles
⠦ 0:02:59 Applying

Copy link
Contributor

@KirsoppJ KirsoppJ left a comment

Choose a reason for hiding this comment

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

Looking good so far, haven't run it end to end yet but will before approving


INFRA_FACTS = [
"Did you know that Matcha tea was created by accident?",
"The brewing temperature of the affects the taste of Matcha",
Copy link
Contributor

Choose a reason for hiding this comment

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

typo: brewing temperature of the what?

@@ -27,12 +27,14 @@ class AnalyticsEvent(str, Enum):


def execute_analytics_event(
func: Callable, *args, **kwargs
func: Callable, *args: dict, **kwargs: dict # type: ignore
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure what's going on with the type hints here, but should *args really be a dict not a list?

Copy link
Member

@Christopher-Norman Christopher-Norman left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -30,9 +30,14 @@ def __init__(self, status: str):
)
self.progress.add_task(description=status, total=None)

def __enter__(self) -> None:
"""Call when a spinner object is created using a `with` statement."""
def __enter__(self): # type: ignore
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Just a thought - you could type this return with TypeVar or with a string.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea, I'll give it a try 👍🏻

Copy link
Contributor

@KirsoppJ KirsoppJ left a comment

Choose a reason for hiding this comment

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

Looks great!

@JonoCX JonoCX merged commit c80823f into feature/bug-fixes-july-2023 Jul 26, 2023
@JonoCX JonoCX deleted the RPD-273-provision-ue-improvements branch July 26, 2023 13:44
@strickvl
Copy link
Contributor

Love that you ran with this idea! 🙌

JonoCX added a commit that referenced this pull request Jul 28, 2023
* [RPD-261] [BUG] destroy leads to missing matcha config file error (#165)

* Update context managers to avoid erroring on destroy after remote bucket is removed

* Update docstrings

* Add tests for context managers new destroy parameter

* [RPD-272] Updates to documentation (#166)

* RPD-272 updates to pages based on ticket description

* RPD-272 updated permissions

* [RPD-276] [BUG] Turning analytics on causes hanging in the analytics service (#168)

* [RPD-271] [BUG] Fix orphaned NetworkWatcherRG resource group (#167)

* [RPD-279] [BUG] Automatically deal with stale states #170

* [RPD-273] Improvements to the `provision` user experience (#173)

* RPD-273 added a terraform state update function and minor improvements to terraform service

* RPD-273 updated typing and fixed pre-commit issues

* RPD-273 undoing a change to the gitignore

* RPD-273 updated docstrings + grammar

* RPD-272 updated typing on context manager for Spinner

* [RPD-274] [BUG] Fix inaccurate provisioning messages (#177)

* Update message on Terraform apply for clarity

* Update test with new message

* Update base_runner.py

* Fix test

* Revert message parameter to empty string

* [RPD-263] add inference of zenml version from environment (#178)

* function checking local zenml version.

* function checking local zenml version.

* function checking local zenml version.

* remove return from ds as there is none

---------

Co-authored-by: Jonathan Carlton <[email protected]>
Co-authored-by: KirsoppJ <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants