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

Improve error message for pyflyte run #2472

Merged
merged 9 commits into from
Jul 2, 2024
Merged

Conversation

pingsutw
Copy link
Member

@pingsutw pingsutw commented Jun 11, 2024

Tracking issue

NA

Why are the changes needed?

The error message is cryptic

What changes were proposed in this pull request?

  • Add developer logger
  • Update logger format
  • Update log for structured dataset
  • remove verbose message
  • Limiting floats to two decimal points
  • Print a table with agent information when running pyflyte serve agent
  • Improve error handling for agent task failures
  • Improve error handling for git config not found error

How was this patch tested?

pyflyte -vv run --remote flyte-example/improve_error_handling.py wf
pyflyte serve agent

Setup process

import os
from flytekit import task, workflow, WorkflowFailurePolicy, ImageSpec


custom_image = ImageSpec(
    registry="ghcr.io/flyteorg",
    packages=["pandas"],
)


@task(container_image=custom_image, enable_deck=True)
def t1(a: int) -> int:
    os.getenv("FLYTE_INTERNAL_EXECUTION_ID")
    return 3 + a


@task(container_image=custom_image, enable_deck=True)
def t2(a: int) -> str:
    return "hello world"


@workflow(failure_policy=WorkflowFailurePolicy.FAIL_AFTER_EXECUTABLE_NODES_COMPLETE)
def wf() -> str:
    t1(a=3)
    return t2(a=3)

Screenshots

Before:

Screenshot 2024-06-18 at 4 46 20 AM Screenshot 2024-06-18 at 4 46 35 AM Screenshot 2024-06-18 at 4 46 38 AM Screenshot 2024-06-18 at 4 46 41 AM Screenshot 2024-06-18 at 4 46 42 AM Screenshot 2024-06-18 at 4 51 40 AM Screenshot 2024-06-18 at 4 47 57 AM

After:

Screenshot 2024-06-18 at 4 54 55 AM Screenshot 2024-06-18 at 4 55 14 AM Screenshot 2024-06-18 at 4 55 32 AM

Screenshot 2024-06-20 at 4 30 01 PM

Screenshot 2024-06-18 at 5 10 27 AM

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

NA

Docs link

NA

Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
@pingsutw pingsutw changed the title [WIP] Improve error message for pyflyte run Improve error message for pyflyte run Jun 18, 2024
@pingsutw pingsutw marked this pull request as ready for review June 18, 2024 12:14
Signed-off-by: Kevin Su <[email protected]>
Copy link

codecov bot commented Jun 18, 2024

Codecov Report

Attention: Patch coverage is 44.23077% with 29 lines in your changes missing coverage. Please review.

Project coverage is 42.13%. Comparing base (7ddfb9b) to head (cf5fcf1).
Report is 27 commits behind head on master.

Files Patch % Lines
flytekit/loggers.py 59.25% 7 Missing and 4 partials ⚠️
flytekit/remote/remote.py 20.00% 8 Missing ⚠️
flytekit/core/context_manager.py 33.33% 2 Missing ⚠️
flytekit/core/tracker.py 33.33% 2 Missing ⚠️
flytekit/extend/backend/base_agent.py 33.33% 2 Missing ⚠️
flytekit/types/structured/structured_dataset.py 33.33% 2 Missing ⚠️
flytekit/core/interface.py 50.00% 1 Missing ⚠️
flytekit/core/utils.py 0.00% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (7ddfb9b) and HEAD (cf5fcf1). Click for more details.

HEAD has 7 uploads less than BASE | Flag | BASE (7ddfb9b) | HEAD (cf5fcf1) | |------|------|------| ||9|2|
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #2472       +/-   ##
===========================================
- Coverage   80.12%   42.13%   -38.00%     
===========================================
  Files         185      185               
  Lines       18636    18714       +78     
  Branches     3853     3657      -196     
===========================================
- Hits        14933     7886     -7047     
- Misses       3056    10718     +7662     
+ Partials      647      110      -537     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Copy link
Member

@Future-Outlier Future-Outlier left a comment

Choose a reason for hiding this comment

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

Thank you!

@pingsutw pingsutw merged commit a9c1308 into master Jul 2, 2024
44 of 48 checks passed
bgedik pushed a commit to bgedik/flytekit that referenced this pull request Jul 3, 2024
fiedlerNr9 pushed a commit that referenced this pull request Jul 25, 2024
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Jan Fiedler <[email protected]>
mao3267 pushed a commit to mao3267/flytekit that referenced this pull request Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants