From fb2c24accd1c2823beb7b000b68951274ac0a53f Mon Sep 17 00:00:00 2001 From: Yee Hing Tong Date: Tue, 14 Dec 2021 13:47:24 -0800 Subject: [PATCH 1/3] new spec Signed-off-by: Yee Hing Tong --- flytekit/remote/remote.py | 6 ++++++ tests/flytekit/integration/remote/test_remote.py | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/flytekit/remote/remote.py b/flytekit/remote/remote.py index 60ae7bbf3e..efc1c05dbb 100644 --- a/flytekit/remote/remote.py +++ b/flytekit/remote/remote.py @@ -1117,6 +1117,12 @@ def sync_node_execution( """ # For single task execution - the metadata spec node id is missing. In these cases, revert to regular node id node_id = execution.metadata.spec_node_id + if node_id and node_id not in node_mapping: + node_id = execution.id.node_id + remote_logger.debug( + f"Using node execution ID {node_id} instead of spec node id " + f"{execution.metadata.spec_node_id}, single-task execution likely." + ) if not node_id: node_id = execution.id.node_id remote_logger.debug(f"No metadata spec_node_id found, using {node_id}") diff --git a/tests/flytekit/integration/remote/test_remote.py b/tests/flytekit/integration/remote/test_remote.py index a45c037279..bee4eb6fe6 100644 --- a/tests/flytekit/integration/remote/test_remote.py +++ b/tests/flytekit/integration/remote/test_remote.py @@ -310,3 +310,12 @@ def test_fetch_not_exist_launch_plan(flyteclient): remote = FlyteRemote.from_config(PROJECT, "development") with pytest.raises(FlyteEntityNotExistException): remote.fetch_launch_plan(name="workflows.basic.list_float_wf.fake_wf", version=f"v{VERSION}") + + +def test_jfdkl(): + from flytekit.remote.remote import FlyteRemote + + rr = FlyteRemote.from_config("flytesnacks", "development", config_file_path="/Users/ytong/.flyte/local_sandbox") + version = "ab2c1fee5fc06c7ea329e1e719f4d1abd06c9175" + ft = rr.fetch_task(name="core.control_flow.map_task.a_mappable_task", version=version) + ex = rr.execute(ft, inputs={"a": 5}, wait=True) From bf41dc156bfef50c50547a2f83048493d2ee8152 Mon Sep 17 00:00:00 2001 From: Yee Hing Tong Date: Tue, 14 Dec 2021 13:48:01 -0800 Subject: [PATCH 2/3] nit Signed-off-by: Yee Hing Tong --- tests/flytekit/integration/remote/test_remote.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/tests/flytekit/integration/remote/test_remote.py b/tests/flytekit/integration/remote/test_remote.py index bee4eb6fe6..a45c037279 100644 --- a/tests/flytekit/integration/remote/test_remote.py +++ b/tests/flytekit/integration/remote/test_remote.py @@ -310,12 +310,3 @@ def test_fetch_not_exist_launch_plan(flyteclient): remote = FlyteRemote.from_config(PROJECT, "development") with pytest.raises(FlyteEntityNotExistException): remote.fetch_launch_plan(name="workflows.basic.list_float_wf.fake_wf", version=f"v{VERSION}") - - -def test_jfdkl(): - from flytekit.remote.remote import FlyteRemote - - rr = FlyteRemote.from_config("flytesnacks", "development", config_file_path="/Users/ytong/.flyte/local_sandbox") - version = "ab2c1fee5fc06c7ea329e1e719f4d1abd06c9175" - ft = rr.fetch_task(name="core.control_flow.map_task.a_mappable_task", version=version) - ex = rr.execute(ft, inputs={"a": 5}, wait=True) From b9d09dbd60dae486aec4f33fd39db9818f14a67d Mon Sep 17 00:00:00 2001 From: Yee Hing Tong Date: Tue, 14 Dec 2021 13:48:59 -0800 Subject: [PATCH 3/3] nit Signed-off-by: Yee Hing Tong --- flytekit/remote/remote.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/flytekit/remote/remote.py b/flytekit/remote/remote.py index efc1c05dbb..2178f148d3 100644 --- a/flytekit/remote/remote.py +++ b/flytekit/remote/remote.py @@ -1117,12 +1117,14 @@ def sync_node_execution( """ # For single task execution - the metadata spec node id is missing. In these cases, revert to regular node id node_id = execution.metadata.spec_node_id - if node_id and node_id not in node_mapping: + # This case supports single-task execution compiled workflows. + if node_id and node_id not in node_mapping and execution.id.node_id in node_mapping: node_id = execution.id.node_id remote_logger.debug( f"Using node execution ID {node_id} instead of spec node id " f"{execution.metadata.spec_node_id}, single-task execution likely." ) + # This case supports single-task execution compiled workflows with older versions of admin/propeller if not node_id: node_id = execution.id.node_id remote_logger.debug(f"No metadata spec_node_id found, using {node_id}")