kaqing 2.0.11__py3-none-any.whl → 2.0.13__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.
- adam/commands/deploy/deploy.py +2 -1
- adam/commands/deploy/deploy_pg_agent.py +38 -0
- adam/commands/deploy/undeploy.py +2 -1
- adam/commands/deploy/undeploy_pg_agent.py +40 -0
- adam/commands/postgres/postgres_preview.py +0 -1
- adam/commands/postgres/postgres_session.py +30 -21
- adam/commands/repair/repair_scan.py +1 -6
- adam/embedded_params.py +1 -1
- adam/k8s_utils/jobs.py +1 -1
- adam/k8s_utils/pods.py +4 -3
- adam/repl_commands.py +3 -1
- adam/version.py +1 -1
- {kaqing-2.0.11.dist-info → kaqing-2.0.13.dist-info}/METADATA +1 -1
- {kaqing-2.0.11.dist-info → kaqing-2.0.13.dist-info}/RECORD +17 -15
- {kaqing-2.0.11.dist-info → kaqing-2.0.13.dist-info}/WHEEL +0 -0
- {kaqing-2.0.11.dist-info → kaqing-2.0.13.dist-info}/entry_points.txt +0 -0
- {kaqing-2.0.11.dist-info → kaqing-2.0.13.dist-info}/top_level.txt +0 -0
adam/commands/deploy/deploy.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import click
|
2
2
|
|
3
3
|
from adam.commands.command import Command
|
4
|
+
from adam.commands.deploy.deploy_pg_agent import DeployPgAgent
|
4
5
|
from adam.commands.deploy.deploy_pod import DeployPod
|
5
6
|
from .deploy_frontend import DeployFrontend
|
6
7
|
from adam.repl_state import ReplState
|
@@ -40,7 +41,7 @@ class Deploy(Command):
|
|
40
41
|
Command.display_help()
|
41
42
|
|
42
43
|
def cmd_list():
|
43
|
-
return [DeployFrontend(), DeployPod()]
|
44
|
+
return [DeployFrontend(), DeployPod(), DeployPgAgent()]
|
44
45
|
|
45
46
|
def completion(self, state: ReplState):
|
46
47
|
if state.sts:
|
@@ -0,0 +1,38 @@
|
|
1
|
+
from adam.commands.command import Command
|
2
|
+
from adam.commands.postgres.postgres_session import PostgresSession
|
3
|
+
from adam.config import Config
|
4
|
+
from adam.repl_state import ReplState, RequiredState
|
5
|
+
|
6
|
+
class DeployPgAgent(Command):
|
7
|
+
COMMAND = 'deploy pg-agent'
|
8
|
+
|
9
|
+
# the singleton pattern
|
10
|
+
def __new__(cls, *args, **kwargs):
|
11
|
+
if not hasattr(cls, 'instance'): cls.instance = super(DeployPgAgent, cls).__new__(cls)
|
12
|
+
|
13
|
+
return cls.instance
|
14
|
+
|
15
|
+
def __init__(self, successor: Command=None):
|
16
|
+
super().__init__(successor)
|
17
|
+
|
18
|
+
def command(self):
|
19
|
+
return DeployPgAgent.COMMAND
|
20
|
+
|
21
|
+
def required(self):
|
22
|
+
return RequiredState.NAMESPACE
|
23
|
+
|
24
|
+
def run(self, cmd: str, state: ReplState):
|
25
|
+
if not(args := self.args(cmd)):
|
26
|
+
return super().run(cmd, state)
|
27
|
+
|
28
|
+
state, args = self.apply_state(args, state)
|
29
|
+
if not self.validate_state(state):
|
30
|
+
return state
|
31
|
+
|
32
|
+
PostgresSession.deploy_pg_agent(Config().get('pg.agent.name', 'ops-pg-agent'), state.namespace)
|
33
|
+
|
34
|
+
def completion(self, state: ReplState):
|
35
|
+
return super().completion(state)
|
36
|
+
|
37
|
+
def help(self, _: ReplState):
|
38
|
+
return f'{DeployPgAgent.COMMAND}\t deploy postgres agent'
|
adam/commands/deploy/undeploy.py
CHANGED
@@ -2,6 +2,7 @@ import click
|
|
2
2
|
|
3
3
|
from adam.commands.command import Command
|
4
4
|
from adam.commands.deploy.undeploy_frontend import UndeployFrontend
|
5
|
+
from adam.commands.deploy.undeploy_pg_agent import UndeployPgAgent
|
5
6
|
from adam.commands.deploy.undeploy_pod import UndeployPod
|
6
7
|
from adam.repl_state import ReplState
|
7
8
|
from adam.utils import lines_to_tabular, log, log2
|
@@ -40,7 +41,7 @@ class Undeploy(Command):
|
|
40
41
|
Command.display_help()
|
41
42
|
|
42
43
|
def cmd_list():
|
43
|
-
return [UndeployFrontend(), UndeployPod()]
|
44
|
+
return [UndeployFrontend(), UndeployPod(), UndeployPgAgent()]
|
44
45
|
|
45
46
|
def completion(self, state: ReplState):
|
46
47
|
if state.sts:
|
@@ -0,0 +1,40 @@
|
|
1
|
+
from adam.commands.command import Command
|
2
|
+
from adam.commands.postgres.postgres_session import PostgresSession
|
3
|
+
from adam.config import Config
|
4
|
+
from adam.repl_state import ReplState, RequiredState
|
5
|
+
|
6
|
+
class UndeployPgAgent(Command):
|
7
|
+
COMMAND = 'undeploy pg-agent'
|
8
|
+
|
9
|
+
# the singleton pattern
|
10
|
+
def __new__(cls, *args, **kwargs):
|
11
|
+
if not hasattr(cls, 'instance'): cls.instance = super(UndeployPgAgent, cls).__new__(cls)
|
12
|
+
|
13
|
+
return cls.instance
|
14
|
+
|
15
|
+
def __init__(self, successor: Command=None):
|
16
|
+
super().__init__(successor)
|
17
|
+
|
18
|
+
def command(self):
|
19
|
+
return UndeployPgAgent.COMMAND
|
20
|
+
|
21
|
+
def required(self):
|
22
|
+
return RequiredState.NAMESPACE
|
23
|
+
|
24
|
+
def run(self, cmd: str, state: ReplState):
|
25
|
+
if not(args := self.args(cmd)):
|
26
|
+
return super().run(cmd, state)
|
27
|
+
|
28
|
+
state, args = self.apply_state(args, state)
|
29
|
+
if not self.validate_state(state):
|
30
|
+
return state
|
31
|
+
|
32
|
+
PostgresSession.undeploy_pg_agent(Config().get('pg.agent.name', 'ops-pg-agent'), state.namespace)
|
33
|
+
|
34
|
+
return state
|
35
|
+
|
36
|
+
def completion(self, state: ReplState):
|
37
|
+
return super().completion(state)
|
38
|
+
|
39
|
+
def help(self, _: ReplState):
|
40
|
+
return f'{UndeployPgAgent.COMMAND}\t undeploy postgres agent'
|
@@ -156,29 +156,11 @@ class PostgresSession:
|
|
156
156
|
return r
|
157
157
|
else:
|
158
158
|
ns = self.namespace
|
159
|
-
pod_name = Config().get('pg.agent.name', 'ops')
|
159
|
+
pod_name = Config().get('pg.agent.name', 'ops-pg-agent')
|
160
160
|
|
161
161
|
if Config().get('pg.agent.just-in-time', False):
|
162
|
-
|
163
|
-
|
164
|
-
try:
|
165
|
-
Pods.create(ns, pod_name, image, ['sleep', f'{timeout}'], env={'NAMESPACE': ns}, sa_name='c3')
|
166
|
-
except Exception as e:
|
167
|
-
if e.status == 409:
|
168
|
-
if Pods.completed(ns, pod_name):
|
169
|
-
try:
|
170
|
-
Pods.delete(pod_name, ns)
|
171
|
-
Pods.create(ns, pod_name, image, ['sleep', f'{timeout}'], env={'NAMESPACE': ns}, sa_name='c3')
|
172
|
-
except Exception as e2:
|
173
|
-
log2("Exception when calling BatchV1Api->create_pod: %s\n" % e2)
|
174
|
-
|
175
|
-
return
|
176
|
-
else:
|
177
|
-
log2("Exception when calling BatchV1Api->create_pod: %s\n" % e)
|
178
|
-
|
179
|
-
return
|
180
|
-
|
181
|
-
Pods.wait_for_running(ns, pod_name)
|
162
|
+
if not PostgresSession.deploy_pg_agent(pod_name, ns):
|
163
|
+
return
|
182
164
|
|
183
165
|
real_pod_name = pod_name
|
184
166
|
try:
|
@@ -196,6 +178,33 @@ class PostgresSession:
|
|
196
178
|
|
197
179
|
return Pods.exec(real_pod_name, pod_name, ns, cmd, show_out=show_out)
|
198
180
|
|
181
|
+
def deploy_pg_agent(pod_name: str, ns: str) -> str:
|
182
|
+
image = Config().get('pg.agent.image', 'seanahnsf/kaqing')
|
183
|
+
timeout = Config().get('pg.agent.timeout', 3600)
|
184
|
+
try:
|
185
|
+
Pods.create(ns, pod_name, image, ['sleep', f'{timeout}'], env={'NAMESPACE': ns}, sa_name='c3')
|
186
|
+
except Exception as e:
|
187
|
+
if e.status == 409:
|
188
|
+
if Pods.completed(ns, pod_name):
|
189
|
+
try:
|
190
|
+
Pods.delete(pod_name, ns)
|
191
|
+
Pods.create(ns, pod_name, image, ['sleep', f'{timeout}'], env={'NAMESPACE': ns}, sa_name='c3')
|
192
|
+
except Exception as e2:
|
193
|
+
log2("Exception when calling BatchV1Api->create_pod: %s\n" % e2)
|
194
|
+
|
195
|
+
return
|
196
|
+
else:
|
197
|
+
log2("Exception when calling BatchV1Api->create_pod: %s\n" % e)
|
198
|
+
|
199
|
+
return
|
200
|
+
|
201
|
+
Pods.wait_for_running(ns, pod_name)
|
202
|
+
|
203
|
+
return pod_name
|
204
|
+
|
205
|
+
def undeploy_pg_agent(pod_name: str, ns: str):
|
206
|
+
Pods.delete(pod_name, ns, grace_period_seconds=0)
|
207
|
+
|
199
208
|
def endpoint(self):
|
200
209
|
if not self.conn_details:
|
201
210
|
self.conn_details = Secrets.get_data(self.namespace, self.host)
|
@@ -55,12 +55,7 @@ class RepairScan(Command):
|
|
55
55
|
else:
|
56
56
|
log2("Exception when calling BatchV1Apii->create_namespaced_job: %s\n" % e)
|
57
57
|
|
58
|
-
|
59
|
-
while Pods.get(ns, pod_name).status.phase != 'Running':
|
60
|
-
if not msged:
|
61
|
-
log2("Waiting for the scanner pod to start up...")
|
62
|
-
msged = True
|
63
|
-
time.sleep(5)
|
58
|
+
Pods.wait_for_running(ns, pod_name, 'Waiting for the scanner pod to start up...')
|
64
59
|
|
65
60
|
try:
|
66
61
|
Pods.exec(pod_name, pod_name, ns, f"find {log_path} -type f -mtime -{n} -print0 | xargs -0 grep failed")
|
adam/embedded_params.py
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
def config():
|
2
|
-
return {'app': {'console-endpoint': 'https://{host}/{env}/{app}/static/console/index.html', 'cr': {'cluster-regex': '(.*?-.*?)-.*', 'group': 'ops.c3.ai', 'v': 'v2', 'plural': 'c3cassandras'}, 'label': 'c3__app_id-0', 'login': {'admin-group': '{host}/C3.ClusterAdmin', 'ingress': '{app_id}-k8singr-appleader-001', 'timeout': 5, 'session-check-url': 'https://{host}/{env}/{app}/api/8/C3/userSessionToken', 'cache-creds': True, 'cache-username': True, 'url': 'https://{host}/{env}/{app}', 'another': "You're logged in to {has}. However, for this app, you need to log in to {need}.", 'token-server-url': 'http://localhost:{port}', 'password-max-length': 128}, 'strip': '0'}, 'bash': {'workers': 32}, 'cassandra': {'service-name': 'all-pods-service'}, 'cql': {'workers': 32, 'samples': 3, 'secret': {'cluster-regex': '(.*?-.*?)-.*', 'name': '{cluster}-superuser', 'password-item': 'password'}}, 'checks': {'compactions-threshold': 250, 'cpu-busy-threshold': 98.0, 'cpu-threshold': 0.0, 'cassandra-data-path': '/c3/cassandra', 'root-disk-threshold': 50, 'cassandra-disk-threshold': 50, 'snapshot-size-cmd': "ls /c3/cassandra/data/data/*/*/snapshots | grep snapshots | sed 's/:$//g' | xargs -I {} du -sk {} | awk '{print $1}' | awk '{s+=$1} END {print s}'", 'snapshot-size-threshold': '40G', 'table-sizes-cmd': "ls -Al /c3/cassandra/data/data/ | awk '{print $9}' | sed 's/\\^r//g' | xargs -I {} du -sk /c3/cassandra/data/data/{}"}, 'get-host-id': {'workers': 32}, 'idps': {'ad': {'email-pattern': '.*@c3.ai', 'uri': 'https://login.microsoftonline.com/53ad779a-93e7-485c-ba20-ac8290d7252b/oauth2/v2.0/authorize?response_type=id_token&response_mode=form_post&client_id=00ff94a8-6b0a-4715-98e0-95490012d818&scope=openid+email+profile&redirect_uri=https%3A%2F%2Fplat.c3ci.cloud%2Fc3%2Fc3%2Foidc%2Flogin&nonce={nonce}&state=EMPTY', 'jwks-uri': 'https://login.microsoftonline.com/common/discovery/keys', 'contact': 'Please contact ted.tran@c3.ai.', 'whitelist-file': '/kaqing/members'}, 'okta': {'default': True, 'email-pattern': '.*@c3iot.com', 'uri': 'https://c3energy.okta.com/oauth2/v1/authorize?response_type=id_token&response_mode=form_post&client_id={client_id}&scope=openid+email+profile+groups&redirect_uri=https%3A%2F%2F{host}%2Fc3%2Fc3%2Foidc%2Flogin&nonce={nonce}&state=EMPTY', 'jwks-uri': 'https://c3energy.okta.com/oauth2/v1/keys'}}, 'issues': {'workers': 32}, 'logs': {'path': '/c3/cassandra/logs/system.log'}, 'medusa': {'restore-auto-complete': False}, 'nodetool': {'workers': 32, 'samples': 3, 'commands_in_line': 40}, 'pg': {'name-pattern': '^{namespace}.*-k8spg-.*', 'excludes': '.helm., -admin-secret', 'agent': {'name': 'ops', 'just-in-time': False, 'timeout': 86400, 'image': 'seanahnsf/kaqing'}, 'default-db': 'postgres', 'default-schema': 'postgres', 'secret': {'endpoint-key': 'postgres-db-endpoint', 'port-key': 'postgres-db-port', 'username-key': 'postgres-admin-username', 'password-key': 'postgres-admin-password'}}, 'pod': {'name': 'ops', 'image': 'seanahnsf/kaqing-cloud', 'sa': {'name': 'ops', 'proto': 'c3', 'additional-cluster-roles': 'c3aiops-k8ssandra-operator'}, 'label-selector': 'run=ops'}, 'preview': {'rows': 10}, 'processes': {'columns': 'pod,cpu,mem', 'header': 'POD_NAME,CPU,MEM/LIMIT'}, 'reaper': {'service-name': 'reaper-service', 'port-forward': {'timeout': 86400, 'local-port': 9001}, 'abort-runs-batch': 10, 'show-runs-batch': 100, 'pod': {'cluster-regex': '(.*?-.*?-.*?-.*?)-.*', 'label-selector': 'k8ssandra.io/reaper={cluster}-reaper'}, 'secret': {'cluster-regex': '(.*?-.*?)-.*', 'name': '{cluster}-reaper-ui', 'password-item': 'password'}}, 'repair': {'log-path': '/home/cassrepair/logs/', 'image': 'ci-registry.c3iot.io/cloudops/cassrepair:2.0.13', 'secret': 'ciregistryc3iotio', 'env': {'interval': 24, 'timeout': 60, 'pr': False, 'runs': 1}}, 'repl': {'start-drive': 'a', 'auto-enter-app': 'c3/c3', 'auto-enter-only-cluster': True}, 'status': {'columns': 'status,address,load,tokens,owns,host_id,gossip,compactions', 'header': '--,Address,Load,Tokens,Owns,Host ID,GOSSIP,COMPACTIONS'}, 'storage': {'columns': 'pod,volume_root,volume_cassandra,snapshots,data,compactions', 'header': 'POD_NAME,VOLUME /,VOLUME CASS,SNAPSHOTS,DATA,COMPACTIONS'}, 'watch': {'auto': 'rollout', 'timeout': 3600, 'interval': 10}, 'debug': {'timings': False, 'exit-on-error': False, 'show-parallelism': False, 'show-out': False}}
|
2
|
+
return {'app': {'console-endpoint': 'https://{host}/{env}/{app}/static/console/index.html', 'cr': {'cluster-regex': '(.*?-.*?)-.*', 'group': 'ops.c3.ai', 'v': 'v2', 'plural': 'c3cassandras'}, 'label': 'c3__app_id-0', 'login': {'admin-group': '{host}/C3.ClusterAdmin', 'ingress': '{app_id}-k8singr-appleader-001', 'timeout': 5, 'session-check-url': 'https://{host}/{env}/{app}/api/8/C3/userSessionToken', 'cache-creds': True, 'cache-username': True, 'url': 'https://{host}/{env}/{app}', 'another': "You're logged in to {has}. However, for this app, you need to log in to {need}.", 'token-server-url': 'http://localhost:{port}', 'password-max-length': 128}, 'strip': '0'}, 'bash': {'workers': 32}, 'cassandra': {'service-name': 'all-pods-service'}, 'cql': {'workers': 32, 'samples': 3, 'secret': {'cluster-regex': '(.*?-.*?)-.*', 'name': '{cluster}-superuser', 'password-item': 'password'}}, 'checks': {'compactions-threshold': 250, 'cpu-busy-threshold': 98.0, 'cpu-threshold': 0.0, 'cassandra-data-path': '/c3/cassandra', 'root-disk-threshold': 50, 'cassandra-disk-threshold': 50, 'snapshot-size-cmd': "ls /c3/cassandra/data/data/*/*/snapshots | grep snapshots | sed 's/:$//g' | xargs -I {} du -sk {} | awk '{print $1}' | awk '{s+=$1} END {print s}'", 'snapshot-size-threshold': '40G', 'table-sizes-cmd': "ls -Al /c3/cassandra/data/data/ | awk '{print $9}' | sed 's/\\^r//g' | xargs -I {} du -sk /c3/cassandra/data/data/{}"}, 'get-host-id': {'workers': 32}, 'idps': {'ad': {'email-pattern': '.*@c3.ai', 'uri': 'https://login.microsoftonline.com/53ad779a-93e7-485c-ba20-ac8290d7252b/oauth2/v2.0/authorize?response_type=id_token&response_mode=form_post&client_id=00ff94a8-6b0a-4715-98e0-95490012d818&scope=openid+email+profile&redirect_uri=https%3A%2F%2Fplat.c3ci.cloud%2Fc3%2Fc3%2Foidc%2Flogin&nonce={nonce}&state=EMPTY', 'jwks-uri': 'https://login.microsoftonline.com/common/discovery/keys', 'contact': 'Please contact ted.tran@c3.ai.', 'whitelist-file': '/kaqing/members'}, 'okta': {'default': True, 'email-pattern': '.*@c3iot.com', 'uri': 'https://c3energy.okta.com/oauth2/v1/authorize?response_type=id_token&response_mode=form_post&client_id={client_id}&scope=openid+email+profile+groups&redirect_uri=https%3A%2F%2F{host}%2Fc3%2Fc3%2Foidc%2Flogin&nonce={nonce}&state=EMPTY', 'jwks-uri': 'https://c3energy.okta.com/oauth2/v1/keys'}}, 'issues': {'workers': 32}, 'logs': {'path': '/c3/cassandra/logs/system.log'}, 'medusa': {'restore-auto-complete': False}, 'nodetool': {'workers': 32, 'samples': 3, 'commands_in_line': 40}, 'pg': {'name-pattern': '^{namespace}.*-k8spg-.*', 'excludes': '.helm., -admin-secret', 'agent': {'name': 'ops-pg-agent', 'just-in-time': False, 'timeout': 86400, 'image': 'seanahnsf/kaqing'}, 'default-db': 'postgres', 'default-schema': 'postgres', 'secret': {'endpoint-key': 'postgres-db-endpoint', 'port-key': 'postgres-db-port', 'username-key': 'postgres-admin-username', 'password-key': 'postgres-admin-password'}}, 'pod': {'name': 'ops', 'image': 'seanahnsf/kaqing-cloud', 'sa': {'name': 'ops', 'proto': 'c3', 'additional-cluster-roles': 'c3aiops-k8ssandra-operator'}, 'label-selector': 'run=ops'}, 'preview': {'rows': 10}, 'processes': {'columns': 'pod,cpu,mem', 'header': 'POD_NAME,CPU,MEM/LIMIT'}, 'reaper': {'service-name': 'reaper-service', 'port-forward': {'timeout': 86400, 'local-port': 9001}, 'abort-runs-batch': 10, 'show-runs-batch': 100, 'pod': {'cluster-regex': '(.*?-.*?-.*?-.*?)-.*', 'label-selector': 'k8ssandra.io/reaper={cluster}-reaper'}, 'secret': {'cluster-regex': '(.*?-.*?)-.*', 'name': '{cluster}-reaper-ui', 'password-item': 'password'}}, 'repair': {'log-path': '/home/cassrepair/logs/', 'image': 'ci-registry.c3iot.io/cloudops/cassrepair:2.0.13', 'secret': 'ciregistryc3iotio', 'env': {'interval': 24, 'timeout': 60, 'pr': False, 'runs': 1}}, 'repl': {'start-drive': 'a', 'auto-enter-app': 'c3/c3', 'auto-enter-only-cluster': True}, 'status': {'columns': 'status,address,load,tokens,owns,host_id,gossip,compactions', 'header': '--,Address,Load,Tokens,Owns,Host ID,GOSSIP,COMPACTIONS'}, 'storage': {'columns': 'pod,volume_root,volume_cassandra,snapshots,data,compactions', 'header': 'POD_NAME,VOLUME /,VOLUME CASS,SNAPSHOTS,DATA,COMPACTIONS'}, 'watch': {'auto': 'rollout', 'timeout': 3600, 'interval': 10}, 'debug': {'timings': False, 'exit-on-error': False, 'show-parallelism': False, 'show-out': False}}
|
adam/k8s_utils/jobs.py
CHANGED
@@ -12,7 +12,7 @@ class Jobs:
|
|
12
12
|
envs.append(client.V1EnvVar(name=k.upper(), value=str(v)))
|
13
13
|
for k, v in env_from.items():
|
14
14
|
envs.append(client.V1EnvVar(name=k.upper(), value_from=client.V1EnvVarSource(secret_key_ref=client.V1SecretKeySelector(key=k, name=v))))
|
15
|
-
template = Pods.create_pod_spec(job_name, image, image_pull_secret, envs, volume_name, pvc_name, mount_path, command)
|
15
|
+
template = Pods.create_pod_spec(job_name, image, image_pull_secret, envs, None, volume_name, pvc_name, mount_path, command)
|
16
16
|
spec = client.V1JobSpec(template=client.V1PodTemplateSpec(spec=template), backoff_limit=1, ttl_seconds_after_finished=300)
|
17
17
|
job = client.V1Job(
|
18
18
|
api_version="batch/v1",
|
adam/k8s_utils/pods.py
CHANGED
@@ -24,10 +24,10 @@ class Pods:
|
|
24
24
|
|
25
25
|
return _TEST_POD_EXEC_OUTS
|
26
26
|
|
27
|
-
def delete(pod_name: str, namespace: str):
|
27
|
+
def delete(pod_name: str, namespace: str, grace_period_seconds: int = None):
|
28
28
|
try:
|
29
29
|
v1 = client.CoreV1Api()
|
30
|
-
api_response = v1.delete_namespaced_pod(pod_name, namespace)
|
30
|
+
api_response = v1.delete_namespaced_pod(pod_name, namespace, grace_period_seconds=grace_period_seconds)
|
31
31
|
except Exception as e:
|
32
32
|
log2("Exception when calling CoreV1Api->delete_namespaced_pod: %s\n" % e)
|
33
33
|
|
@@ -240,9 +240,10 @@ class Pods:
|
|
240
240
|
if not msged:
|
241
241
|
if not msg:
|
242
242
|
msg = f'Waiting for the {pod_name} pod to start up...'
|
243
|
-
log2(msg)
|
243
|
+
log2(msg, nl=False)
|
244
244
|
msged = True
|
245
245
|
time.sleep(5)
|
246
|
+
log2(' OK')
|
246
247
|
|
247
248
|
def completed(namespace: str, pod_name: str):
|
248
249
|
return Pods.get(namespace, pod_name).status.phase in ['Succeeded', 'Failed']
|
adam/repl_commands.py
CHANGED
@@ -4,9 +4,11 @@ from adam.commands.deploy.code_start import CodeStart
|
|
4
4
|
from adam.commands.deploy.code_stop import CodeStop
|
5
5
|
from adam.commands.deploy.deploy import Deploy
|
6
6
|
from adam.commands.deploy.deploy_frontend import DeployFrontend
|
7
|
+
from adam.commands.deploy.deploy_pg_agent import DeployPgAgent
|
7
8
|
from adam.commands.deploy.deploy_pod import DeployPod
|
8
9
|
from adam.commands.deploy.undeploy import Undeploy
|
9
10
|
from adam.commands.deploy.undeploy_frontend import UndeployFrontend
|
11
|
+
from adam.commands.deploy.undeploy_pg_agent import UndeployPgAgent
|
10
12
|
from adam.commands.deploy.undeploy_pod import UndeployPod
|
11
13
|
from adam.commands.shell import Shell
|
12
14
|
from adam.commands.show.show_app_queues import ShowAppQueues
|
@@ -78,7 +80,7 @@ class ReplCommands:
|
|
78
80
|
return Medusa.cmd_list() + [Restart(), RollOut(), Watch()] + Reaper.cmd_list() + Repair.cmd_list()
|
79
81
|
|
80
82
|
def tools() -> list[Command]:
|
81
|
-
return [Cqlsh(), Postgres(), Bash(), Shell(), CodeStart(), CodeStop(), DeployFrontend(), UndeployFrontend(), DeployPod(), UndeployPod()]
|
83
|
+
return [Cqlsh(), Postgres(), Bash(), Shell(), CodeStart(), CodeStop(), DeployFrontend(), UndeployFrontend(), DeployPod(), UndeployPod(), DeployPgAgent(), UndeployPgAgent()]
|
82
84
|
|
83
85
|
def app() -> list[Command]:
|
84
86
|
return [ShowAppActions(), ShowAppId(), ShowAppQueues(), AppPing(), App()]
|
adam/version.py
CHANGED
@@ -6,15 +6,15 @@ adam/cli.py,sha256=03pIZdomAu7IL-GSP6Eun_PKwwISShRAmfx6eVRPGC0,458
|
|
6
6
|
adam/cli_group.py,sha256=W3zy1BghCtVcEXizq8fBH-93ZRVVwgAyGPzy0sHno1Y,593
|
7
7
|
adam/config.py,sha256=38UcmYRxf-Kq4iPbKS7tNPQqN64fam1bWNy6jhWREd0,2552
|
8
8
|
adam/embedded_apps.py,sha256=lKPx63mKzJbNmwz0rgL4gF76M9fDGxraYTtNAIGnZ_s,419
|
9
|
-
adam/embedded_params.py,sha256=
|
9
|
+
adam/embedded_params.py,sha256=cQuD1eMNEIDqFdBz7lzosvO40YB2tdfO0oj2qY4ZESA,4377
|
10
10
|
adam/log.py,sha256=gg5DK52wLPc9cjykeh0WFHyAk1qI3HEpGaAK8W2dzXY,1146
|
11
11
|
adam/pod_exec_result.py,sha256=nq0xnCNOpUGBSijGF0H-YNrwBc9vUQs4DkvLMIFS5LQ,951
|
12
12
|
adam/repl.py,sha256=5uGsu24qVAfATHIRdLJ4er44_9uUnVZ14pr-VXCILI0,7224
|
13
|
-
adam/repl_commands.py,sha256=
|
13
|
+
adam/repl_commands.py,sha256=h5l-xLfB85qiaU71yyunhoTy2743zsC4ElQ0ZvHqo_k,4259
|
14
14
|
adam/repl_session.py,sha256=uIogcvWBh7wd8QQ-p_JgLsyJ8YJgINw5vOd6JIsd7Vo,472
|
15
15
|
adam/repl_state.py,sha256=QarrUAwYWOz3YTemtaf2opbHLa5a3LEsyuonNwhvOhk,7131
|
16
16
|
adam/utils.py,sha256=-O47UmVG8S5N2LHAOE-UTMBHJOS_mXufU8ncupeNCHc,7043
|
17
|
-
adam/version.py,sha256=
|
17
|
+
adam/version.py,sha256=h15dtZyN8j7xBg43IN27269bVSjThVBrEx-si6roIXM,139
|
18
18
|
adam/checks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
19
19
|
adam/checks/check.py,sha256=Qopr3huYcMu2bzQgb99dEUYjFzkjKHRI76S6KA9b9Rk,702
|
20
20
|
adam/checks/check_context.py,sha256=FEHkQ32jY1EDopQ2uYWqy9v7aEEX1orLpJWhopwAlh4,402
|
@@ -81,12 +81,14 @@ adam/commands/deploy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hS
|
|
81
81
|
adam/commands/deploy/code_start.py,sha256=-iH8HThTNM83IfBxT_LqTByuHVatV9d-Il4OYOfrwLI,1370
|
82
82
|
adam/commands/deploy/code_stop.py,sha256=ch7ZMgosvTHsGaIcDwQY5XYh_5HYrUjBkZFOI-d2gOU,1696
|
83
83
|
adam/commands/deploy/code_utils.py,sha256=5Gp4U8HzKpPkbkHDU7whlvGOK-wWaAbCIIGzVoN9hio,3296
|
84
|
-
adam/commands/deploy/deploy.py,sha256=
|
84
|
+
adam/commands/deploy/deploy.py,sha256=R1m_bM81WU9X1YJJz9gkT5u8JMPDzPaYUDBm9PXscJQ,1872
|
85
85
|
adam/commands/deploy/deploy_frontend.py,sha256=TSvMTy6uUfOBIV96hKFy-M1hNCE6OeRW9M_dj1ZJsv0,1700
|
86
|
+
adam/commands/deploy/deploy_pg_agent.py,sha256=4FXltht0oA4DJDVq902gjCm06wo_abuHabOstOgWEgU,1203
|
86
87
|
adam/commands/deploy/deploy_pod.py,sha256=epK2FSnO4jqm7VHNID6gETvlhOs9CWVlTj1I_htDA_g,4403
|
87
88
|
adam/commands/deploy/deploy_utils.py,sha256=daJhX2kCg5aGt4ZLQdz5AbR-AS7q2y-bZNVxHzP708c,1524
|
88
|
-
adam/commands/deploy/undeploy.py,sha256=
|
89
|
+
adam/commands/deploy/undeploy.py,sha256=mKywl7mHDoxRjWTx1Wo3PS_T8W6ibJBzXk_dEmEQ9bY,1928
|
89
90
|
adam/commands/deploy/undeploy_frontend.py,sha256=mbHlWb5UHUVpR1trfflCS_TDip7eAqxqoZ47RzRZcno,1257
|
91
|
+
adam/commands/deploy/undeploy_pg_agent.py,sha256=uWa804XTTvZzozDSH_4loxHqSSeWXobdoBSQPDFX3vw,1239
|
90
92
|
adam/commands/deploy/undeploy_pod.py,sha256=k4O0JuVsY4h2jT_mZPM6Q8GqfSz02VAQLAYmd0FCVT8,1901
|
91
93
|
adam/commands/medusa/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
92
94
|
adam/commands/medusa/medusa.py,sha256=Y_yyOZRb6u45wfTVBRp3kuklyYDTSlaAJQdAiymP_8M,2185
|
@@ -97,8 +99,8 @@ adam/commands/medusa/medusa_show_restorejobs.py,sha256=vEYlsM28XjeodeH1E3826sliu
|
|
97
99
|
adam/commands/postgres/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
98
100
|
adam/commands/postgres/postgres.py,sha256=ugnQulU6h3pSySYRwU801raxqsC8W5DcFLSbqnk7SPo,3597
|
99
101
|
adam/commands/postgres/postgres_ls.py,sha256=HwZTgwGKXUqHX33S8aQPF6FqCrLqtoz4cLyJV2SpoE0,1186
|
100
|
-
adam/commands/postgres/postgres_preview.py,sha256=
|
101
|
-
adam/commands/postgres/postgres_session.py,sha256=
|
102
|
+
adam/commands/postgres/postgres_preview.py,sha256=MLzdEc4mvNj6V1Q8jO5OPznXyYELJHgd35_eQgLlNIU,1274
|
103
|
+
adam/commands/postgres/postgres_session.py,sha256=QFHSmixaI9_MxgzYj-UwvaOOaHLudx1bp821LB0dSSw,9440
|
102
104
|
adam/commands/reaper/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
103
105
|
adam/commands/reaper/reaper.py,sha256=SbxXgJ6b4wdXx5a1Fps71iEa1hmycWbArh1oC5bS83M,2677
|
104
106
|
adam/commands/reaper/reaper_forward.py,sha256=mUp409MzT91cVXGxoPfBGceaR3qZ0rVdWKGdyzPNzSA,3177
|
@@ -117,7 +119,7 @@ adam/commands/repair/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hS
|
|
117
119
|
adam/commands/repair/repair.py,sha256=5jdKVpP03GYNPuqeGlidOcFLTwl9gIzVDbxgXtUjAjw,2100
|
118
120
|
adam/commands/repair/repair_log.py,sha256=c7TI9hblpqn1tn7lTxj7VkIQKdNigYIIX-nxiFRZkns,1159
|
119
121
|
adam/commands/repair/repair_run.py,sha256=C9F86ia46rBCwkP8BFM5nw-AJ05jm4Bx9wnMnyZXR04,2598
|
120
|
-
adam/commands/repair/repair_scan.py,sha256=
|
122
|
+
adam/commands/repair/repair_scan.py,sha256=m6PErrbuQgryCMm_2pbGAwQdKNQvXLahcHXFfNKoU-s,2439
|
121
123
|
adam/commands/repair/repair_stop.py,sha256=on3jHmOwtWOL7SJlFd8ryBflzqDsxwJNwtAbhDjYUNc,1193
|
122
124
|
adam/commands/show/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
123
125
|
adam/commands/show/show.py,sha256=7dAsliNuDz6QNM24RoWJgKhJf_nuQTugp715vZ8hxh0,2509
|
@@ -140,9 +142,9 @@ adam/k8s_utils/config_maps.py,sha256=vc9A-2D1-1mindCMFL1wuysDOXb0RCl4BdjC6B6usXI
|
|
140
142
|
adam/k8s_utils/custom_resources.py,sha256=cIeaZRQET2DelTGU2f5QsMckh7TddPpWZDFeNK3txeQ,7647
|
141
143
|
adam/k8s_utils/deployment.py,sha256=3oZPfPgQfqtAQaxEFL4daUfRSieRAhysmuaWMzUYgXk,2921
|
142
144
|
adam/k8s_utils/ingresses.py,sha256=ul3Z6fDGc_Cxcn-ExP0vXhZatoShCUZFtpwtCY4Qx7o,3460
|
143
|
-
adam/k8s_utils/jobs.py,sha256=
|
145
|
+
adam/k8s_utils/jobs.py,sha256=gJpBpjcZ_FlkWJJIlavbHC_bqdmvv-GMVo8UZVh0sOQ,2610
|
144
146
|
adam/k8s_utils/kube_context.py,sha256=nocEyVNjXWG-N-GNnEYHDvnot7H5LQUFmpZIwIyE7As,3310
|
145
|
-
adam/k8s_utils/pods.py,sha256=
|
147
|
+
adam/k8s_utils/pods.py,sha256=uCrdgwNv86GiRBFmX40qjXOVtsXv0Hi9OiF5Vd05vO0,10004
|
146
148
|
adam/k8s_utils/secrets.py,sha256=pYaVKXTpx3-QgFtBjznWFq0N6ZcBdxnx21FRe5nBCCo,2305
|
147
149
|
adam/k8s_utils/service_accounts.py,sha256=v2oQSqCrNvt2uRnKlNwR3fjtpUG7oF5nqgzEB7NnT-U,6349
|
148
150
|
adam/k8s_utils/services.py,sha256=EOJJGACVbbRvu5T3rMKqIJqgYic1_MSJ17EA0TJ6UOk,3156
|
@@ -158,8 +160,8 @@ adam/sso/idp.py,sha256=fvcwUw_URTgsO6ySaqTIw0zQT2qRO1IPSGhf6rPtybo,5804
|
|
158
160
|
adam/sso/idp_login.py,sha256=QAtCUeDTVWliJy40RK_oac8Vgybr13xH8wzeBoxPaa8,1754
|
159
161
|
adam/sso/idp_session.py,sha256=9BUHNRf70u4rVKrVY1HKPOEmOviXvkjam8WJxmXSKIM,1735
|
160
162
|
adam/sso/sso_config.py,sha256=5N8WZgIJQBtHUy585XLRWKjpU87_v6QluyNK9E27D5s,2459
|
161
|
-
kaqing-2.0.
|
162
|
-
kaqing-2.0.
|
163
|
-
kaqing-2.0.
|
164
|
-
kaqing-2.0.
|
165
|
-
kaqing-2.0.
|
163
|
+
kaqing-2.0.13.dist-info/METADATA,sha256=LbDn9UDjztLXpgdjxeHl61g2_6Xjb4fzFeJu0EUI9D0,132
|
164
|
+
kaqing-2.0.13.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
165
|
+
kaqing-2.0.13.dist-info/entry_points.txt,sha256=SkzhuQJUWsXOzHeZ5TgQ2c3_g53UGK23zzJU_JTZOZI,39
|
166
|
+
kaqing-2.0.13.dist-info/top_level.txt,sha256=8_2PZkwBb-xDcnc8a2rAbQeJhXKXskc7zTP7pSPa1fw,5
|
167
|
+
kaqing-2.0.13.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|