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.
@@ -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,3 +0,0 @@
1
- from .code_packager import CodePackager
2
-
3
- __all__ = ["CodePackager"]