-
Notifications
You must be signed in to change notification settings - Fork 333
[flyte deck] Streaming Decks #2779
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
Merged
Merged
Changes from 83 commits
Commits
Show all changes
85 commits
Select commit
Hold shift + click to select a range
01182b4
[Flyte Decl] Streaming Decks
Future-Outlier 9616fc3
print
Future-Outlier 98ae7c7
sleep more
Future-Outlier 4e92bb0
add dummy deck
Future-Outlier 4df18b5
nit
Future-Outlier ebb4d4e
dummy deck
Future-Outlier 99522d9
update
Future-Outlier c19d67d
nit
Future-Outlier 67cd829
test
Future-Outlier 06da3df
return html
Future-Outlier 6d99d69
Change Deck
Future-Outlier b805cd7
fix
Future-Outlier 4c97758
fix recursion error
Future-Outlier 7b3574a
remove redundant code
Future-Outlier 9b60564
add dummy deck to deck init
Future-Outlier 18c994f
Better Dummy Deck Logic
Future-Outlier 39f39d1
Merge branch 'master' into flytekit-streaming-deck
Future-Outlier aabcbbb
Deck Publish
Future-Outlier 9ca43f3
Merge branch 'master' into flytekit-streaming-deck
Future-Outlier ed56352
litn
Future-Outlier b559fc9
remove dummy deck
Future-Outlier fc5578f
nit
Future-Outlier 7139468
use auto refresh tab, 5 seconds as interval
Future-Outlier e0aee9e
revert
Future-Outlier 3727588
test setDynamicTabs
Future-Outlier ce3ee15
change interval time
Future-Outlier d066231
test
Future-Outlier f9387ce
revert
Future-Outlier f14c3fa
test
Future-Outlier c33a909
nit
Future-Outlier 8666c60
try dynamic containers
Future-Outlier 93580d6
try dynamic containers v2
Future-Outlier bcaaabd
try dynamic containers v3
Future-Outlier a321700
debug
Future-Outlier 6464fae
update
Future-Outlier 884943c
nit
Future-Outlier d4b5b96
Refresh Botton
Future-Outlier 406227c
fix
Future-Outlier 1e77f54
lint
Future-Outlier d70a2d5
Merge branch 'master' into flytekit-streaming-deck
Future-Outlier 7fc6393
test new refresh
Future-Outlier 6980140
lint
Future-Outlier c87a342
Revert back html code, collaborating with Lyon
Future-Outlier f609760
lint
Future-Outlier 473ae11
nit
Future-Outlier 008fe52
Merge branch 'master' into flytekit-streaming-deck
Future-Outlier f0b9028
nit
Future-Outlier d48efa9
update
Future-Outlier 6b55930
better code
Future-Outlier b5912fb
update
Future-Outlier a681ccd
some notes for giving user params builder deck enabled
Future-Outlier 048fdff
update
Future-Outlier 7bcf15e
raise error when disabled deck and called Deck.publish()
Future-Outlier b6c41c3
lint
Future-Outlier be02f9f
lint
Future-Outlier cf83e06
update
Future-Outlier e137328
static method by YEE
Future-Outlier a59a56e
make Deck.publish more like a wrapper by moving enable deck checking …
Future-Outlier b8383be
lint
Future-Outlier dc6d203
print monodocs err
Future-Outlier 41d8760
Fix monodocs
Future-Outlier b71cc19
use builder
Future-Outlier b5976fe
add translator test for deck serialization settings
Future-Outlier 0c1a5a3
update
Future-Outlier d082456
fix
Future-Outlier 4a8c68f
test
Future-Outlier b58527b
update
Future-Outlier 2764ed4
remove blank
Future-Outlier 90372db
update kevin's advice
Future-Outlier d8c408c
master-branch-idl
Future-Outlier 5cacf11
update
Future-Outlier c447793
Use ENABLE_DECK as constant
Future-Outlier c5cc967
Merge branch 'master' into flytekit-streaming-deck
Future-Outlier 1d6417a
update pydoc lint
Future-Outlier b0cd1ae
unit tests for enable deck ctx user param
Future-Outlier 974b882
update agent's advice
Future-Outlier ea8b6e0
use pytest.mark.parametrize in test
Future-Outlier a642c9d
update
Future-Outlier e9aef35
update
Future-Outlier 04775d7
deck
Future-Outlier 34a4146
update
Future-Outlier f30382b
Merge branch 'master' into flytekit-streaming-deck
Future-Outlier b649f8f
add executiuon parameter test
Future-Outlier 0565282
Only wrap `generates_deck` in a BoolValue when moving in and out of p…
eapolinario c0fd23a
Streaming Deck
Future-Outlier File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,10 +41,6 @@ | |
scatter plots or Markdown text. In addition, users can create new decks to render | ||
their data with custom renderers. | ||
.. warning:: | ||
This feature is in beta. | ||
Comment on lines
-44
to
-47
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nice. |
||
.. code-block:: python | ||
iris_df = px.data.iris() | ||
|
@@ -86,6 +82,17 @@ | |
def html(self) -> str: | ||
return self._html | ||
|
||
@staticmethod | ||
def publish(): | ||
params = FlyteContextManager.current_context().user_space_params | ||
task_name = params.task_id.name | ||
|
||
if not params.enable_deck: | ||
eapolinario marked this conversation as resolved.
Show resolved
Hide resolved
|
||
logger.warning("Call to Deck.publish() will not generate flyte decks as enable_deck=False") | ||
pingsutw marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
return | ||
|
||
_output_deck(task_name=task_name, new_user_params=params) | ||
|
||
|
||
class TimeLineDeck(Deck): | ||
""" | ||
|
@@ -148,7 +155,8 @@ | |
|
||
|
||
def _get_deck( | ||
new_user_params: ExecutionParameters, ignore_jupyter: bool = False | ||
new_user_params: ExecutionParameters, | ||
ignore_jupyter: bool = False, | ||
) -> typing.Union[str, "IPython.core.display.HTML"]: # type:ignore | ||
""" | ||
Get flyte deck html string | ||
|
@@ -176,11 +184,12 @@ | |
|
||
def _output_deck(task_name: str, new_user_params: ExecutionParameters): | ||
ctx = FlyteContext.current_context() | ||
|
||
local_dir = ctx.file_access.get_random_local_directory() | ||
local_path = f"{local_dir}{os.sep}{DECK_FILE_NAME}" | ||
try: | ||
with open(local_path, "w", encoding="utf-8") as f: | ||
f.write(_get_deck(new_user_params, ignore_jupyter=True)) | ||
f.write(_get_deck(new_user_params=new_user_params, ignore_jupyter=True)) | ||
logger.info(f"{task_name} task creates flyte deck html to file://{local_path}") | ||
if ctx.execution_state.mode == ExecutionState.Mode.TASK_EXECUTION: | ||
fs = ctx.file_access.get_filesystem_for_path(new_user_params.output_metadata_prefix) | ||
|
@@ -197,6 +206,7 @@ | |
def get_deck_template() -> Template: | ||
root = os.path.dirname(os.path.abspath(__file__)) | ||
templates_dir = os.path.join(root, "html", "template.html") | ||
|
||
with open(templates_dir, "r") as f: | ||
template_content = f.read() | ||
return Template(template_content) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.