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

kpt fn error reporting and CLI output #1557

Closed
droot opened this issue Mar 17, 2021 · 9 comments
Closed

kpt fn error reporting and CLI output #1557

droot opened this issue Mar 17, 2021 · 9 comments
Assignees
Labels
area/hydrate duplicate This issue or pull request already exists enhancement New feature or request p1 size/L 4 day triaged Issue has been triaged by adding an `area/` label
Milestone

Comments

@droot
Copy link
Contributor

droot commented Mar 17, 2021

kpt fn render should report errors with useful diagnostic info that helps the end-users as well as kpt developers. We should explore if we kpt can support error reporting explained in this post by Rob Pike. The approach in that post tries to strike the right balance with needs of both the personas.

In addition, being able to trace input/output for each function execution of the pipeline can assist in function level debugging as well.

@droot droot added enhancement New feature or request area/hydrate size/L 4 day triaged Issue has been triaged by adding an `area/` label labels Mar 17, 2021
@droot droot added this to the v1.0 alpha 2 milestone Mar 17, 2021
@droot droot self-assigned this Mar 17, 2021
@droot droot added this to To do in kpt kanban board via automation Mar 17, 2021
@droot droot moved this from To do to In progress in kpt kanban board Mar 25, 2021
@droot
Copy link
Contributor Author

droot commented Apr 14, 2021

This is addressed with #1634

@droot droot closed this as completed Apr 14, 2021
kpt kanban board automation moved this from In progress to Done Apr 14, 2021
@frankfarzan frankfarzan reopened this Apr 21, 2021
@frankfarzan
Copy link
Contributor

frankfarzan commented Apr 21, 2021

Reopening this since we need to hash out the UX for error reporting and CLI output.

A list of all the data involved in running functions:

  1. What function provides:
    1. ResourceList.results
    2. ResourceList.items
    3. stderr
    4. exit code
  2. Orchestrator provides metadata:
    1. What function is running (Specially important when running a pipeline)

We need to figure out the best UX for providing all or subset of the following to the user across:

  1. CLI output
    1. stdout
    2. stderr
  2. FunctionResults files

As part of this, need to consider happy paths and failure paths:

  1. Happy path: The pipeline ran successfully
  2. Failure paths:
    1. Function exceptional failures (e.g. function segfaulted)
    2. Validator failures which are WAI (kubeval found an issue)
    3. Orchestrator failed for some reason (e.g. IO failures or user input issues)

Some principles to follow:

  1. Don’t pollute the CLI output unnecessarily (Especially in the happy path)
  2. Don't leak internal implementation details. For example, for validator failures, the user shouldn't see a stack trace with internal identifiers.
  3. Assume any function in the pipeline will have large amount of results and stderr. Truncation may be necessary (May be controlled through a flag)
  4. Provide realtime information about what’s happening, especially for long-running operations. The CLI should not appear stuck for long periods of time with no progress.
  5. Follow and add to the style guide to ensure consistency across commands: go/kpt-errors-style-guide

@frankfarzan frankfarzan changed the title Improve kpt fn render error reporting and debuggability Improve kpt fn error reporting and CLI output UX Apr 21, 2021
@frankfarzan frankfarzan modified the milestones: v1.0 m1, v1.0 m2 Apr 21, 2021
@frankfarzan
Copy link
Contributor

#1783 should be addressed as part of this.

@frankfarzan
Copy link
Contributor

As part this, need to add e2e test cases for both render and eval: go/kpt-test-cases

@frankfarzan frankfarzan changed the title Improve kpt fn error reporting and CLI output UX Improve kpt fn error reporting and CLI output Apr 21, 2021
@frankfarzan frankfarzan moved this from Done to In progress in kpt kanban board Apr 21, 2021
@Shell32-Natsu Shell32-Natsu moved this from In progress to In Review in kpt kanban board Apr 22, 2021
@Shell32-Natsu Shell32-Natsu moved this from In Review to In progress in kpt kanban board Apr 22, 2021
@frankfarzan frankfarzan changed the title Improve kpt fn error reporting and CLI output kpt fn error reporting and CLI output Apr 22, 2021
@mortent
Copy link
Contributor

mortent commented Apr 22, 2021

Related to this, the current output while a pipeline is running is a little confusing. It prints

package ".": running function "gcr.io/kpt-fn/kubeval:v0.1": 

with the caret blinking at the end of the line. It looks like we expect some kind of user input.

@frankfarzan
Copy link
Contributor

frankfarzan commented Apr 22, 2021

@natasha41575
Copy link
Contributor

Adding that we should address the concerns raised here:
#1839 (review)

@Shell32-Natsu
Copy link
Contributor

Shell32-Natsu commented May 6, 2021

The works remained for this task are:

  1. Aggregate structured results
  2. Create results file.
  3. Hash output for the behavior with CLI stdin and stdout

These tasks are coved by umbrella issue #1390. Subtasks: #1920, #1915, #1873

@mikebz mikebz added the duplicate This issue or pull request already exists label May 17, 2021
@Shell32-Natsu
Copy link
Contributor

Close this with #1783 . The only thing remained in m2 is #1915. Please create new issues for bugs or features.

kpt kanban board automation moved this from In progress to Done May 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/hydrate duplicate This issue or pull request already exists enhancement New feature or request p1 size/L 4 day triaged Issue has been triaged by adding an `area/` label
Projects
Development

No branches or pull requests

6 participants