ob-metaflow-extensions 1.1.175rc1__py2.py3-none-any.whl → 1.1.175rc3__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ob-metaflow-extensions might be problematic. Click here for more details.
- metaflow_extensions/outerbounds/plugins/__init__.py +1 -1
- metaflow_extensions/outerbounds/plugins/apps/app_deploy_decorator.py +112 -0
- metaflow_extensions/outerbounds/plugins/apps/core/__init__.py +9 -0
- metaflow_extensions/outerbounds/plugins/apps/core/app_cli.py +42 -374
- metaflow_extensions/outerbounds/plugins/apps/core/app_config.py +45 -225
- metaflow_extensions/outerbounds/plugins/apps/core/capsule.py +22 -6
- metaflow_extensions/outerbounds/plugins/apps/core/code_package/code_packager.py +16 -15
- metaflow_extensions/outerbounds/plugins/apps/core/config/__init__.py +12 -0
- metaflow_extensions/outerbounds/plugins/apps/core/config/cli_generator.py +161 -0
- metaflow_extensions/outerbounds/plugins/apps/core/config/config_utils.py +828 -0
- metaflow_extensions/outerbounds/plugins/apps/core/config/schema_export.py +285 -0
- metaflow_extensions/outerbounds/plugins/apps/core/config/typed_configs.py +104 -0
- metaflow_extensions/outerbounds/plugins/apps/core/config/typed_init_generator.py +317 -0
- metaflow_extensions/outerbounds/plugins/apps/core/config/unified_config.py +994 -0
- metaflow_extensions/outerbounds/plugins/apps/core/config_schema.yaml +217 -211
- metaflow_extensions/outerbounds/plugins/apps/core/dependencies.py +3 -3
- metaflow_extensions/outerbounds/plugins/apps/core/deployer.py +132 -0
- metaflow_extensions/outerbounds/plugins/apps/core/experimental/__init__.py +4 -36
- metaflow_extensions/outerbounds/plugins/apps/core/perimeters.py +44 -2
- metaflow_extensions/outerbounds/plugins/apps/core/validations.py +4 -9
- metaflow_extensions/outerbounds/toplevel/global_aliases_for_metaflow_package.py +1 -0
- metaflow_extensions/outerbounds/toplevel/ob_internal.py +1 -0
- {ob_metaflow_extensions-1.1.175rc1.dist-info → ob_metaflow_extensions-1.1.175rc3.dist-info}/METADATA +1 -1
- {ob_metaflow_extensions-1.1.175rc1.dist-info → ob_metaflow_extensions-1.1.175rc3.dist-info}/RECORD +26 -20
- metaflow_extensions/outerbounds/plugins/apps/core/cli_to_config.py +0 -99
- metaflow_extensions/outerbounds/plugins/apps/core/config_schema_autogen.json +0 -336
- {ob_metaflow_extensions-1.1.175rc1.dist-info → ob_metaflow_extensions-1.1.175rc3.dist-info}/WHEEL +0 -0
- {ob_metaflow_extensions-1.1.175rc1.dist-info → ob_metaflow_extensions-1.1.175rc3.dist-info}/top_level.txt +0 -0
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
from functools import wraps
|
|
2
|
-
from ..click_importer import click
|
|
3
1
|
import os
|
|
4
2
|
from typing import TYPE_CHECKING
|
|
5
3
|
|
|
@@ -9,40 +7,6 @@ if TYPE_CHECKING:
|
|
|
9
7
|
DEFAULT_BRANCH = "test"
|
|
10
8
|
|
|
11
9
|
|
|
12
|
-
def wrapping_cli_options(func):
|
|
13
|
-
@click.option(
|
|
14
|
-
"--project",
|
|
15
|
-
type=str,
|
|
16
|
-
help="The flow project the app/endpoint belongs to",
|
|
17
|
-
default=None,
|
|
18
|
-
)
|
|
19
|
-
@click.option(
|
|
20
|
-
"--branch",
|
|
21
|
-
type=str,
|
|
22
|
-
help="The branch the app/endpoint belongs to",
|
|
23
|
-
default=None,
|
|
24
|
-
)
|
|
25
|
-
@wraps(func)
|
|
26
|
-
def wrapper(*args, **kwargs):
|
|
27
|
-
return func(*args, **kwargs)
|
|
28
|
-
|
|
29
|
-
return wrapper
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
def build_config_from_options(options):
|
|
33
|
-
"""Build an app configuration from CLI options."""
|
|
34
|
-
keys = [
|
|
35
|
-
"project",
|
|
36
|
-
"branch",
|
|
37
|
-
]
|
|
38
|
-
config = {}
|
|
39
|
-
for key in keys:
|
|
40
|
-
if options.get(key):
|
|
41
|
-
config[key] = options.get(key)
|
|
42
|
-
|
|
43
|
-
return config
|
|
44
|
-
|
|
45
|
-
|
|
46
10
|
# Account for project / branch and the capsule input.
|
|
47
11
|
def capsule_input_overrides(app_config: "AppConfig", capsule_input: dict):
|
|
48
12
|
project = app_config.get_state("project", None)
|
|
@@ -53,6 +17,10 @@ def capsule_input_overrides(app_config: "AppConfig", capsule_input: dict):
|
|
|
53
17
|
[dict(key="project", value=project), dict(key="branch", value=branch)]
|
|
54
18
|
)
|
|
55
19
|
|
|
20
|
+
persistence = app_config.get_state("persistence", None)
|
|
21
|
+
if persistence is not None and persistence != "none":
|
|
22
|
+
capsule_input["persistence"] = persistence
|
|
23
|
+
|
|
56
24
|
model_asset_conf = app_config.get_state("models", None)
|
|
57
25
|
data_asset_conf = app_config.get_state("data", None)
|
|
58
26
|
code_info = _code_info(app_config)
|
|
@@ -41,5 +41,47 @@ class PerimeterExtractor:
|
|
|
41
41
|
|
|
42
42
|
@classmethod
|
|
43
43
|
def during_metaflow_execution(cls) -> str:
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
from metaflow.metaflow_config_funcs import init_config
|
|
45
|
+
|
|
46
|
+
clean_url = (
|
|
47
|
+
lambda url: f"https://{url}".rstrip("/")
|
|
48
|
+
if not url.startswith("https://")
|
|
49
|
+
else url
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
config = init_config()
|
|
53
|
+
api_server, perimeter, integrations_url = None, None, None
|
|
54
|
+
perimeter = config.get(
|
|
55
|
+
"OBP_PERIMETER", os.environ.get("OBP_PERIMETER", perimeter)
|
|
56
|
+
)
|
|
57
|
+
if perimeter is None:
|
|
58
|
+
raise RuntimeError(
|
|
59
|
+
"Perimeter not found in metaflow config or environment variables"
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
api_server = config.get(
|
|
63
|
+
"OBP_API_SERVER", os.environ.get("OBP_API_SERVER", api_server)
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
if api_server is not None and not api_server.startswith("https://"):
|
|
67
|
+
api_server = clean_url(api_server)
|
|
68
|
+
|
|
69
|
+
if api_server is not None:
|
|
70
|
+
return perimeter, api_server
|
|
71
|
+
|
|
72
|
+
integrations_url = config.get(
|
|
73
|
+
"OBP_INTEGRATIONS_URL", os.environ.get("OBP_INTEGRATIONS_URL", None)
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
if integrations_url is not None and not integrations_url.startswith("https://"):
|
|
77
|
+
integrations_url = clean_url(integrations_url)
|
|
78
|
+
|
|
79
|
+
if integrations_url is not None:
|
|
80
|
+
api_server = integrations_url.rstrip("/integrations")
|
|
81
|
+
|
|
82
|
+
if api_server is None:
|
|
83
|
+
raise RuntimeError(
|
|
84
|
+
"API server not found in metaflow config or environment variables"
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
return perimeter, api_server
|
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
import os
|
|
2
|
+
from typing import List
|
|
2
3
|
from .app_config import AppConfig, AppConfigError
|
|
3
4
|
from .secrets import SecretRetriever, SecretNotFound
|
|
4
|
-
from .dependencies import bake_deployment_image
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
def
|
|
8
|
-
|
|
9
|
-
# First check if the secrets for the app exist.
|
|
10
|
-
app_secrets = app_config.get("secrets", [])
|
|
7
|
+
def secrets_validator(secrets: List[str]):
|
|
11
8
|
secret_retriever = SecretRetriever()
|
|
12
|
-
for secret in
|
|
9
|
+
for secret in secrets:
|
|
13
10
|
try:
|
|
14
11
|
secret_retriever.get_secret_as_dict(secret)
|
|
15
12
|
except SecretNotFound:
|
|
16
|
-
raise
|
|
17
|
-
|
|
18
|
-
# TODO: Next check if the compute pool exists.
|
|
13
|
+
raise Exception(f"Secret named `{secret}` not found")
|
|
19
14
|
|
|
20
15
|
|
|
21
16
|
def run_validations(app_config: AppConfig):
|
{ob_metaflow_extensions-1.1.175rc1.dist-info → ob_metaflow_extensions-1.1.175rc3.dist-info}/RECORD
RENAMED
|
@@ -1,38 +1,44 @@
|
|
|
1
1
|
metaflow_extensions/outerbounds/__init__.py,sha256=Gb8u06s9ClQsA_vzxmkCzuMnigPy7kKcDnLfb7eB-64,514
|
|
2
2
|
metaflow_extensions/outerbounds/remote_config.py,sha256=pEFJuKDYs98eoB_-ryPjVi9b_c4gpHMdBHE14ltoxIU,4672
|
|
3
3
|
metaflow_extensions/outerbounds/config/__init__.py,sha256=JsQGRuGFz28fQWjUvxUgR8EKBLGRdLUIk_buPLJplJY,1225
|
|
4
|
-
metaflow_extensions/outerbounds/plugins/__init__.py,sha256=
|
|
4
|
+
metaflow_extensions/outerbounds/plugins/__init__.py,sha256=8DmLGwlr6UZWe39rbJdhO5ANemDp2ZwxY6MlqVPCppc,13740
|
|
5
5
|
metaflow_extensions/outerbounds/plugins/auth_server.py,sha256=_Q9_2EL0Xy77bCRphkwT1aSu8gQXRDOH-Z-RxTUO8N4,2202
|
|
6
6
|
metaflow_extensions/outerbounds/plugins/perimeters.py,sha256=QXh3SFP7GQbS-RAIxUOPbhPzQ7KDFVxZkTdKqFKgXjI,2697
|
|
7
7
|
metaflow_extensions/outerbounds/plugins/apps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
8
|
metaflow_extensions/outerbounds/plugins/apps/app_cli.py,sha256=aVgKe2CBcOgXQL2TYgO-sdIFlTntvbjHZFphR1w1CAM,64
|
|
9
|
+
metaflow_extensions/outerbounds/plugins/apps/app_deploy_decorator.py,sha256=aN2B7nf0IwnOg_9kpqVSkGyZPhr4D9YI1WuCSlNP92s,3498
|
|
9
10
|
metaflow_extensions/outerbounds/plugins/apps/app_utils.py,sha256=sw9whU17lAzlD2K2kEDNjlk1Ib-2xE2UNhJkmzD8Qv8,8543
|
|
10
11
|
metaflow_extensions/outerbounds/plugins/apps/consts.py,sha256=iHsyqbUg9k-rgswCs1Jxf5QZIxR1V-peCDRjgr9kdBM,177
|
|
11
12
|
metaflow_extensions/outerbounds/plugins/apps/deploy_decorator.py,sha256=VkmiMdNYHhNdt-Qm9AVv7aE2LWFsIFEc16YcOYjwF6Q,8568
|
|
12
13
|
metaflow_extensions/outerbounds/plugins/apps/supervisord_utils.py,sha256=GQoN2gyPClcpR9cLldJmbCfqXnoAHxp8xUnY7vzaYtY,9026
|
|
13
|
-
metaflow_extensions/outerbounds/plugins/apps/core/__init__.py,sha256=
|
|
14
|
+
metaflow_extensions/outerbounds/plugins/apps/core/__init__.py,sha256=c6uCgKlgEkTmM9BVdAO-m3vZvUpK2KW_AZZ2236now4,237
|
|
14
15
|
metaflow_extensions/outerbounds/plugins/apps/core/_state_machine.py,sha256=8RvEqRI9WaUiFu2LBKIqWRbbe9bSM2EptTR56wPit-0,18434
|
|
15
|
-
metaflow_extensions/outerbounds/plugins/apps/core/app_cli.py,sha256=
|
|
16
|
-
metaflow_extensions/outerbounds/plugins/apps/core/app_config.py,sha256=
|
|
16
|
+
metaflow_extensions/outerbounds/plugins/apps/core/app_cli.py,sha256=HR4nQXyxHSe6NbUF0mutsOQR_rIT-_U6C-mdSQ1_8Os,42326
|
|
17
|
+
metaflow_extensions/outerbounds/plugins/apps/core/app_config.py,sha256=PHt-HdNfTHIuhY-eB5vkRMp1RKQNWJ4DKdgZWyYgUuc,4167
|
|
17
18
|
metaflow_extensions/outerbounds/plugins/apps/core/artifacts.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
|
-
metaflow_extensions/outerbounds/plugins/apps/core/capsule.py,sha256=
|
|
19
|
-
metaflow_extensions/outerbounds/plugins/apps/core/cli_to_config.py,sha256=2_VC1Ezn5RdtEkD-v4V_sk65ARluRtE-QQ0K6XE8Cbg,3296
|
|
19
|
+
metaflow_extensions/outerbounds/plugins/apps/core/capsule.py,sha256=kOyHX8mzt44N4x4MKXCcBTZxS9ZcmRcUgbVuTgAMPpA,33879
|
|
20
20
|
metaflow_extensions/outerbounds/plugins/apps/core/click_importer.py,sha256=kgoPQmK_-8PSSTc3QMSaynCLQ5VWTkKFOC69FPURyXA,998
|
|
21
|
-
metaflow_extensions/outerbounds/plugins/apps/core/config_schema.yaml,sha256=
|
|
22
|
-
metaflow_extensions/outerbounds/plugins/apps/core/
|
|
23
|
-
metaflow_extensions/outerbounds/plugins/apps/core/
|
|
24
|
-
metaflow_extensions/outerbounds/plugins/apps/core/
|
|
25
|
-
metaflow_extensions/outerbounds/plugins/apps/core/perimeters.py,sha256=1J1_-5legFPskv3HTRwQMpzTytE3TO8KRT2IvVOrWcQ,1584
|
|
21
|
+
metaflow_extensions/outerbounds/plugins/apps/core/config_schema.yaml,sha256=iTThO2vNQrFWe9nYfjiOcMf6FOQ6vU_1ZhXhUAr0L24,8142
|
|
22
|
+
metaflow_extensions/outerbounds/plugins/apps/core/dependencies.py,sha256=HDPj7rDARcsKeex5GwH0IP8rOXMH6YdOufgXDknP1S8,4006
|
|
23
|
+
metaflow_extensions/outerbounds/plugins/apps/core/deployer.py,sha256=oARCVpHSNb7MnCKnIvzNB6fGDfF7BvAB19hDobETuZc,4234
|
|
24
|
+
metaflow_extensions/outerbounds/plugins/apps/core/perimeters.py,sha256=jeFGAUnFQkBFiOMp_Ls7Ofb80Qogh509suam5sMucYU,3030
|
|
26
25
|
metaflow_extensions/outerbounds/plugins/apps/core/secrets.py,sha256=aWzcAayQEJghQgFP_qp9w6jyvan_hoL4_ceqZ0ZjLd4,6126
|
|
27
26
|
metaflow_extensions/outerbounds/plugins/apps/core/utils.py,sha256=RLO6p25Fzq4olLFtQmfSl9LT0NPDfUosxPrsjO9sczo,7897
|
|
28
|
-
metaflow_extensions/outerbounds/plugins/apps/core/validations.py,sha256=
|
|
27
|
+
metaflow_extensions/outerbounds/plugins/apps/core/validations.py,sha256=Inr9AJDe-L3PMMMxcJPH1zulh9_SynqITb2BzGseLh4,471
|
|
29
28
|
metaflow_extensions/outerbounds/plugins/apps/core/_vendor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
30
29
|
metaflow_extensions/outerbounds/plugins/apps/core/_vendor/spinner/__init__.py,sha256=gTm0NdQGTRxmghye1CYkhRtodji0MezsqAWs9OrLLRc,102
|
|
31
30
|
metaflow_extensions/outerbounds/plugins/apps/core/_vendor/spinner/spinners.py,sha256=0Hl1dskTzfibHPM5dfHV3no1maFduOCJ48r8mr3tgr0,15786
|
|
32
31
|
metaflow_extensions/outerbounds/plugins/apps/core/code_package/__init__.py,sha256=8McF7pgx8ghvjRnazp2Qktlxi9yYwNiwESSQrk-2oW8,68
|
|
33
|
-
metaflow_extensions/outerbounds/plugins/apps/core/code_package/code_packager.py,sha256=
|
|
32
|
+
metaflow_extensions/outerbounds/plugins/apps/core/code_package/code_packager.py,sha256=wrGKpsg9pBU2rvhIveJ3kzc5ODUTtzciybcGHyi7pR8,22815
|
|
34
33
|
metaflow_extensions/outerbounds/plugins/apps/core/code_package/examples.py,sha256=aF8qKIJxCVv_ugcShQjqUsXKKKMsm1oMkQIl8w3QKuw,4016
|
|
35
|
-
metaflow_extensions/outerbounds/plugins/apps/core/
|
|
34
|
+
metaflow_extensions/outerbounds/plugins/apps/core/config/__init__.py,sha256=fSFBjC5ujTpBlNJGyVsaoWl5VZ_8mXbEIPiFvzTrgKA,382
|
|
35
|
+
metaflow_extensions/outerbounds/plugins/apps/core/config/cli_generator.py,sha256=0R0-wy7RxAMR9doVRvuluRYxAYgyjZXlTIkOeYGyz7M,5350
|
|
36
|
+
metaflow_extensions/outerbounds/plugins/apps/core/config/config_utils.py,sha256=zBZSe-1CsHj5MxrKNuAGLy11yXD4qF_IJJkdORfCW6A,32089
|
|
37
|
+
metaflow_extensions/outerbounds/plugins/apps/core/config/schema_export.py,sha256=tigPtb0we-urwbmctG1GbaQ9NKRKZn4KBbJKmaEntCg,9501
|
|
38
|
+
metaflow_extensions/outerbounds/plugins/apps/core/config/typed_configs.py,sha256=RufXI8BQn6G5kixY6P27VYJ0d36ZG-JNFW15bA1bnk4,3179
|
|
39
|
+
metaflow_extensions/outerbounds/plugins/apps/core/config/typed_init_generator.py,sha256=1iszHsXjxAWeGI4XhwoTT8lVtzQwstF3ZOiVYBykO6w,10256
|
|
40
|
+
metaflow_extensions/outerbounds/plugins/apps/core/config/unified_config.py,sha256=58PsC1ZK3p5wNvavVRzb4Qq764wOUjPuSvXDsrrsSw4,35474
|
|
41
|
+
metaflow_extensions/outerbounds/plugins/apps/core/experimental/__init__.py,sha256=rd4qGTkHndKYfJmoAKZWiY0KK4j5BK6RBrtle-it1Mg,2746
|
|
36
42
|
metaflow_extensions/outerbounds/plugins/aws/__init__.py,sha256=VBGdjNKeFLXGZuqh4jVk8cFtO1AWof73a6k_cnbAOYA,145
|
|
37
43
|
metaflow_extensions/outerbounds/plugins/aws/assume_role.py,sha256=mBewNlnSYsR2rFXFkX-DUH6ku01h2yOcMcLHoCL7eyI,161
|
|
38
44
|
metaflow_extensions/outerbounds/plugins/aws/assume_role_decorator.py,sha256=b3te8-RJxsj5cqXbQTFxxeIfnqTERAFInzLgXLVLyYA,2391
|
|
@@ -100,8 +106,8 @@ metaflow_extensions/outerbounds/plugins/vllm/vllm_manager.py,sha256=sp_TX2SrImJG
|
|
|
100
106
|
metaflow_extensions/outerbounds/profilers/__init__.py,sha256=wa_jhnCBr82TBxoS0e8b6_6sLyZX0fdHicuGJZNTqKw,29
|
|
101
107
|
metaflow_extensions/outerbounds/profilers/gpu.py,sha256=3Er8uKQzfm_082uadg4yn_D4Y-iSCgzUfFmguYxZsz4,27485
|
|
102
108
|
metaflow_extensions/outerbounds/toplevel/__init__.py,sha256=qWUJSv_r5hXJ7jV_On4nEasKIfUCm6_UjkjXWA_A1Ts,90
|
|
103
|
-
metaflow_extensions/outerbounds/toplevel/global_aliases_for_metaflow_package.py,sha256=
|
|
104
|
-
metaflow_extensions/outerbounds/toplevel/ob_internal.py,sha256=
|
|
109
|
+
metaflow_extensions/outerbounds/toplevel/global_aliases_for_metaflow_package.py,sha256=xVCIvKeEzMwu2vfsWYqnq4aetMGmPBjpzOXrZfBr5iI,3036
|
|
110
|
+
metaflow_extensions/outerbounds/toplevel/ob_internal.py,sha256=DXCaAtLzlE-bFIiVWEv-iV2JKIWsoSGaUeH4jIQZ9gs,193
|
|
105
111
|
metaflow_extensions/outerbounds/toplevel/plugins/azure/__init__.py,sha256=WUuhz2YQfI4fz7nIcipwwWq781eaoHEk7n4GAn1npDg,63
|
|
106
112
|
metaflow_extensions/outerbounds/toplevel/plugins/gcp/__init__.py,sha256=BbZiaH3uILlEZ6ntBLKeNyqn3If8nIXZFq_Apd7Dhco,70
|
|
107
113
|
metaflow_extensions/outerbounds/toplevel/plugins/kubernetes/__init__.py,sha256=5zG8gShSj8m7rgF4xgWBZFuY3GDP5n1T0ktjRpGJLHA,69
|
|
@@ -109,7 +115,7 @@ metaflow_extensions/outerbounds/toplevel/plugins/ollama/__init__.py,sha256=GRSz2
|
|
|
109
115
|
metaflow_extensions/outerbounds/toplevel/plugins/snowflake/__init__.py,sha256=LptpH-ziXHrednMYUjIaosS1SXD3sOtF_9_eRqd8SJw,50
|
|
110
116
|
metaflow_extensions/outerbounds/toplevel/plugins/torchtune/__init__.py,sha256=uTVkdSk3xZ7hEKYfdlyVteWj5KeDwaM1hU9WT-_YKfI,50
|
|
111
117
|
metaflow_extensions/outerbounds/toplevel/plugins/vllm/__init__.py,sha256=ekcgD3KVydf-a0xMI60P4uy6ePkSEoFHiGnDq1JM940,45
|
|
112
|
-
ob_metaflow_extensions-1.1.
|
|
113
|
-
ob_metaflow_extensions-1.1.
|
|
114
|
-
ob_metaflow_extensions-1.1.
|
|
115
|
-
ob_metaflow_extensions-1.1.
|
|
118
|
+
ob_metaflow_extensions-1.1.175rc3.dist-info/METADATA,sha256=wnDlhzELSLX2xxzL6U87sqIbb1tWYehFruJ783o-8Gg,524
|
|
119
|
+
ob_metaflow_extensions-1.1.175rc3.dist-info/WHEEL,sha256=bb2Ot9scclHKMOLDEHY6B2sicWOgugjFKaJsT7vwMQo,110
|
|
120
|
+
ob_metaflow_extensions-1.1.175rc3.dist-info/top_level.txt,sha256=NwG0ukwjygtanDETyp_BUdtYtqIA_lOjzFFh1TsnxvI,20
|
|
121
|
+
ob_metaflow_extensions-1.1.175rc3.dist-info/RECORD,,
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
from . import experimental
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
def build_config_from_options(options):
|
|
5
|
-
"""Build an app configuration from CLI options."""
|
|
6
|
-
config = {}
|
|
7
|
-
|
|
8
|
-
# Set basic fields
|
|
9
|
-
for key in [
|
|
10
|
-
"name",
|
|
11
|
-
"port",
|
|
12
|
-
"image",
|
|
13
|
-
"compute_pools",
|
|
14
|
-
"description",
|
|
15
|
-
"app_type",
|
|
16
|
-
"force_upgrade",
|
|
17
|
-
]:
|
|
18
|
-
if options.get(key):
|
|
19
|
-
config[key] = options[key]
|
|
20
|
-
|
|
21
|
-
# Handle list fields
|
|
22
|
-
if options.get("tags"):
|
|
23
|
-
config["tags"] = list(options["tags"])
|
|
24
|
-
if options.get("secrets"):
|
|
25
|
-
config["secrets"] = list(options["secrets"])
|
|
26
|
-
|
|
27
|
-
# Build env dict from key-value pairs
|
|
28
|
-
if options.get("envs"):
|
|
29
|
-
env_dict = {}
|
|
30
|
-
for env_item in options["envs"]:
|
|
31
|
-
env_dict.update(env_item)
|
|
32
|
-
config["environment"] = env_dict
|
|
33
|
-
|
|
34
|
-
# Handle dependencies (only one type allowed)
|
|
35
|
-
deps = {}
|
|
36
|
-
if options.get("dep_from_task"):
|
|
37
|
-
deps["from_task"] = options["dep_from_task"]
|
|
38
|
-
elif options.get("dep_from_run"):
|
|
39
|
-
deps["from_run"] = options["dep_from_run"]
|
|
40
|
-
elif options.get("dep_from_requirements"):
|
|
41
|
-
deps["from_requirements_file"] = options["dep_from_requirements"]
|
|
42
|
-
elif options.get("dep_from_pyproject"):
|
|
43
|
-
deps["from_pyproject_toml"] = options["dep_from_pyproject"]
|
|
44
|
-
|
|
45
|
-
# TODO: [FIX ME]: Get better CLI abstraction for pypi/conda dependencies
|
|
46
|
-
|
|
47
|
-
if deps:
|
|
48
|
-
config["dependencies"] = deps
|
|
49
|
-
|
|
50
|
-
# Handle resources
|
|
51
|
-
resources = {}
|
|
52
|
-
for key in ["cpu", "memory", "gpu", "disk"]:
|
|
53
|
-
if options.get(key):
|
|
54
|
-
resources[key] = options[key]
|
|
55
|
-
|
|
56
|
-
if resources:
|
|
57
|
-
config["resources"] = resources
|
|
58
|
-
|
|
59
|
-
# Handle health check options
|
|
60
|
-
health_check = {}
|
|
61
|
-
if options.get("health_check_enabled") is not None:
|
|
62
|
-
health_check["enabled"] = options["health_check_enabled"]
|
|
63
|
-
if options.get("health_check_path"):
|
|
64
|
-
health_check["path"] = options["health_check_path"]
|
|
65
|
-
if options.get("health_check_initial_delay") is not None:
|
|
66
|
-
health_check["initial_delay_seconds"] = options["health_check_initial_delay"]
|
|
67
|
-
if options.get("health_check_period") is not None:
|
|
68
|
-
health_check["period_seconds"] = options["health_check_period"]
|
|
69
|
-
|
|
70
|
-
if health_check:
|
|
71
|
-
config["health_check"] = health_check
|
|
72
|
-
|
|
73
|
-
# Handle package options
|
|
74
|
-
if options.get("package_src_path") or options.get("package_suffixes"):
|
|
75
|
-
config["package"] = {}
|
|
76
|
-
if options.get("package_src_path"):
|
|
77
|
-
config["package"]["src_path"] = options["package_src_path"]
|
|
78
|
-
if options.get("package_suffixes"):
|
|
79
|
-
config["package"]["suffixes"] = options["package_suffixes"]
|
|
80
|
-
|
|
81
|
-
# Handle auth options
|
|
82
|
-
if options.get("auth_type") or options.get("auth_public"):
|
|
83
|
-
config["auth"] = {}
|
|
84
|
-
if options.get("auth_type"):
|
|
85
|
-
config["auth"]["type"] = options["auth_type"]
|
|
86
|
-
if options.get("auth_public"):
|
|
87
|
-
config["auth"]["public"] = options["auth_public"]
|
|
88
|
-
|
|
89
|
-
replicas = {}
|
|
90
|
-
if options.get("min_replicas") is not None:
|
|
91
|
-
replicas["min"] = options["min_replicas"]
|
|
92
|
-
if options.get("max_replicas") is not None:
|
|
93
|
-
replicas["max"] = options["max_replicas"]
|
|
94
|
-
if len(replicas) > 0:
|
|
95
|
-
config["replicas"] = replicas
|
|
96
|
-
|
|
97
|
-
config.update(experimental.build_config_from_options(options))
|
|
98
|
-
|
|
99
|
-
return config
|