flytekit icon indicating copy to clipboard operation
flytekit copied to clipboard

[wip][Flyte Deck] Streaming Decks

Open Future-Outlier opened this issue 1 year ago • 4 comments

Tracking issue

https://github.com/flyteorg/flyte/issues/5574

Why are the changes needed?

What changes were proposed in this pull request?

How was this patch tested?

Setup process

Screenshots

Check all the applicable boxes

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

Related PRs

Docs link

Future-Outlier avatar Oct 01 '24 13:10 Future-Outlier

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 90.50%. Comparing base (4cee7cd) to head (c0fd23a). Report is 4 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #2779       +/-   ##
===========================================
+ Coverage   77.90%   90.50%   +12.60%     
===========================================
  Files         217      108      -109     
  Lines       22178     4760    -17418     
  Branches     2768        0     -2768     
===========================================
- Hits        17277     4308    -12969     
+ Misses       4115      452     -3663     
+ Partials      786        0      -786     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Oct 01 '24 13:10 codecov[bot]

I would love to see an example of tqdm

kumare3 avatar Oct 09 '24 04:10 kumare3

replaces https://github.com/flyteorg/flytekit/pull/1704

kumare3 avatar Oct 09 '24 04:10 kumare3

I would love to see an example of tqdm

will try it, just let me ship the MSGPACK IDL first.

Future-Outlier avatar Oct 09 '24 04:10 Future-Outlier

