outerbounds 0.3.180rc5__py3-none-any.whl → 0.3.181__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/command_groups/cli.py +2 -0
- outerbounds/command_groups/kubernetes_cli.py +479 -0
- {outerbounds-0.3.180rc5.dist-info → outerbounds-0.3.181.dist-info}/METADATA +3 -3
- {outerbounds-0.3.180rc5.dist-info → outerbounds-0.3.181.dist-info}/RECORD +8 -28
- outerbounds-0.3.181.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 -358
- outerbounds/apps/app_cli.py +0 -1312
- outerbounds/apps/app_config.py +0 -293
- outerbounds/apps/artifacts.py +0 -0
- outerbounds/apps/capsule.py +0 -798
- outerbounds/apps/cli_to_config.py +0 -99
- 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 -264
- outerbounds/apps/dependencies.py +0 -115
- outerbounds/apps/deployer.py +0 -0
- outerbounds/apps/experimental/__init__.py +0 -103
- outerbounds/apps/perimeters.py +0 -51
- outerbounds/apps/secrets.py +0 -164
- outerbounds/apps/utils.py +0 -386
- outerbounds/apps/validations.py +0 -22
- outerbounds-0.3.180rc5.dist-info/entry_points.txt +0 -3
- {outerbounds-0.3.180rc5.dist-info → outerbounds-0.3.181.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
|