paasta-tools 1.26.1__py3-none-any.whl → 1.28.0__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.
- paasta_tools/__init__.py +1 -1
- paasta_tools/api/api_docs/swagger.json +16 -3
- paasta_tools/api/tweens/auth.py +2 -1
- paasta_tools/api/views/autoscaler.py +60 -23
- paasta_tools/cli/cmds/autoscale.py +38 -17
- paasta_tools/cli/cmds/local_run.py +2 -2
- paasta_tools/contrib/bounce_log_latency_parser.py +1 -1
- paasta_tools/contrib/ide_helper.py +14 -14
- paasta_tools/contrib/mock_patch_checker.py +1 -1
- paasta_tools/contrib/render_template.py +1 -1
- paasta_tools/contrib/shared_ip_check.py +1 -1
- paasta_tools/instance/kubernetes.py +10 -10
- paasta_tools/kubernetes/application/controller_wrappers.py +4 -1
- paasta_tools/kubernetes_tools.py +7 -3
- paasta_tools/mesos/master.py +1 -1
- paasta_tools/metrics/metastatus_lib.py +1 -1
- paasta_tools/paastaapi/model/autoscaling_override.py +7 -6
- paasta_tools/paastaapi/model/inline_response202.py +5 -2
- paasta_tools/remote_git.py +2 -2
- paasta_tools/run-paasta-api-in-dev-mode.py +2 -2
- paasta_tools/run-paasta-api-playground.py +2 -2
- paasta_tools/setup_kubernetes_job.py +10 -4
- paasta_tools/yaml_tools.py +1 -1
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/ide_helper.py +14 -14
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/setup_kubernetes_job.py +10 -4
- paasta_tools-1.28.0.dist-info/METADATA +79 -0
- {paasta_tools-1.26.1.dist-info → paasta_tools-1.28.0.dist-info}/RECORD +81 -81
- {paasta_tools-1.26.1.dist-info → paasta_tools-1.28.0.dist-info}/WHEEL +1 -1
- paasta_tools-1.26.1.dist-info/METADATA +0 -75
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/apply_external_resources.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/bounce_log_latency_parser.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/check_autoscaler_max_instances.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/check_cassandracluster_services_replication.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/check_flink_services_health.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/check_kubernetes_api.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/check_kubernetes_services_replication.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/check_manual_oapi_changes.sh +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/check_oom_events.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/check_orphans.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/check_spark_jobs.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/cleanup_kubernetes_cr.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/cleanup_kubernetes_crd.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/cleanup_kubernetes_jobs.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/create_dynamodb_table.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/create_paasta_playground.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/delete_kubernetes_deployments.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/emit_allocated_cpu_metrics.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/generate_all_deployments +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/generate_authenticating_services.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/generate_deployments_for_service.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/generate_services_file.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/generate_services_yaml.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/get_running_task_allocation.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/habitat_fixer.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/is_pod_healthy_in_proxy.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/is_pod_healthy_in_smartstack.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/kill_bad_containers.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/kubernetes_remove_evicted_pods.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/mass-deploy-tag.sh +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/mock_patch_checker.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/paasta_cleanup_remote_run_resources.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/paasta_cleanup_stale_nodes.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/paasta_deploy_tron_jobs +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/paasta_execute_docker_command.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/paasta_secrets_sync.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/paasta_tabcomplete.sh +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/paasta_update_soa_memcpu.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/render_template.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/rightsizer_soaconfigs_update.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/service_shard_remove.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/service_shard_update.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/setup_istio_mesh.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/setup_kubernetes_cr.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/setup_kubernetes_crd.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/setup_kubernetes_internal_crd.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/setup_prometheus_adapter_config.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/shared_ip_check.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/synapse_srv_namespaces_fact.py +0 -0
- {paasta_tools-1.26.1.data → paasta_tools-1.28.0.data}/scripts/timeouts_metrics_prom.py +0 -0
- {paasta_tools-1.26.1.dist-info → paasta_tools-1.28.0.dist-info}/entry_points.txt +0 -0
- {paasta_tools-1.26.1.dist-info → paasta_tools-1.28.0.dist-info/licenses}/LICENSE +0 -0
- {paasta_tools-1.26.1.dist-info → paasta_tools-1.28.0.dist-info}/top_level.txt +0 -0
|
@@ -59,9 +59,6 @@ class AutoscalingOverride(ModelNormal):
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
validations = {
|
|
62
|
-
('min_instances',): {
|
|
63
|
-
'inclusive_minimum': 1,
|
|
64
|
-
},
|
|
65
62
|
}
|
|
66
63
|
|
|
67
64
|
additional_properties_type = None
|
|
@@ -79,7 +76,8 @@ class AutoscalingOverride(ModelNormal):
|
|
|
79
76
|
and the value is attribute type.
|
|
80
77
|
"""
|
|
81
78
|
return {
|
|
82
|
-
'min_instances': (int,), # noqa: E501
|
|
79
|
+
'min_instances': (int, none_type,), # noqa: E501
|
|
80
|
+
'max_instances': (int, none_type,), # noqa: E501
|
|
83
81
|
'expire_after': (float,), # noqa: E501
|
|
84
82
|
}
|
|
85
83
|
|
|
@@ -90,6 +88,7 @@ class AutoscalingOverride(ModelNormal):
|
|
|
90
88
|
|
|
91
89
|
attribute_map = {
|
|
92
90
|
'min_instances': 'min_instances', # noqa: E501
|
|
91
|
+
'max_instances': 'max_instances', # noqa: E501
|
|
93
92
|
'expire_after': 'expire_after', # noqa: E501
|
|
94
93
|
}
|
|
95
94
|
|
|
@@ -105,11 +104,12 @@ class AutoscalingOverride(ModelNormal):
|
|
|
105
104
|
])
|
|
106
105
|
|
|
107
106
|
@convert_js_args_to_python_args
|
|
108
|
-
def __init__(self, min_instances, expire_after, *args, **kwargs): # noqa: E501
|
|
107
|
+
def __init__(self, min_instances, max_instances, expire_after, *args, **kwargs): # noqa: E501
|
|
109
108
|
"""AutoscalingOverride - a model defined in OpenAPI
|
|
110
109
|
|
|
111
110
|
Args:
|
|
112
|
-
min_instances (int): Minimum number of instances to run
|
|
111
|
+
min_instances (int, none_type): Minimum number of instances to run
|
|
112
|
+
max_instances (int, none_type): Maximum number of instances to run
|
|
113
113
|
expire_after (float): Unix timestamp when this override is no longer valid
|
|
114
114
|
|
|
115
115
|
Keyword Args:
|
|
@@ -169,6 +169,7 @@ class AutoscalingOverride(ModelNormal):
|
|
|
169
169
|
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
|
|
170
170
|
|
|
171
171
|
self.min_instances = min_instances
|
|
172
|
+
self.max_instances = max_instances
|
|
172
173
|
self.expire_after = expire_after
|
|
173
174
|
for var_name, var_value in kwargs.items():
|
|
174
175
|
if var_name not in self.attribute_map and \
|
|
@@ -78,7 +78,8 @@ class InlineResponse202(ModelNormal):
|
|
|
78
78
|
return {
|
|
79
79
|
'service': (str,), # noqa: E501
|
|
80
80
|
'instance': (str,), # noqa: E501
|
|
81
|
-
'min_instances': (int,), # noqa: E501
|
|
81
|
+
'min_instances': (int, none_type,), # noqa: E501
|
|
82
|
+
'max_instances': (int, none_type,), # noqa: E501
|
|
82
83
|
'expire_after': (float,), # noqa: E501
|
|
83
84
|
'status': (str,), # noqa: E501
|
|
84
85
|
}
|
|
@@ -92,6 +93,7 @@ class InlineResponse202(ModelNormal):
|
|
|
92
93
|
'service': 'service', # noqa: E501
|
|
93
94
|
'instance': 'instance', # noqa: E501
|
|
94
95
|
'min_instances': 'min_instances', # noqa: E501
|
|
96
|
+
'max_instances': 'max_instances', # noqa: E501
|
|
95
97
|
'expire_after': 'expire_after', # noqa: E501
|
|
96
98
|
'status': 'status', # noqa: E501
|
|
97
99
|
}
|
|
@@ -144,7 +146,8 @@ class InlineResponse202(ModelNormal):
|
|
|
144
146
|
_visited_composed_classes = (Animal,)
|
|
145
147
|
service (str): Service name. [optional] # noqa: E501
|
|
146
148
|
instance (str): Instance name. [optional] # noqa: E501
|
|
147
|
-
min_instances (int): Minimum number of instances to run. [optional] # noqa: E501
|
|
149
|
+
min_instances (int, none_type): Minimum number of instances to run. [optional] # noqa: E501
|
|
150
|
+
max_instances (int, none_type): Maximum number of instances to run. [optional] # noqa: E501
|
|
148
151
|
expire_after (float): Unix timestamp after which the override is no longer valid. [optional] # noqa: E501
|
|
149
152
|
status (str): Status of the operation. [optional] # noqa: E501
|
|
150
153
|
"""
|
paasta_tools/remote_git.py
CHANGED
|
@@ -72,8 +72,8 @@ def create_remote_refs(git_url, ref_mutator, force=False):
|
|
|
72
72
|
determine_wants = ref_mutator
|
|
73
73
|
# We know we don't need to push any objects.
|
|
74
74
|
|
|
75
|
-
def generate_pack_contents(have, want):
|
|
76
|
-
return []
|
|
75
|
+
def generate_pack_contents(have, want, ofs_delta=None):
|
|
76
|
+
return 0, []
|
|
77
77
|
|
|
78
78
|
return client.send_pack(path, determine_wants, generate_pack_contents)
|
|
79
79
|
|
|
@@ -45,8 +45,8 @@ def main():
|
|
|
45
45
|
api.main("dev-mode")
|
|
46
46
|
else:
|
|
47
47
|
os.execl(
|
|
48
|
-
".tox/
|
|
49
|
-
".tox/
|
|
48
|
+
".tox/py310-linux/bin/python",
|
|
49
|
+
".tox/py310-linux/bin/python",
|
|
50
50
|
"-m",
|
|
51
51
|
"paasta_tools.api.api",
|
|
52
52
|
*["-D", "-c", cluster, str(port)],
|
|
@@ -39,8 +39,8 @@ def main():
|
|
|
39
39
|
api.main("dev-mode")
|
|
40
40
|
else:
|
|
41
41
|
os.execl(
|
|
42
|
-
".tox/
|
|
43
|
-
".tox/
|
|
42
|
+
".tox/py310-linux/bin/python",
|
|
43
|
+
".tox/py310-linux/bin/python",
|
|
44
44
|
"-m",
|
|
45
45
|
"paasta_tools.api.api",
|
|
46
46
|
*["-D", "-c", cluster, str(port)],
|
|
@@ -255,27 +255,31 @@ def get_hpa_overrides(kube_client: KubeClient) -> Dict[str, Dict[str, HpaOverrid
|
|
|
255
255
|
|
|
256
256
|
This function reads the "paasta-autoscaling-overrides" ConfigMap in the "paasta" namespace
|
|
257
257
|
and extracts all valid (non-expired) overrides to return a dictionary mapping
|
|
258
|
-
service.instance pairs to override data (currently, just
|
|
258
|
+
service.instance pairs to override data (currently, just {min,max_instances} and when the
|
|
259
259
|
override should expire by).
|
|
260
260
|
|
|
261
261
|
The incoming ConfigMap is expected to have the following format:
|
|
262
262
|
{
|
|
263
263
|
$SERVICE_A.$INSTANCE_A: {
|
|
264
264
|
"min_instances": 2,
|
|
265
|
+
"m_instances": 2,
|
|
265
266
|
"expire_after": "2023-10-01T00:00:00Z"
|
|
266
267
|
},
|
|
267
268
|
$SERVICE_A.$INSTANCE_B: {
|
|
268
269
|
"min_instances": 3,
|
|
270
|
+
"max_instances": 10,
|
|
269
271
|
"expire_after": "2023-10-01T00:00:00Z"
|
|
270
272
|
},
|
|
271
273
|
...
|
|
272
274
|
},
|
|
273
275
|
$SERVICE_B.$INSTANCE_A: {
|
|
274
276
|
"min_instances": 1,
|
|
277
|
+
"max_instances": 11,
|
|
275
278
|
"expire_after": "2023-10-01T00:00:00Z"
|
|
276
279
|
},
|
|
277
280
|
$SERVICE_B.$INSTANCE_B: {
|
|
278
281
|
"min_instances": 2,
|
|
282
|
+
"max_instances": 20,
|
|
279
283
|
"expire_after": "2023-10-01T00:00:00Z"
|
|
280
284
|
},
|
|
281
285
|
...
|
|
@@ -298,19 +302,21 @@ def get_hpa_overrides(kube_client: KubeClient) -> Dict[str, Dict[str, HpaOverrid
|
|
|
298
302
|
override_metadata = json.loads(override_json)
|
|
299
303
|
expire_after = override_metadata.get("expire_after")
|
|
300
304
|
min_instances = override_metadata.get("min_instances")
|
|
305
|
+
max_instances = override_metadata.get("max_instances")
|
|
301
306
|
|
|
302
|
-
if expire_after and min_instances:
|
|
307
|
+
if expire_after and (min_instances or max_instances):
|
|
303
308
|
if current_time < expire_after:
|
|
304
309
|
if service not in overrides:
|
|
305
310
|
overrides[service] = {}
|
|
306
311
|
|
|
307
312
|
overrides[service][instance] = {
|
|
308
313
|
"min_instances": min_instances,
|
|
314
|
+
"max_instances": max_instances,
|
|
309
315
|
"expire_after": expire_after,
|
|
310
316
|
}
|
|
311
317
|
log.info(
|
|
312
318
|
f"Found valid HPA override for {service}: "
|
|
313
|
-
f"{
|
|
319
|
+
f"min_instances: {max_instances} :: max_instances {min_instances} (expires at {expire_after})"
|
|
314
320
|
)
|
|
315
321
|
else:
|
|
316
322
|
log.info(
|
|
@@ -320,7 +326,7 @@ def get_hpa_overrides(kube_client: KubeClient) -> Dict[str, Dict[str, HpaOverrid
|
|
|
320
326
|
else:
|
|
321
327
|
log.warning(
|
|
322
328
|
f"Invalid HPA override for {service}.{instance}: "
|
|
323
|
-
f"missing 'min_instances' or 'expire_after': {override_metadata}"
|
|
329
|
+
f"missing 'min_instances' or 'max_instances' or 'expire_after': {override_metadata}"
|
|
324
330
|
)
|
|
325
331
|
except Exception:
|
|
326
332
|
log.exception(
|
paasta_tools/yaml_tools.py
CHANGED
|
@@ -2,7 +2,7 @@ import sys
|
|
|
2
2
|
|
|
3
3
|
import yaml
|
|
4
4
|
|
|
5
|
-
# try and catch both /opt/venvs/paasta-tools and ~/pg/paasta/.tox/
|
|
5
|
+
# try and catch both /opt/venvs/paasta-tools and ~/pg/paasta/.tox/py310-linux as if we're being run as an application,
|
|
6
6
|
# we likely want to fail on a potential slowdown rather than experience a performance regression
|
|
7
7
|
if "paasta" in sys.prefix:
|
|
8
8
|
from yaml import CSafeLoader as Loader
|
|
@@ -53,12 +53,12 @@ def install_vscode_support() -> None:
|
|
|
53
53
|
"python": "${workspaceFolder}/.paasta/bin/python",
|
|
54
54
|
"program": "${workspaceFolder}/.paasta/bin/tox",
|
|
55
55
|
"subProcess": True,
|
|
56
|
-
"args": ["-e", "
|
|
56
|
+
"args": ["-e", "py310-linux,docs,mypy,tests"],
|
|
57
57
|
},
|
|
58
58
|
{
|
|
59
59
|
"name": "paasta cli",
|
|
60
60
|
"cwd": "${workspaceFolder}",
|
|
61
|
-
"python": "${workspaceFolder}/.tox/
|
|
61
|
+
"python": "${workspaceFolder}/.tox/py310-linux/bin/python",
|
|
62
62
|
"type": "python",
|
|
63
63
|
"request": "launch",
|
|
64
64
|
"module": "paasta_tools.cli.cli",
|
|
@@ -66,7 +66,7 @@ def install_vscode_support() -> None:
|
|
|
66
66
|
{
|
|
67
67
|
"name": "paasta rollback",
|
|
68
68
|
"cwd": "${workspaceFolder}",
|
|
69
|
-
"python": "${workspaceFolder}/.tox/
|
|
69
|
+
"python": "${workspaceFolder}/.tox/py310-linux/bin/python",
|
|
70
70
|
"type": "python",
|
|
71
71
|
"request": "launch",
|
|
72
72
|
"module": "paasta_tools.cli.cli",
|
|
@@ -83,7 +83,7 @@ def install_vscode_support() -> None:
|
|
|
83
83
|
{
|
|
84
84
|
"name": "paasta mark-for-deployment",
|
|
85
85
|
"cwd": "${workspaceFolder}",
|
|
86
|
-
"python": "${workspaceFolder}/.tox/
|
|
86
|
+
"python": "${workspaceFolder}/.tox/py310-linux/bin/python",
|
|
87
87
|
"type": "python",
|
|
88
88
|
"request": "launch",
|
|
89
89
|
"module": "paasta_tools.cli.cli",
|
|
@@ -101,7 +101,7 @@ def install_vscode_support() -> None:
|
|
|
101
101
|
{
|
|
102
102
|
"name": "paasta status",
|
|
103
103
|
"cwd": "${workspaceFolder}",
|
|
104
|
-
"python": "${workspaceFolder}/.tox/
|
|
104
|
+
"python": "${workspaceFolder}/.tox/py310-linux/bin/python",
|
|
105
105
|
"type": "python",
|
|
106
106
|
"request": "launch",
|
|
107
107
|
"module": "paasta_tools.cli.cli",
|
|
@@ -118,7 +118,7 @@ def install_vscode_support() -> None:
|
|
|
118
118
|
{
|
|
119
119
|
"name": "paasta playground",
|
|
120
120
|
"cwd": "${workspaceFolder}",
|
|
121
|
-
"python": "${workspaceFolder}/.tox/
|
|
121
|
+
"python": "${workspaceFolder}/.tox/py310-linux/bin/python",
|
|
122
122
|
"type": "python",
|
|
123
123
|
"request": "launch",
|
|
124
124
|
"module": "paasta_tools.cli.cli",
|
|
@@ -138,7 +138,7 @@ def install_vscode_support() -> None:
|
|
|
138
138
|
{
|
|
139
139
|
"name": "paasta status playground",
|
|
140
140
|
"cwd": "${workspaceFolder}",
|
|
141
|
-
"python": "${workspaceFolder}/.tox/
|
|
141
|
+
"python": "${workspaceFolder}/.tox/py310-linux/bin/python",
|
|
142
142
|
"type": "python",
|
|
143
143
|
"request": "launch",
|
|
144
144
|
"module": "paasta_tools.cli.cli",
|
|
@@ -157,7 +157,7 @@ def install_vscode_support() -> None:
|
|
|
157
157
|
{
|
|
158
158
|
"name": "paasta logs",
|
|
159
159
|
"cwd": "${workspaceFolder}",
|
|
160
|
-
"python": "${workspaceFolder}/.tox/
|
|
160
|
+
"python": "${workspaceFolder}/.tox/py310-linux/bin/python",
|
|
161
161
|
"type": "python",
|
|
162
162
|
"request": "launch",
|
|
163
163
|
"module": "paasta_tools.cli.cli",
|
|
@@ -175,7 +175,7 @@ def install_vscode_support() -> None:
|
|
|
175
175
|
"name": "paasta validate",
|
|
176
176
|
# This command has to be ran from inside the service repo in yelpsoa-configs
|
|
177
177
|
"cwd": "${userHome}/pg/yelpsoa-configs/",
|
|
178
|
-
"python": "${workspaceFolder}/.tox/
|
|
178
|
+
"python": "${workspaceFolder}/.tox/py310-linux/bin/python",
|
|
179
179
|
"type": "python",
|
|
180
180
|
"request": "launch",
|
|
181
181
|
"module": "paasta_tools.cli.cli",
|
|
@@ -184,10 +184,10 @@ def install_vscode_support() -> None:
|
|
|
184
184
|
{
|
|
185
185
|
# 1) Follow step 1 in "Running the PaaSTA HTTP API Locally" wiki
|
|
186
186
|
# 2) Run this "paasta API" test to debug paasta API
|
|
187
|
-
# 3) Run client command, e.g. PAASTA_SYSTEM_CONFIG_DIR=./etc_paasta_for_development/ .tox/
|
|
187
|
+
# 3) Run client command, e.g. PAASTA_SYSTEM_CONFIG_DIR=./etc_paasta_for_development/ .tox/py310-linux/bin/python paasta_tools/cli/cli.py status --clusters norcal-devc --service katamari_test_service
|
|
188
188
|
"name": "paasta API",
|
|
189
189
|
"cwd": "${workspaceFolder}",
|
|
190
|
-
"python": "${workspaceFolder}/.tox/
|
|
190
|
+
"python": "${workspaceFolder}/.tox/py310-linux/bin/python",
|
|
191
191
|
"type": "python",
|
|
192
192
|
"request": "launch",
|
|
193
193
|
"module": "paasta_tools.run-paasta-api-in-dev-mode",
|
|
@@ -203,7 +203,7 @@ def install_vscode_support() -> None:
|
|
|
203
203
|
{
|
|
204
204
|
"name": "paasta API playground",
|
|
205
205
|
"cwd": "${workspaceFolder}",
|
|
206
|
-
"python": "${workspaceFolder}/.tox/
|
|
206
|
+
"python": "${workspaceFolder}/.tox/py310-linux/bin/python",
|
|
207
207
|
"type": "python",
|
|
208
208
|
"request": "launch",
|
|
209
209
|
"module": "paasta_tools.run-paasta-api-playground",
|
|
@@ -221,7 +221,7 @@ def install_vscode_support() -> None:
|
|
|
221
221
|
{
|
|
222
222
|
"name": "Run setup k8s job in playground",
|
|
223
223
|
"cwd": "${workspaceFolder}",
|
|
224
|
-
"python": "${workspaceFolder}/.tox/
|
|
224
|
+
"python": "${workspaceFolder}/.tox/py310-linux/bin/python",
|
|
225
225
|
"type": "python",
|
|
226
226
|
"request": "launch",
|
|
227
227
|
"module": "paasta_tools.setup_kubernetes_job",
|
|
@@ -244,7 +244,7 @@ def install_vscode_support() -> None:
|
|
|
244
244
|
{
|
|
245
245
|
"name": "Generate deployments.json in playground",
|
|
246
246
|
"cwd": "${workspaceFolder}",
|
|
247
|
-
"python": "${workspaceFolder}/.tox/
|
|
247
|
+
"python": "${workspaceFolder}/.tox/py310-linux/bin/python",
|
|
248
248
|
"type": "python",
|
|
249
249
|
"request": "launch",
|
|
250
250
|
"module": "paasta_tools.generate_deployments_for_service",
|
|
@@ -255,27 +255,31 @@ def get_hpa_overrides(kube_client: KubeClient) -> Dict[str, Dict[str, HpaOverrid
|
|
|
255
255
|
|
|
256
256
|
This function reads the "paasta-autoscaling-overrides" ConfigMap in the "paasta" namespace
|
|
257
257
|
and extracts all valid (non-expired) overrides to return a dictionary mapping
|
|
258
|
-
service.instance pairs to override data (currently, just
|
|
258
|
+
service.instance pairs to override data (currently, just {min,max_instances} and when the
|
|
259
259
|
override should expire by).
|
|
260
260
|
|
|
261
261
|
The incoming ConfigMap is expected to have the following format:
|
|
262
262
|
{
|
|
263
263
|
$SERVICE_A.$INSTANCE_A: {
|
|
264
264
|
"min_instances": 2,
|
|
265
|
+
"m_instances": 2,
|
|
265
266
|
"expire_after": "2023-10-01T00:00:00Z"
|
|
266
267
|
},
|
|
267
268
|
$SERVICE_A.$INSTANCE_B: {
|
|
268
269
|
"min_instances": 3,
|
|
270
|
+
"max_instances": 10,
|
|
269
271
|
"expire_after": "2023-10-01T00:00:00Z"
|
|
270
272
|
},
|
|
271
273
|
...
|
|
272
274
|
},
|
|
273
275
|
$SERVICE_B.$INSTANCE_A: {
|
|
274
276
|
"min_instances": 1,
|
|
277
|
+
"max_instances": 11,
|
|
275
278
|
"expire_after": "2023-10-01T00:00:00Z"
|
|
276
279
|
},
|
|
277
280
|
$SERVICE_B.$INSTANCE_B: {
|
|
278
281
|
"min_instances": 2,
|
|
282
|
+
"max_instances": 20,
|
|
279
283
|
"expire_after": "2023-10-01T00:00:00Z"
|
|
280
284
|
},
|
|
281
285
|
...
|
|
@@ -298,19 +302,21 @@ def get_hpa_overrides(kube_client: KubeClient) -> Dict[str, Dict[str, HpaOverrid
|
|
|
298
302
|
override_metadata = json.loads(override_json)
|
|
299
303
|
expire_after = override_metadata.get("expire_after")
|
|
300
304
|
min_instances = override_metadata.get("min_instances")
|
|
305
|
+
max_instances = override_metadata.get("max_instances")
|
|
301
306
|
|
|
302
|
-
if expire_after and min_instances:
|
|
307
|
+
if expire_after and (min_instances or max_instances):
|
|
303
308
|
if current_time < expire_after:
|
|
304
309
|
if service not in overrides:
|
|
305
310
|
overrides[service] = {}
|
|
306
311
|
|
|
307
312
|
overrides[service][instance] = {
|
|
308
313
|
"min_instances": min_instances,
|
|
314
|
+
"max_instances": max_instances,
|
|
309
315
|
"expire_after": expire_after,
|
|
310
316
|
}
|
|
311
317
|
log.info(
|
|
312
318
|
f"Found valid HPA override for {service}: "
|
|
313
|
-
f"{
|
|
319
|
+
f"min_instances: {max_instances} :: max_instances {min_instances} (expires at {expire_after})"
|
|
314
320
|
)
|
|
315
321
|
else:
|
|
316
322
|
log.info(
|
|
@@ -320,7 +326,7 @@ def get_hpa_overrides(kube_client: KubeClient) -> Dict[str, Dict[str, HpaOverrid
|
|
|
320
326
|
else:
|
|
321
327
|
log.warning(
|
|
322
328
|
f"Invalid HPA override for {service}.{instance}: "
|
|
323
|
-
f"missing 'min_instances' or 'expire_after': {override_metadata}"
|
|
329
|
+
f"missing 'min_instances' or 'max_instances' or 'expire_after': {override_metadata}"
|
|
324
330
|
)
|
|
325
331
|
except Exception:
|
|
326
332
|
log.exception(
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: paasta-tools
|
|
3
|
+
Version: 1.28.0
|
|
4
|
+
Summary: Tools for Yelps SOA infrastructure
|
|
5
|
+
Author: Compute Infrastructure @ Yelp
|
|
6
|
+
Author-email: compute-infra@yelp.com
|
|
7
|
+
Provides: paasta_tools
|
|
8
|
+
Requires-Python: >=3.8.0
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Dist: a-sync>=0.5.0
|
|
11
|
+
Requires-Dist: aiohttp>=3.5.4
|
|
12
|
+
Requires-Dist: argcomplete>=0.8.1
|
|
13
|
+
Requires-Dist: boto
|
|
14
|
+
Requires-Dist: boto3
|
|
15
|
+
Requires-Dist: boto3-type-annotations
|
|
16
|
+
Requires-Dist: botocore
|
|
17
|
+
Requires-Dist: bravado>=10.2.0
|
|
18
|
+
Requires-Dist: certifi
|
|
19
|
+
Requires-Dist: choice>=0.1
|
|
20
|
+
Requires-Dist: containerd
|
|
21
|
+
Requires-Dist: cookiecutter>=1.4.0
|
|
22
|
+
Requires-Dist: croniter
|
|
23
|
+
Requires-Dist: docker
|
|
24
|
+
Requires-Dist: dulwich>=0.17.3
|
|
25
|
+
Requires-Dist: environment-tools
|
|
26
|
+
Requires-Dist: ephemeral-port-reserve>=1.0.1
|
|
27
|
+
Requires-Dist: graphviz
|
|
28
|
+
Requires-Dist: grpcio
|
|
29
|
+
Requires-Dist: gunicorn
|
|
30
|
+
Requires-Dist: humanfriendly
|
|
31
|
+
Requires-Dist: humanize>=0.5.1
|
|
32
|
+
Requires-Dist: inotify>=0.2.8
|
|
33
|
+
Requires-Dist: ipaddress>=1.0.22
|
|
34
|
+
Requires-Dist: isodate>=0.7.2
|
|
35
|
+
Requires-Dist: jsonschema[format]
|
|
36
|
+
Requires-Dist: kazoo>=2.0.0
|
|
37
|
+
Requires-Dist: kubernetes<26.0.0,>=18.20.0
|
|
38
|
+
Requires-Dist: ldap3
|
|
39
|
+
Requires-Dist: manhole
|
|
40
|
+
Requires-Dist: mypy-extensions>=0.3.0
|
|
41
|
+
Requires-Dist: nats-py
|
|
42
|
+
Requires-Dist: nulltype
|
|
43
|
+
Requires-Dist: objgraph
|
|
44
|
+
Requires-Dist: ply
|
|
45
|
+
Requires-Dist: progressbar2>=4.3.2
|
|
46
|
+
Requires-Dist: prometheus-client
|
|
47
|
+
Requires-Dist: pymesos>=0.2.0
|
|
48
|
+
Requires-Dist: pyramid-swagger>=2.3.0
|
|
49
|
+
Requires-Dist: pyramid>=2.0.2
|
|
50
|
+
Requires-Dist: pysensu-yelp>=0.3.4
|
|
51
|
+
Requires-Dist: PyStaticConfiguration
|
|
52
|
+
Requires-Dist: python-crontab>=2.1.1
|
|
53
|
+
Requires-Dist: python-dateutil>=2.4.0
|
|
54
|
+
Requires-Dist: python-iptables
|
|
55
|
+
Requires-Dist: pytimeparse>=1.1.0
|
|
56
|
+
Requires-Dist: pytz>=2014.10
|
|
57
|
+
Requires-Dist: requests<2.32.0,>=2.18.4
|
|
58
|
+
Requires-Dist: requests-cache>=0.4.10
|
|
59
|
+
Requires-Dist: retry
|
|
60
|
+
Requires-Dist: ruamel.yaml
|
|
61
|
+
Requires-Dist: sensu-plugin
|
|
62
|
+
Requires-Dist: service-configuration-lib>=3.3.5
|
|
63
|
+
Requires-Dist: signalfx
|
|
64
|
+
Requires-Dist: slackclient>=1.2.1
|
|
65
|
+
Requires-Dist: sticht>=1.1.0
|
|
66
|
+
Requires-Dist: syslogmp
|
|
67
|
+
Requires-Dist: transitions
|
|
68
|
+
Requires-Dist: typing-extensions
|
|
69
|
+
Requires-Dist: tzlocal
|
|
70
|
+
Requires-Dist: urllib3
|
|
71
|
+
Requires-Dist: utaw>=0.2.0
|
|
72
|
+
Requires-Dist: wsgicors
|
|
73
|
+
Dynamic: author
|
|
74
|
+
Dynamic: author-email
|
|
75
|
+
Dynamic: license-file
|
|
76
|
+
Dynamic: provides
|
|
77
|
+
Dynamic: requires-dist
|
|
78
|
+
Dynamic: requires-python
|
|
79
|
+
Dynamic: summary
|