New Demo Video (not included Flyte Console's change) cc @pingsutw @kumare3 @eapolinario @EngHabu

https://github.com/user-attachments/assets/ddf86143-b21a-49d5-b763-6012025b6324

Future-Outlier avatar Dec 03 '24 09:12 Future-Outlier

Nice, I just would make a small refresh icon in grey next to the name, but all good

kumare3 avatar Dec 03 '24 14:12 kumare3

Nice, I just would make a small refresh icon in grey next to the name, but all good

okok, I will change this

Future-Outlier avatar Dec 03 '24 15:12 Future-Outlier

this is the new video!!! https://drive.google.com/file/d/1TpTqMjWJURN7q35ZOB5rIkPQPkIztjCq/view?usp=sharing cc @kumare3 @pingsutw @eapolinario @EngHabu @wild-endeavor

Future-Outlier avatar Dec 05 '24 03:12 Future-Outlier

@Future-Outlier this is excellent. Let's go

kumare3 avatar Dec 05 '24 04:12 kumare3

FYI @fg91 since you also want to use it. would love to get your feedback

pingsutw avatar Dec 13 '24 01:12 pingsutw

FYI @fg91 since you also want to use it. would love to get your feedback

I'm a big fan of such a feature - being able to publish realtime updates from a task to flyte console was the topic of various discussions in the past (e.g. this or this):

    # A very similar API was discussed back then:
    deck = flytekit.Deck("Summary", ...)
    deck.append(MarkdownRenderer.to_html(f"... {run.link} ..."))
    deck.flush()

I have one question about the implementation. Does flytepropeller need to detect whenever the deck html in the bucket changed for the change to be reflected in the UI or does propeller only indicate to the task where to upload the deck to but a request from flyteconsole directly "goes to the bucket" without flytepropeller having to do further work?

fg91 avatar Dec 17 '24 07:12 fg91

FYI @fg91 since you also want to use it. would love to get your feedback

I'm a big fan of such a feature - being able to publish realtime updates from a task to flyte console was the topic of various discussions in the past (e.g. this or this):

    # A very similar API was discussed back then:
    deck = flytekit.Deck("Summary", ...)
    deck.append(MarkdownRenderer.to_html(f"... {run.link} ..."))
    deck.flush()

I have one question about the implementation. Does flytepropeller need to detect whenever the deck html in the bucket changed for the change to be reflected in the UI or does propeller only indicate to the task where to upload the deck to but a request from flyteconsole directly "goes to the bucket" without flytepropeller having to do further work?

I will reply this later, just finished an amazing solution about the backend with backward compatibility.

Future-Outlier avatar Dec 17 '24 07:12 Future-Outlier

FYI @fg91 since you also want to use it. would love to get your feedback

I'm a big fan of such a feature - being able to publish realtime updates from a task to flyte console was the topic of various discussions in the past (e.g. this or this):

    # A very similar API was discussed back then:
    deck = flytekit.Deck("Summary", ...)
    deck.append(MarkdownRenderer.to_html(f"... {run.link} ..."))
    deck.flush()

I have one question about the implementation. Does flytepropeller need to detect whenever the deck html in the bucket changed for the change to be reflected in the UI or does propeller only indicate to the task where to upload the deck to but a request from flyteconsole directly "goes to the bucket" without flytepropeller having to do further work?

old flyte backend: flyte-propeller called a head request to see if the deck exists or not. new flyte backend: flytepropeller check if we put FLYTE_ENABLE_DECK=true in the task template.

Future-Outlier avatar Dec 17 '24 07:12 Future-Outlier

Code Review Agent Run #24744d

Actionable Suggestions - 2
  • flytekit/deck/deck.py - 1
    • Consider using more specific exception type · Line 96-97
  • flytekit/core/base_task.py - 1
Additional Suggestions - 1
  • flytekit/core/context_manager.py - 1
Review Details
  • Files reviewed - 7 · Commit Range: 01182b4..7bcf15e
    • flytekit/bin/entrypoint.py
    • flytekit/core/base_task.py
    • flytekit/core/constants.py
    • flytekit/core/context_manager.py
    • flytekit/deck/deck.py
    • flytekit/models/task.py
    • flytekit/tools/translator.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

AI Code Review powered by Bito Logo

flyte-bot avatar Jan 02 '25 13:01 flyte-bot

Changelist by Bito

This pull request implements the following key changes.

Key Change Files Impacted
Feature Improvement - Enhanced Deck Functionality and API

entrypoint.py - Updated deck output handling with explicit parameter naming

base_task.py - Added generates_deck flag and improved task metadata documentation

context_manager.py - Added enable_deck support in execution parameters

deck.py - Implemented Deck.publish() method and removed beta warning

task.py - Added generates_deck field to task metadata model

translator.py - Added support for enable_deck flag in task serialization

Testing - Deck Feature Test Coverage

test_deck.py - Added tests for enable_deck and disable_deck task configurations

test_translator.py - Added tests for deck settings serialization

Documentation - Documentation Updates

pydoclint-errors-baseline.txt - Removed outdated documentation error messages

flyte-bot avatar Jan 02 '25 14:01 flyte-bot

FYI @fg91 since you also want to use it. would love to get your feedback

I'm a big fan of such a feature - being able to publish realtime updates from a task to flyte console was the topic of various discussions in the past (e.g. this or this):

    # A very similar API was discussed back then:
    deck = flytekit.Deck("Summary", ...)
    deck.append(MarkdownRenderer.to_html(f"... {run.link} ..."))
    deck.flush()

I have one question about the implementation. Does flytepropeller need to detect whenever the deck html in the bucket changed for the change to be reflected in the UI or does propeller only indicate to the task where to upload the deck to but a request from flyteconsole directly "goes to the bucket" without flytepropeller having to do further work?

flyteconsole will send a request to flyteadmin, and flyteadmin will give it the deck html

Future-Outlier avatar Jan 02 '25 14:01 Future-Outlier

Code Review Agent Run #75fbe2

Actionable Suggestions - 0
Review Details
  • Files reviewed - 3 · Commit Range: 7bcf15e..be02f9f
    • flytekit/core/base_task.py
    • flytekit/deck/deck.py
    • flytekit/tools/translator.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

AI Code Review powered by Bito Logo

flyte-bot avatar Jan 02 '25 15:01 flyte-bot

Code Review Agent Run #6220fd

Actionable Suggestions - 2
  • flytekit/deck/deck.py - 2
Review Details
  • Files reviewed - 3 · Commit Range: be02f9f..dc6d203
    • flytekit/core/base_task.py
    • flytekit/core/constants.py
    • flytekit/deck/deck.py
  • Files skipped - 1
    • .github/workflows/monodocs_build.yml - Reason: Filter setting
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

AI Code Review powered by Bito Logo

flyte-bot avatar Jan 09 '25 00:01 flyte-bot

Code Review Agent Run #3bf552

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: dc6d203..41d8760
    • flytekit/core/base_task.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

AI Code Review powered by Bito Logo

flyte-bot avatar Jan 09 '25 03:01 flyte-bot

Code Review Agent Run #b6d959

Actionable Suggestions - 0
Additional Suggestions - 1
  • tests/flytekit/unit/test_translator.py - 1
    • Consider more descriptive variable name · Line 96-101
Review Details
  • Files reviewed - 4 · Commit Range: 41d8760..b5976fe
    • flytekit/core/base_task.py
    • flytekit/core/context_manager.py
    • flytekit/deck/deck.py
    • tests/flytekit/unit/test_translator.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

AI Code Review powered by Bito Logo

flyte-bot avatar Jan 09 '25 06:01 flyte-bot

Code Review Agent Run #f6709f

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: b5976fe..0c1a5a3
    • flytekit/deck/deck.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

AI Code Review powered by Bito Logo

flyte-bot avatar Jan 13 '25 15:01 flyte-bot

Code Review Agent Run #7a0ea5

Actionable Suggestions - 0
Review Details
  • Files reviewed - 3 · Commit Range: 0c1a5a3..2764ed4
    • Dockerfile.dev
    • flytekit/core/base_task.py
    • tests/flytekit/unit/test_translator.py
  • Files skipped - 1
    • .github/workflows/monodocs_build.yml - Reason: Filter setting
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

AI Code Review powered by Bito Logo

flyte-bot avatar Jan 13 '25 17:01 flyte-bot

Code Review Agent Run #859f14

Actionable Suggestions - 0
Review Details
  • Files reviewed - 4 · Commit Range: 2764ed4..d8c408c
    • Dockerfile.dev
    • flytekit/core/base_task.py
    • flytekit/models/task.py
    • flytekit/tools/translator.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

AI Code Review powered by Bito Logo

flyte-bot avatar Jan 23 '25 03:01 flyte-bot

Code Review Agent Run Status

  • Limitations and other issues:  Failure - Bito Code Review Agent didn't review this pull request automatically because it exceeded the size limit. No action is needed if you didn't intend for the agent to review it. Otherwise, you can initiate the review by typing /review in a comment below.

flyte-bot avatar Feb 04 '25 00:02 flyte-bot

/review

Future-Outlier avatar Feb 04 '25 00:02 Future-Outlier

Code Review Agent Run #077cc1

Actionable Suggestions - 4
  • flytekit/core/base_task.py - 1
    • Consider adding validation for generates_deck flag · Line 143-143
  • tests/flytekit/unit/test_translator.py - 2
    • Consider parameterizing deck test cases · Line 107-130
    • Consider consolidating duplicate serialization settings · Line 116-129
  • flytekit/models/task.py - 1
    • Consider validating generates_deck field existence · Line 357-357
Additional Suggestions - 3
  • flytekit/models/task.py - 1
  • tests/flytekit/unit/test_translator.py - 1
    • Consider more descriptive variable name · Line 97-97
  • flytekit/core/base_task.py - 1
    • Consider grouping deck related operations together · Line 724-727
Review Details
  • Files reviewed - 8 · Commit Range: 01182b4..1d6417a
    • flytekit/bin/entrypoint.py
    • flytekit/core/base_task.py
    • flytekit/core/constants.py
    • flytekit/deck/deck.py
    • flytekit/models/task.py
    • flytekit/tools/translator.py
    • pydoclint-errors-baseline.txt
    • tests/flytekit/unit/test_translator.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

AI Code Review powered by Bito Logo

flyte-bot avatar Feb 04 '25 00:02 flyte-bot

Code Review Agent Run #747ad3

Actionable Suggestions - 4
  • flytekit/tools/translator.py - 1
    • Consider restructuring nested conditions for clarity · Line 190-194
  • tests/flytekit/unit/deck/test_deck.py - 1
    • Consider simplifying complex boolean expression · Line 276-276
  • flytekit/core/base_task.py - 2
    • Consider adding null check for deck_fields · Line 724-727
    • Consider adding null check for user_space_params · Line 724-727
Additional Suggestions - 2
  • flytekit/deck/deck.py - 1
  • flytekit/models/task.py - 1
Review Details
  • Files reviewed - 9 · Commit Range: 01182b4..ea8b6e0
    • flytekit/bin/entrypoint.py
    • flytekit/core/base_task.py
    • flytekit/core/constants.py
    • flytekit/deck/deck.py
    • flytekit/models/task.py
    • flytekit/tools/translator.py
    • pydoclint-errors-baseline.txt
    • tests/flytekit/unit/deck/test_deck.py
    • tests/flytekit/unit/test_translator.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

AI Code Review powered by Bito Logo

flyte-bot avatar Feb 04 '25 02:02 flyte-bot

there's something going on with the serialization tests (e.g.: https://github.com/flyteorg/flytekit/actions/runs/13126446467/job/36627463041?pr=2779). Can you take a look?

eapolinario avatar Feb 04 '25 04:02 eapolinario

there's something going on with the serialization tests (e.g.: https://github.com/flyteorg/flytekit/actions/runs/13126446467/job/36627463041?pr=2779). Can you take a look?

yes no problem

Future-Outlier avatar Feb 04 '25 04:02 Future-Outlier

Code Review Agent Run #1c8466

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: ea8b6e0..a642c9d
    • flytekit/deck/deck.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

AI Code Review powered by Bito Logo

flyte-bot avatar Feb 04 '25 06:02 flyte-bot