feat: add `--verbose` to demo/verbose
TL;DR
Adds --verbose command for the following commands:
flytectl sandbox startflytectl sandbox teardownflytectl demo startflytectl demo teardown
Type
- [ ] Bug Fix
- [x] Feature
- [ ] Plugin
Are all requirements met?
- [x] Code completed
- [x] Smoke tested
- [ ] Unit tests added
- [x] Code documentation added
- [x] Any pending items have an associated Issue
Complete description
For start command
Pretty straight forward, it uses a client-go package. Hence queried the event in the flyte namespace to show the logs

For the teardown command
- This option did not have flags, hence had to add the flag command
- This command uses Docker instead of k8s, hence had to add the
Eventsin interface

Tracking Issue
- https://github.com/flyteorg/flyte/issues/2491
Follow-up issue
NA
@DarthBenro008, thanks for creating the PR! Will review it shortly. :)
Codecov Report
Merging #359 (6e87ce3) into master (d2baa09) will decrease coverage by
0.38%. The diff coverage is19.64%.
@@ Coverage Diff @@
## master #359 +/- ##
==========================================
- Coverage 69.64% 69.26% -0.39%
==========================================
Files 140 140
Lines 4843 4896 +53
==========================================
+ Hits 3373 3391 +18
- Misses 1228 1266 +38
+ Partials 242 239 -3
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 68.89% <20.00%> (-0.36%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Impacted Files | Coverage Δ | |
|---|---|---|
| pkg/docker/docker.go | 0.00% <ø> (ø) |
|
| pkg/sandbox/start.go | 70.29% <0.00%> (-8.60%) |
:arrow_down: |
| pkg/sandbox/teardown.go | 38.63% <14.81%> (-39.15%) |
:arrow_down: |
| cmd/config/subcommand/sandbox/config_flags.go | 38.70% <100.00%> (+2.04%) |
:arrow_up: |
| cmd/demo/demo.go | 100.00% <100.00%> (ø) |
|
| cmd/demo/teardown.go | 66.66% <100.00%> (+6.66%) |
:arrow_up: |
| cmd/sandbox/sandbox.go | 100.00% <100.00%> (ø) |
|
| cmd/sandbox/teardown.go | 66.66% <100.00%> (+6.66%) |
:arrow_up: |
| cmd/create/execution_util.go | 94.93% <0.00%> (+6.47%) |
:arrow_up: |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
@pmahindrakar-oss Thank you for your review! 😃 I have made the required changes. The issue had stated with verbose logging of helm and kubectl commands which this PR very well covers.
This PR also introduces the framework to listen for Docker events: https://github.com/DarthBenro008/flytectl/blob/6718ab1942599078c52ad6f1ac73f08c4e645cf4/pkg/docker/docker.go#L29
I think for verbose logging of other components, its better to raise another issue (I would be happy to) and work on it, as this would keep things decoupled, less cluttered and easier to track/revert in future.
Please let me know your thoughts.
Thanks @DarthBenro008 . Sounds good. Would you mind opening the follow up issue to capture the rest of the components logs aswell.
@DarthBenro008 @pmahindrakar-oss, one of the checks is failing: https://github.com/flyteorg/flytectl/actions/runs/3196222822/jobs/5234854943.
@DarthBenro008 can you revert the change to generated enumer files which is probably causing the generate checks to fail
@pmahindrakar-oss done!
Thanks @DarthBenro008 . Minor UX issues with table rendering on teardown
flytectl demo teardown --verbose
---- Verbose Logs ----
+----+------+------+--------+
| ID | FROM | TYPE | ACTION |
+----+------+------+--------+
| 383ccd2e48b000d2552d382bedbebd101362b05ceac9909743d324390e1519cb | sha256:dca9be805809cc6337d20565346fa25de29b250a352b3ce2431f279f47b7320d | container | kill |
+------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+--------+
| 383ccd2e48b000d2552d382bedbebd101362b05ceac9909743d324390e1519cb | sha256:dca9be805809cc6337d20565346fa25de29b250a352b3ce2431f279f47b7320d | container | die |
+------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+--------+
| | | volume | unmount |
+------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+---------+
| | | volume | unmount |
+------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+---------+
| | | volume | unmount |
+------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+---------+
| | | volume | unmount |
+------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+---------+
| | | volume | unmount |
+------------------------------------------------------------------+-------------------------------------------------------------------------+-----------+---------+
context removed for "flyte-sandbox".
🧹 🧹 Sandbox cluster is removed successfully.