Skip to content

Commit

Permalink
Revert "Remove project/domain from being overridden with execution va…
Browse files Browse the repository at this point in the history
…lues in serialized context (#1378)" (#1460)

* Revert "Remove project/domain from being overridden with execution values in serialized context (#1378)"

This reverts commit b3bfef5.

* Import os

Signed-off-by: Eduardo Apolinario <[email protected]>

* Lint

Signed-off-by: Eduardo Apolinario <[email protected]>

---------

Signed-off-by: Eduardo Apolinario <[email protected]>
Co-authored-by: Eduardo Apolinario <[email protected]>
  • Loading branch information
eapolinario and eapolinario authored Feb 8, 2023
1 parent dee4804 commit 47ac6ac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
2 changes: 2 additions & 0 deletions flytekit/bin/entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
17 changes: 0 additions & 17 deletions tests/flytekit/unit/bin/test_python_entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,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
Expand Down Expand Up @@ -324,22 +323,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,
Expand Down

0 comments on commit 47ac6ac

Please sign in to comment.