outerbounds 0.3.183rc1__py3-none-any.whl → 0.3.185__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.
- outerbounds/__init__.py +1 -3
- outerbounds/command_groups/apps_cli.py +6 -2
- {outerbounds-0.3.183rc1.dist-info → outerbounds-0.3.185.dist-info}/METADATA +3 -3
- {outerbounds-0.3.183rc1.dist-info → outerbounds-0.3.185.dist-info}/RECORD +6 -29
- outerbounds-0.3.185.dist-info/entry_points.txt +3 -0
- outerbounds/_vendor/spinner/__init__.py +0 -4
- outerbounds/_vendor/spinner/spinners.py +0 -478
- outerbounds/_vendor/spinner.LICENSE +0 -21
- outerbounds/apps/__init__.py +0 -0
- outerbounds/apps/_state_machine.py +0 -472
- outerbounds/apps/app_cli.py +0 -1514
- outerbounds/apps/app_config.py +0 -296
- outerbounds/apps/artifacts.py +0 -0
- outerbounds/apps/capsule.py +0 -839
- outerbounds/apps/cli_to_config.py +0 -99
- outerbounds/apps/click_importer.py +0 -24
- outerbounds/apps/code_package/__init__.py +0 -3
- outerbounds/apps/code_package/code_packager.py +0 -610
- outerbounds/apps/code_package/examples.py +0 -125
- outerbounds/apps/config_schema.yaml +0 -269
- outerbounds/apps/config_schema_autogen.json +0 -336
- outerbounds/apps/dependencies.py +0 -115
- outerbounds/apps/deployer.py +0 -0
- outerbounds/apps/experimental/__init__.py +0 -110
- outerbounds/apps/perimeters.py +0 -45
- outerbounds/apps/secrets.py +0 -164
- outerbounds/apps/utils.py +0 -234
- outerbounds/apps/validations.py +0 -22
- outerbounds-0.3.183rc1.dist-info/entry_points.txt +0 -3
- {outerbounds-0.3.183rc1.dist-info → outerbounds-0.3.185.dist-info}/WHEEL +0 -0
@@ -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", "storage"]:
|
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
|
@@ -1,24 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
The purpose of this file is a little bit of cleverness to allow us to use the CLI in this package across
|
3
|
-
metaflow and outerbounds projects.
|
4
|
-
|
5
|
-
The issue is that since outerbounds and metaflow both vendor click, we can't use object from one import path
|
6
|
-
and expect them to work with objects created from the other import path.
|
7
|
-
|
8
|
-
Meaning `outerbounds._vendor.click.Group` and `metaflow._vendor.click.Group` are different classes.
|
9
|
-
So we need to ensure that based on when the import is taking place, we import the correct class.
|
10
|
-
|
11
|
-
Overall, this ONLY affects constructs in click we are using to construct related to the cli decorators but
|
12
|
-
it doesn't affect any capabilities in click for logging.
|
13
|
-
"""
|
14
|
-
import os
|
15
|
-
|
16
|
-
# Import Hacks
|
17
|
-
if os.environ.get("APPS_CLI_LOADING_IN_METAFLOW", None):
|
18
|
-
from metaflow._vendor import click as metaflow_click
|
19
|
-
|
20
|
-
click = metaflow_click # type: ignore
|
21
|
-
else:
|
22
|
-
from outerbounds._vendor import click as outerbounds_click
|
23
|
-
|
24
|
-
click = outerbounds_click # type: ignore
|