Skip to content

Commit

Permalink
Use scarf images (#1434)
Browse files Browse the repository at this point in the history
* Use scarf images

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

* Use scarf names in tests.

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 committed Feb 22, 2023
1 parent 56a7fcd commit 0baa756
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions flytekit/configuration/default_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ class DefaultImages(object):
"""

_DEFAULT_IMAGE_PREFIXES = {
PythonVersion.PYTHON_3_7: "ghcr.io/flyteorg/flytekit:py3.7-",
PythonVersion.PYTHON_3_8: "ghcr.io/flyteorg/flytekit:py3.8-",
PythonVersion.PYTHON_3_9: "ghcr.io/flyteorg/flytekit:py3.9-",
PythonVersion.PYTHON_3_10: "ghcr.io/flyteorg/flytekit:py3.10-",
PythonVersion.PYTHON_3_7: "cr.flyte.org/flyteorg/flytekit:py3.7-",
PythonVersion.PYTHON_3_8: "cr.flyte.org/flyteorg/flytekit:py3.8-",
PythonVersion.PYTHON_3_9: "cr.flyte.org/flyteorg/flytekit:py3.9-",
PythonVersion.PYTHON_3_10: "cr.flyte.org/flyteorg/flytekit:py3.10-",
}

@classmethod
Expand Down
20 changes: 10 additions & 10 deletions tests/flytekit/unit/configuration/test_image_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
@pytest.mark.parametrize(
"python_version_enum, expected_image_string",
[
(PythonVersion.PYTHON_3_7, "ghcr.io/flyteorg/flytekit:py3.7-latest"),
(PythonVersion.PYTHON_3_8, "ghcr.io/flyteorg/flytekit:py3.8-latest"),
(PythonVersion.PYTHON_3_9, "ghcr.io/flyteorg/flytekit:py3.9-latest"),
(PythonVersion.PYTHON_3_10, "ghcr.io/flyteorg/flytekit:py3.10-latest"),
(PythonVersion.PYTHON_3_7, "cr.flyte.org/flyteorg/flytekit:py3.7-latest"),
(PythonVersion.PYTHON_3_8, "cr.flyte.org/flyteorg/flytekit:py3.8-latest"),
(PythonVersion.PYTHON_3_9, "cr.flyte.org/flyteorg/flytekit:py3.9-latest"),
(PythonVersion.PYTHON_3_10, "cr.flyte.org/flyteorg/flytekit:py3.10-latest"),
],
)
def test_defaults(python_version_enum, expected_image_string):
Expand All @@ -24,8 +24,8 @@ def test_defaults(python_version_enum, expected_image_string):
@pytest.mark.parametrize(
"python_version_enum, flytekit_version, expected_image_string",
[
(PythonVersion.PYTHON_3_7, "v0.32.0", "ghcr.io/flyteorg/flytekit:py3.7-0.32.0"),
(PythonVersion.PYTHON_3_8, "1.31.3", "ghcr.io/flyteorg/flytekit:py3.8-1.31.3"),
(PythonVersion.PYTHON_3_7, "v0.32.0", "cr.flyte.org/flyteorg/flytekit:py3.7-0.32.0"),
(PythonVersion.PYTHON_3_8, "1.31.3", "cr.flyte.org/flyteorg/flytekit:py3.8-1.31.3"),
],
)
def test_set_both(python_version_enum, flytekit_version, expected_image_string):
Expand All @@ -36,7 +36,7 @@ def test_image_config_auto():
x = ImageConfig.auto_default_image()
assert x.images[0].name == "default"
version_str = f"{sys.version_info.major}.{sys.version_info.minor}"
assert x.images[0].full == f"ghcr.io/flyteorg/flytekit:py{version_str}-latest"
assert x.images[0].full == f"cr.flyte.org/flyteorg/flytekit:py{version_str}-latest"


def test_image_from_flytectl_config():
Expand All @@ -56,7 +56,7 @@ def test_not_version(mock_sys):

def test_image_create():
with pytest.raises(ValueError):
ImageConfig.create_from("ghcr.io/im/g:latest")
ImageConfig.create_from("cr.flyte.org/im/g:latest")

ic = ImageConfig.from_images("ghcr.io/im/g:latest")
assert ic.default_image.fqn == "ghcr.io/im/g"
ic = ImageConfig.from_images("cr.flyte.org/im/g:latest")
assert ic.default_image.fqn == "cr.flyte.org/im/g"

0 comments on commit 0baa756

Please sign in to comment.