From d02cb1776eb0d1079a80320e9f814e5ac6d75778 Mon Sep 17 00:00:00 2001 From: Eduardo Apolinario <653394+eapolinario@users.noreply.github.com> Date: Wed, 8 Feb 2023 09:56:59 -0800 Subject: [PATCH 1/3] Revert "Remove project/domain from being overridden with execution values in serialized context (#1378)" This reverts commit b3bfef5815623ba3e717540ce700b21d494fefe9. --- flytekit/bin/entrypoint.py | 2 ++ .../unit/bin/test_python_entrypoint.py | 18 ------------------ 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/flytekit/bin/entrypoint.py b/flytekit/bin/entrypoint.py index fe38f946f9..4f4962309d 100644 --- a/flytekit/bin/entrypoint.py +++ b/flytekit/bin/entrypoint.py @@ -270,6 +270,8 @@ def setup_execution( if compressed_serialization_settings: ss = SerializationSettings.from_transport(compressed_serialization_settings) ssb = ss.new_builder() + ssb.project = exe_project + ssb.domain = exe_domain ssb.version = tk_version if dynamic_addl_distro: ssb.fast_serialization_settings = FastSerializationSettings( diff --git a/tests/flytekit/unit/bin/test_python_entrypoint.py b/tests/flytekit/unit/bin/test_python_entrypoint.py index 6a8b8c430e..57038081ac 100644 --- a/tests/flytekit/unit/bin/test_python_entrypoint.py +++ b/tests/flytekit/unit/bin/test_python_entrypoint.py @@ -1,4 +1,3 @@ -import os import typing from collections import OrderedDict @@ -7,7 +6,6 @@ from flyteidl.core.errors_pb2 import ErrorDocument from flytekit.bin.entrypoint import _dispatch_execute, normalize_inputs, setup_execution -from flytekit.configuration import Image, ImageConfig, SerializationSettings from flytekit.core import context_manager from flytekit.core.base_task import IgnoreOutputs from flytekit.core.data_persistence import DiskPersistence @@ -324,22 +322,6 @@ def test_setup_cloud_prefix(): assert isinstance(ctx.file_access._default_remote, GCSPersistence) -def test_persist_ss(): - default_img = Image(name="default", fqn="test", tag="tag") - ss = SerializationSettings( - project="proj1", - domain="dom", - version="version123", - env=None, - image_config=ImageConfig(default_image=default_img, images=[default_img]), - ) - ss_txt = ss.serialized_context - os.environ["_F_SS_C"] = ss_txt - with setup_execution("s3://", checkpoint_path=None, prev_checkpoint=None) as ctx: - assert ctx.serialization_settings.project == "proj1" - assert ctx.serialization_settings.domain == "dom" - - def test_normalize_inputs(): assert normalize_inputs("{{.rawOutputDataPrefix}}", "{{.checkpointOutputPrefix}}", "{{.prevCheckpointPrefix}}") == ( None, From e9742471baa144b7a17acd40a38792729156a650 Mon Sep 17 00:00:00 2001 From: Eduardo Apolinario Date: Wed, 8 Feb 2023 10:12:13 -0800 Subject: [PATCH 2/3] Import os Signed-off-by: Eduardo Apolinario --- tests/flytekit/unit/bin/test_python_entrypoint.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/flytekit/unit/bin/test_python_entrypoint.py b/tests/flytekit/unit/bin/test_python_entrypoint.py index 57038081ac..8f6f0ace64 100644 --- a/tests/flytekit/unit/bin/test_python_entrypoint.py +++ b/tests/flytekit/unit/bin/test_python_entrypoint.py @@ -1,4 +1,5 @@ import typing +import os from collections import OrderedDict import mock From 1213ddf5c17046c1b99c84e857b5303526489af3 Mon Sep 17 00:00:00 2001 From: Eduardo Apolinario Date: Wed, 8 Feb 2023 10:19:38 -0800 Subject: [PATCH 3/3] Lint Signed-off-by: Eduardo Apolinario --- tests/flytekit/unit/bin/test_python_entrypoint.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/flytekit/unit/bin/test_python_entrypoint.py b/tests/flytekit/unit/bin/test_python_entrypoint.py index 8f6f0ace64..6dd1785585 100644 --- a/tests/flytekit/unit/bin/test_python_entrypoint.py +++ b/tests/flytekit/unit/bin/test_python_entrypoint.py @@ -1,5 +1,5 @@ -import typing import os +import typing from collections import OrderedDict import mock