kaqing 2.0.52__py3-none-any.whl → 2.0.184__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.

Potentially problematic release.


This version of kaqing might be problematic. Click here for more details.

Files changed (223) hide show
  1. adam/__init__.py +0 -2
  2. adam/app_session.py +9 -12
  3. adam/apps.py +20 -6
  4. adam/batch.py +15 -19
  5. adam/checks/check_utils.py +19 -49
  6. adam/checks/compactionstats.py +1 -1
  7. adam/checks/cpu.py +9 -3
  8. adam/checks/cpu_metrics.py +52 -0
  9. adam/checks/disk.py +3 -4
  10. adam/checks/gossip.py +1 -1
  11. adam/checks/memory.py +3 -3
  12. adam/checks/status.py +1 -1
  13. adam/columns/columns.py +3 -1
  14. adam/columns/cpu.py +3 -1
  15. adam/columns/cpu_metrics.py +22 -0
  16. adam/columns/memory.py +3 -4
  17. adam/commands/__init__.py +24 -0
  18. adam/commands/alter_tables.py +37 -63
  19. adam/commands/app/app.py +38 -0
  20. adam/commands/{app_ping.py → app/app_ping.py} +8 -14
  21. adam/commands/app/show_app_actions.py +49 -0
  22. adam/commands/{show → app}/show_app_id.py +9 -12
  23. adam/commands/{show → app}/show_app_queues.py +8 -14
  24. adam/commands/app/utils_app.py +98 -0
  25. adam/commands/audit/audit.py +81 -0
  26. adam/commands/audit/audit_repair_tables.py +72 -0
  27. adam/commands/audit/audit_run.py +50 -0
  28. adam/commands/audit/show_last10.py +37 -0
  29. adam/commands/audit/show_slow10.py +36 -0
  30. adam/commands/audit/show_top10.py +36 -0
  31. adam/commands/audit/utils_show_top10.py +71 -0
  32. adam/commands/bash/__init__.py +5 -0
  33. adam/commands/bash/bash.py +36 -0
  34. adam/commands/bash/bash_completer.py +93 -0
  35. adam/commands/bash/utils_bash.py +16 -0
  36. adam/commands/cat.py +36 -0
  37. adam/commands/cd.py +14 -89
  38. adam/commands/check.py +18 -21
  39. adam/commands/cli_commands.py +5 -6
  40. adam/commands/clipboard_copy.py +86 -0
  41. adam/commands/code.py +57 -0
  42. adam/commands/command.py +197 -35
  43. adam/commands/commands_utils.py +15 -31
  44. adam/commands/cql/cql_completions.py +29 -8
  45. adam/commands/cql/cqlsh.py +12 -27
  46. adam/commands/cql/utils_cql.py +297 -0
  47. adam/commands/deploy/code_start.py +7 -10
  48. adam/commands/deploy/code_stop.py +4 -21
  49. adam/commands/deploy/code_utils.py +5 -5
  50. adam/commands/deploy/deploy.py +4 -21
  51. adam/commands/deploy/deploy_frontend.py +14 -17
  52. adam/commands/deploy/deploy_pg_agent.py +3 -6
  53. adam/commands/deploy/deploy_pod.py +71 -79
  54. adam/commands/deploy/deploy_utils.py +16 -26
  55. adam/commands/deploy/undeploy.py +4 -21
  56. adam/commands/deploy/undeploy_frontend.py +4 -7
  57. adam/commands/deploy/undeploy_pg_agent.py +6 -8
  58. adam/commands/deploy/undeploy_pod.py +15 -16
  59. adam/commands/devices/__init__.py +0 -0
  60. adam/commands/devices/device.py +123 -0
  61. adam/commands/devices/device_app.py +163 -0
  62. adam/commands/devices/device_auit_log.py +49 -0
  63. adam/commands/devices/device_cass.py +179 -0
  64. adam/commands/devices/device_export.py +84 -0
  65. adam/commands/devices/device_postgres.py +150 -0
  66. adam/commands/devices/devices.py +25 -0
  67. adam/commands/download_file.py +47 -0
  68. adam/commands/exit.py +1 -4
  69. adam/commands/export/__init__.py +0 -0
  70. adam/commands/export/clean_up_all_export_sessions.py +37 -0
  71. adam/commands/export/clean_up_export_sessions.py +39 -0
  72. adam/commands/export/download_export_session.py +39 -0
  73. adam/commands/export/drop_export_database.py +39 -0
  74. adam/commands/export/drop_export_databases.py +37 -0
  75. adam/commands/export/export.py +53 -0
  76. adam/commands/export/export_databases.py +245 -0
  77. adam/commands/export/export_select.py +59 -0
  78. adam/commands/export/export_select_x.py +54 -0
  79. adam/commands/export/export_sessions.py +209 -0
  80. adam/commands/export/export_use.py +49 -0
  81. adam/commands/export/exporter.py +332 -0
  82. adam/commands/export/import_files.py +44 -0
  83. adam/commands/export/import_session.py +44 -0
  84. adam/commands/export/importer.py +81 -0
  85. adam/commands/export/importer_athena.py +177 -0
  86. adam/commands/export/importer_sqlite.py +67 -0
  87. adam/commands/export/show_column_counts.py +45 -0
  88. adam/commands/export/show_export_databases.py +38 -0
  89. adam/commands/export/show_export_session.py +39 -0
  90. adam/commands/export/show_export_sessions.py +37 -0
  91. adam/commands/export/utils_export.py +343 -0
  92. adam/commands/find_files.py +51 -0
  93. adam/commands/find_processes.py +76 -0
  94. adam/commands/head.py +36 -0
  95. adam/commands/help.py +14 -9
  96. adam/commands/intermediate_command.py +49 -0
  97. adam/commands/issues.py +14 -40
  98. adam/commands/kubectl.py +38 -0
  99. adam/commands/login.py +26 -25
  100. adam/commands/logs.py +5 -7
  101. adam/commands/ls.py +11 -110
  102. adam/commands/medusa/medusa.py +4 -22
  103. adam/commands/medusa/medusa_backup.py +22 -29
  104. adam/commands/medusa/medusa_restore.py +40 -39
  105. adam/commands/medusa/medusa_show_backupjobs.py +19 -20
  106. adam/commands/medusa/medusa_show_restorejobs.py +15 -20
  107. adam/commands/nodetool.py +11 -15
  108. adam/commands/param_get.py +11 -14
  109. adam/commands/param_set.py +8 -12
  110. adam/commands/postgres/postgres.py +45 -46
  111. adam/commands/postgres/postgres_databases.py +269 -0
  112. adam/commands/postgres/postgres_ls.py +4 -8
  113. adam/commands/postgres/postgres_preview.py +5 -9
  114. adam/commands/postgres/psql_completions.py +4 -3
  115. adam/commands/postgres/utils_postgres.py +70 -0
  116. adam/commands/preview_table.py +10 -61
  117. adam/commands/pwd.py +14 -43
  118. adam/commands/reaper/reaper.py +4 -24
  119. adam/commands/reaper/reaper_forward.py +49 -56
  120. adam/commands/reaper/reaper_forward_session.py +6 -0
  121. adam/commands/reaper/reaper_forward_stop.py +10 -16
  122. adam/commands/reaper/reaper_restart.py +8 -15
  123. adam/commands/reaper/reaper_run_abort.py +8 -33
  124. adam/commands/reaper/reaper_runs.py +43 -58
  125. adam/commands/reaper/reaper_runs_abort.py +29 -49
  126. adam/commands/reaper/reaper_schedule_activate.py +9 -32
  127. adam/commands/reaper/reaper_schedule_start.py +9 -32
  128. adam/commands/reaper/reaper_schedule_stop.py +9 -32
  129. adam/commands/reaper/reaper_schedules.py +4 -14
  130. adam/commands/reaper/reaper_status.py +8 -16
  131. adam/commands/reaper/utils_reaper.py +194 -0
  132. adam/commands/repair/repair.py +4 -22
  133. adam/commands/repair/repair_log.py +6 -12
  134. adam/commands/repair/repair_run.py +29 -36
  135. adam/commands/repair/repair_scan.py +33 -39
  136. adam/commands/repair/repair_stop.py +6 -12
  137. adam/commands/report.py +25 -21
  138. adam/commands/restart.py +27 -28
  139. adam/commands/rollout.py +20 -25
  140. adam/commands/shell.py +12 -4
  141. adam/commands/show/show.py +11 -23
  142. adam/commands/show/show_adam.py +3 -3
  143. adam/commands/show/show_cassandra_repairs.py +35 -0
  144. adam/commands/show/show_cassandra_status.py +34 -52
  145. adam/commands/show/show_cassandra_version.py +5 -18
  146. adam/commands/show/show_commands.py +20 -25
  147. adam/commands/show/show_host.py +33 -0
  148. adam/commands/show/show_login.py +23 -27
  149. adam/commands/show/show_params.py +2 -5
  150. adam/commands/show/show_processes.py +16 -20
  151. adam/commands/show/show_storage.py +10 -20
  152. adam/commands/watch.py +27 -30
  153. adam/config.py +7 -15
  154. adam/embedded_params.py +1 -1
  155. adam/log.py +4 -4
  156. adam/pod_exec_result.py +13 -5
  157. adam/repl.py +126 -119
  158. adam/repl_commands.py +63 -29
  159. adam/repl_state.py +320 -71
  160. adam/sql/sql_completer.py +98 -383
  161. adam/sql/sql_state_machine.py +630 -0
  162. adam/sql/term_completer.py +14 -4
  163. adam/sso/authn_ad.py +6 -8
  164. adam/sso/authn_okta.py +4 -6
  165. adam/sso/cred_cache.py +4 -6
  166. adam/sso/idp.py +10 -13
  167. adam/utils.py +511 -10
  168. adam/utils_athena.py +145 -0
  169. adam/utils_audits.py +102 -0
  170. adam/utils_issues.py +32 -0
  171. adam/utils_k8s/__init__.py +0 -0
  172. adam/utils_k8s/app_clusters.py +28 -0
  173. adam/utils_k8s/app_pods.py +36 -0
  174. adam/utils_k8s/cassandra_clusters.py +44 -0
  175. adam/{k8s_utils → utils_k8s}/cassandra_nodes.py +11 -4
  176. adam/{k8s_utils → utils_k8s}/custom_resources.py +16 -17
  177. adam/{k8s_utils → utils_k8s}/deployment.py +2 -2
  178. adam/{k8s_utils → utils_k8s}/ingresses.py +2 -2
  179. adam/{k8s_utils → utils_k8s}/jobs.py +7 -11
  180. adam/utils_k8s/k8s.py +87 -0
  181. adam/{k8s_utils → utils_k8s}/kube_context.py +2 -2
  182. adam/{k8s_utils → utils_k8s}/pods.py +109 -74
  183. adam/{k8s_utils → utils_k8s}/secrets.py +7 -3
  184. adam/{k8s_utils → utils_k8s}/service_accounts.py +5 -4
  185. adam/{k8s_utils → utils_k8s}/services.py +2 -2
  186. adam/{k8s_utils → utils_k8s}/statefulsets.py +3 -14
  187. adam/utils_local.py +4 -0
  188. adam/utils_net.py +24 -0
  189. adam/utils_repl/__init__.py +0 -0
  190. adam/utils_repl/automata_completer.py +48 -0
  191. adam/utils_repl/repl_completer.py +46 -0
  192. adam/utils_repl/state_machine.py +173 -0
  193. adam/utils_sqlite.py +137 -0
  194. adam/version.py +1 -1
  195. {kaqing-2.0.52.dist-info → kaqing-2.0.184.dist-info}/METADATA +1 -1
  196. kaqing-2.0.184.dist-info/RECORD +244 -0
  197. adam/commands/app.py +0 -67
  198. adam/commands/bash.py +0 -87
  199. adam/commands/cp.py +0 -95
  200. adam/commands/cql/cql_table_completer.py +0 -8
  201. adam/commands/cql/cql_utils.py +0 -109
  202. adam/commands/describe/describe.py +0 -46
  203. adam/commands/describe/describe_keyspace.py +0 -60
  204. adam/commands/describe/describe_keyspaces.py +0 -50
  205. adam/commands/describe/describe_table.py +0 -60
  206. adam/commands/describe/describe_tables.py +0 -50
  207. adam/commands/devices.py +0 -89
  208. adam/commands/postgres/postgres_session.py +0 -240
  209. adam/commands/postgres/postgres_utils.py +0 -31
  210. adam/commands/postgres/psql_table_completer.py +0 -11
  211. adam/commands/reaper/reaper_session.py +0 -159
  212. adam/commands/show/show_app_actions.py +0 -53
  213. adam/commands/show/show_repairs.py +0 -47
  214. adam/k8s_utils/cassandra_clusters.py +0 -35
  215. adam/sql/sql_utils.py +0 -5
  216. kaqing-2.0.52.dist-info/RECORD +0 -184
  217. /adam/commands/{describe → app}/__init__.py +0 -0
  218. /adam/{k8s_utils → commands/audit}/__init__.py +0 -0
  219. /adam/{k8s_utils → utils_k8s}/config_maps.py +0 -0
  220. /adam/{k8s_utils → utils_k8s}/volumes.py +0 -0
  221. {kaqing-2.0.52.dist-info → kaqing-2.0.184.dist-info}/WHEEL +0 -0
  222. {kaqing-2.0.52.dist-info → kaqing-2.0.184.dist-info}/entry_points.txt +0 -0
  223. {kaqing-2.0.52.dist-info → kaqing-2.0.184.dist-info}/top_level.txt +0 -0
@@ -5,14 +5,14 @@ from adam.checks.check_utils import run_checks
5
5
  from adam.checks.compactionstats import CompactionStats
6
6
  from adam.checks.gossip import Gossip
7
7
  from adam.columns.columns import Columns
8
+ from adam.commands import extract_options
8
9
  from adam.commands.command import Command
9
- from adam.commands.issues import Issues
10
+ from adam.commands.cql.utils_cql import cassandra
10
11
  from adam.config import Config
11
- from adam.k8s_utils.cassandra_nodes import CassandraNodes
12
- from adam.k8s_utils.secrets import Secrets
13
- from adam.k8s_utils.statefulsets import StatefulSets
12
+ from adam.utils_issues import IssuesUtils
13
+ from adam.utils_k8s.statefulsets import StatefulSets
14
14
  from adam.repl_state import ReplState, RequiredState
15
- from adam.utils import lines_to_tabular, log, log2
15
+ from adam.utils import SORT, tabulize, log, log2, log_exc
16
16
  from adam.checks.status import parse_nodetool_status
17
17
 
18
18
  class ShowCassandraStatus(Command):
@@ -37,50 +37,42 @@ class ShowCassandraStatus(Command):
37
37
  if not(args := self.args(cmd)):
38
38
  return super().run(cmd, state)
39
39
 
40
- state, args = self.apply_state(args, state)
41
- if not self.validate_state(state):
42
- return state
40
+ with self.validate(args, state) as (args, state):
41
+ with extract_options(args, ['-s', '--show']) as (args, show_out):
42
+ if state.namespace and state.pod:
43
+ self.show_single_pod(state, show_out=show_out)
44
+ elif state.namespace and state.sts:
45
+ self.merge(state, Config().get('nodetool.samples', sys.maxsize), show_output=show_out)
43
46
 
44
- args, show_output = Command.extract_options(args, ['-s', '--show'])
47
+ return state
45
48
 
46
- if state.namespace and state.pod:
47
- # self.show_table(state, [state.pod], state.namespace, show_output=show_output)
48
- self.show_single_pod(state.sts, state.pod, state.namespace, show_output=show_output)
49
- elif state.namespace and state.sts:
50
- self.merge(state.sts, StatefulSets.pod_names(state.sts, state.namespace), state.namespace, Config().get('nodetool.samples', sys.maxsize), show_output=show_output)
51
-
52
- return state
53
-
54
- def show_single_pod(self, statefulset: str, pod_name: str, ns: str, show_output = False):
55
- pod_name = pod_name.split('(')[0]
56
- user, pw = Secrets.get_user_pass(pod_name, ns)
57
- try:
58
- result = CassandraNodes.exec(pod_name, ns, f"nodetool -u {user} -pw {pw} status", show_out=False)
59
- status = parse_nodetool_status(result.stdout)
60
- check_results = run_checks(cluster=statefulset, namespace=ns, checks=[CompactionStats(), Gossip()], show_output=show_output)
61
- self.show_table(status, check_results)
62
- except Exception as e:
63
- log2(e)
49
+ def show_single_pod(self, state: ReplState, show_out = False):
50
+ with log_exc(True):
51
+ with cassandra(state) as pods:
52
+ result = pods.nodetool('status', show_out=False)
53
+ status = parse_nodetool_status(result.stdout)
54
+ check_results = run_checks(cluster=state.sts, namespace=state.namespace, checks=[CompactionStats(), Gossip()], show_out=show_out)
55
+ self.show_table(status, check_results)
64
56
 
65
- def merge(self, statefulset: str, pod_names: list[str], ns: str, samples: int, show_output=False):
57
+ def merge(self, state: ReplState, samples: int, show_output=False):
66
58
  statuses: list[list[dict]] = []
59
+
60
+ pod_names = StatefulSets.pod_names(state.sts, state.namespace)
67
61
  for pod_name in pod_names:
68
62
  pod_name = pod_name.split('(')[0]
69
- user, pw = Secrets.get_user_pass(pod_name, ns)
70
63
 
71
- try:
72
- result = CassandraNodes.exec(pod_name, ns, f"nodetool -u {user} -pw {pw} status", show_out=False)
73
- status = parse_nodetool_status(result.stdout)
74
- if status:
75
- statuses.append(status)
76
- if samples <= len(statuses) and len(pod_names) != len(statuses):
77
- break
78
- except Exception as e:
79
- log2(e)
64
+ with log_exc(True):
65
+ with cassandra(state, pod=pod_name) as pods:
66
+ result = pods.nodetool('status', show_out=False)
67
+ status = parse_nodetool_status(result.stdout)
68
+ if status:
69
+ statuses.append(status)
70
+ if samples <= len(statuses) and len(pod_names) != len(statuses):
71
+ break
80
72
 
81
73
  combined_status = self.merge_status(statuses)
82
74
  log2(f'Showing merged status from {len(statuses)}/{len(pod_names)} nodes...')
83
- check_results = run_checks(cluster=statefulset, namespace=ns, checks=[CompactionStats(), Gossip()], show_output=show_output)
75
+ check_results = run_checks(cluster=state.sts, namespace=state.namespace, checks=[CompactionStats(), Gossip()], show_out=show_output)
84
76
  self.show_table(combined_status, check_results)
85
77
 
86
78
  return combined_status
@@ -107,22 +99,12 @@ class ShowCassandraStatus(Command):
107
99
  header = Config().get('status.header', '--,Address,Load,Tokens,Owns,Host ID,GOSSIP,COMPACTIONS')
108
100
  columns = Columns.create_columns(cols)
109
101
 
110
- def line(status: dict):
111
- cells = [c.host_value(check_results, status) for c in columns]
112
- return ','.join(cells)
113
-
114
- lines = [line(d) for d in status]
115
- lines.sort()
102
+ tabulize(status, lambda s: ','.join([c.host_value(check_results, s) for c in columns]), header=header, separator=',', sorted=SORT)
116
103
 
117
- log(lines_to_tabular(lines, header, separator=','))
118
-
119
- Issues.show(check_results)
104
+ IssuesUtils.show(check_results)
120
105
 
121
106
  def completion(self, state: ReplState):
122
- if state.sts:
123
- return super().completion(state)
124
-
125
- return {}
107
+ return super().completion(state, {'-s': None})
126
108
 
127
109
  def help(self, _: ReplState):
128
110
  return f'{ShowCassandraStatus.COMMAND} [-s]\t show merged nodetool status -s show commands on nodes'
@@ -1,7 +1,5 @@
1
1
  from adam.commands.command import Command
2
- from adam.k8s_utils.cassandra_clusters import CassandraClusters
3
- from adam.k8s_utils.cassandra_nodes import CassandraNodes
4
- from adam.k8s_utils.secrets import Secrets
2
+ from adam.commands.cql.utils_cql import cassandra
5
3
  from adam.repl_state import ReplState, RequiredState
6
4
 
7
5
  class ShowCassandraVersion(Command):
@@ -26,23 +24,12 @@ class ShowCassandraVersion(Command):
26
24
  if not(args := self.args(cmd)):
27
25
  return super().run(cmd, state)
28
26
 
29
- state, _ = state.apply_args(args)
30
- if not self.validate_state(state):
31
- return state
32
-
33
- user, pw = Secrets.get_user_pass(state.sts if state.sts else state.pod, state.namespace, secret_path='cql.secret')
34
- command = f'cqlsh -u {user} -p {pw} -e "show version"'
35
-
36
- if state.pod:
37
- return CassandraNodes.exec(state.pod, state.namespace, command)
38
- else:
39
- return CassandraClusters.exec(state.sts, state.namespace, command, action='cql')
27
+ with self.validate(args, state) as (_, state):
28
+ with cassandra(state) as pods:
29
+ return pods.cql('show version', show_out=True, on_any=True)
40
30
 
41
31
  def completion(self, state: ReplState):
42
- if state.sts:
43
- return super().completion(state)
44
-
45
- return {}
32
+ return super().completion(state)
46
33
 
47
34
  def help(self, _: ReplState):
48
35
  return f'{ShowCassandraVersion.COMMAND}\t show Cassandra version'
@@ -1,7 +1,7 @@
1
1
  from adam.commands.command import Command
2
2
  from adam.commands.cli_commands import CliCommands
3
3
  from adam.repl_state import ReplState, RequiredState
4
- from adam.utils import lines_to_tabular, log
4
+ from adam.utils import tabulize, log
5
5
 
6
6
  class ShowKubectlCommands(Command):
7
7
  COMMAND = 'show cli-commands'
@@ -25,36 +25,31 @@ class ShowKubectlCommands(Command):
25
25
  if not self.args(cmd):
26
26
  return super().run(cmd, state)
27
27
 
28
- if not self.validate_state(state):
29
- return state
30
-
31
- v = CliCommands.values(state, collapse=True)
32
- # node-exec-?, nodetool-?, cql-?, reaper-exec, reaper-forward, reaper-ui, reaper-username, reaper-password
33
- cmds = [
34
- f'bash,{v["node-exec-?"]}',
35
- f'nodetool,{v["nodetool-?"]}',
36
- f'cql,{v["cql-?"]}',
37
- ]
38
-
39
- if 'reaper-exec' in v:
40
- cmds += [
41
- f'reaper,{v["reaper-exec"]}',
42
- f',{v["reaper-forward"]} * should be run from your laptop',
43
- f',{v["reaper-ui"]}',
44
- f',{v["reaper-username"]}',
45
- f',{v["reaper-password"]}',
28
+ with self.validate(args, state) as (args, state):
29
+ v = CliCommands.values(state, collapse=True)
30
+ # node-exec-?, nodetool-?, cql-?, reaper-exec, reaper-forward, reaper-ui, reaper-username, reaper-password
31
+ cmds = [
32
+ f'bash,{v["node-exec-?"]}',
33
+ f'nodetool,{v["nodetool-?"]}',
34
+ f'cql,{v["cql-?"]}',
46
35
  ]
47
36
 
48
- cmds += [f'{k},{v0}' for k, v0 in v.items() if k.startswith('pg-')]
37
+ if 'reaper-exec' in v:
38
+ cmds += [
39
+ f'reaper,{v["reaper-exec"]}',
40
+ f',{v["reaper-forward"]} * should be run from your laptop',
41
+ f',{v["reaper-ui"]}',
42
+ f',{v["reaper-username"]}',
43
+ f',{v["reaper-password"]}',
44
+ ]
49
45
 
50
- log(lines_to_tabular(cmds, separator=','))
46
+ cmds += [f'{k},{v0}' for k, v0 in v.items() if k.startswith('pg-')]
51
47
 
52
- return cmds
48
+ tabulize(cmds, separator=',')
53
49
 
54
- def completion(self, state: ReplState):
55
- if not state.sts:
56
- return {}
50
+ return cmds
57
51
 
52
+ def completion(self, state: ReplState):
58
53
  return super().completion(state)
59
54
 
60
55
  def help(self, _: ReplState):
@@ -0,0 +1,33 @@
1
+ from adam.commands.command import Command
2
+ from adam.repl_state import ReplState
3
+ from adam.utils import log
4
+ from adam.utils_net import get_my_host
5
+
6
+ class ShowHost(Command):
7
+ COMMAND = 'show host'
8
+
9
+ # the singleton pattern
10
+ def __new__(cls, *args, **kwargs):
11
+ if not hasattr(cls, 'instance'): cls.instance = super(ShowHost, 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 ShowHost.COMMAND
20
+
21
+ def run(self, cmd: str, state: ReplState):
22
+ if not self.args(cmd):
23
+ return super().run(cmd, state)
24
+
25
+ log(get_my_host())
26
+
27
+ return state
28
+
29
+ def completion(self, state: ReplState):
30
+ return super().completion(state)
31
+
32
+ def help(self, _: ReplState):
33
+ return f'{ShowHost.COMMAND}\t show host'
@@ -1,13 +1,11 @@
1
1
  import time
2
- import traceback
3
2
 
4
3
  from adam.apps import Apps
5
- from adam.config import Config
6
4
  from adam.sso.idp import Idp
7
5
  from adam.sso.idp_login import IdpLogin
8
6
  from adam.commands.command import Command
9
7
  from adam.repl_state import ReplState
10
- from adam.utils import duration, lines_to_tabular, log, log2
8
+ from adam.utils import duration, tabulize, log, log2, log_exc
11
9
 
12
10
  class ShowLogin(Command):
13
11
  COMMAND = 'show login'
@@ -24,34 +22,32 @@ class ShowLogin(Command):
24
22
  def command(self):
25
23
  return ShowLogin.COMMAND
26
24
 
25
+ def required(self):
26
+ return ReplState.NON_L
27
+
27
28
  def run(self, cmd: str, state: ReplState):
28
29
  if not(args := self.args(cmd)):
29
30
  return super().run(cmd, state)
30
31
 
31
- state, args = self.apply_state(args, state)
32
-
33
- login: IdpLogin = None
34
- try:
35
- if not(host := Apps.app_host('c3', 'c3', state.namespace)):
36
- log2('Cannot locate ingress for app.')
37
- return state
38
-
39
- login = Idp.login(host, use_token_from_env=True)
40
- if login and login.id_token_obj:
41
- it = login.id_token_obj
42
- lines = [
43
- f'email\t{it.email}',
44
- f'user\t{it.username}',
45
- f'IDP expires in\t{duration(time.time(), it.exp)}',
46
- f'IDP Groups\t{",".join(it.groups)}'
47
- ]
48
- log(lines_to_tabular(lines, separator='\t'))
49
- except Exception as e:
50
- log2(e)
51
- if Config().is_debug():
52
- log2(traceback.format_exc())
53
-
54
- return state
32
+ with self.validate(args, state) as (args, state):
33
+ login: IdpLogin = None
34
+ with log_exc(True):
35
+ if not(host := Apps.app_host('c3', 'c3', state.namespace)):
36
+ log2('Cannot locate ingress for app.')
37
+ return state
38
+
39
+ login = Idp.login(host, use_token_from_env=True)
40
+ if login and login.id_token_obj:
41
+ it = login.id_token_obj
42
+ lines = [
43
+ f'email\t{it.email}',
44
+ f'user\t{it.username}',
45
+ f'IDP expires in\t{duration(time.time(), it.exp)}',
46
+ f'IDP Groups\t{",".join(it.groups)}'
47
+ ]
48
+ tabulize(lines, separator='\t')
49
+
50
+ return state
55
51
 
56
52
  def completion(self, state: ReplState):
57
53
  return super().completion(state)
@@ -1,7 +1,7 @@
1
1
  from adam.commands.command import Command
2
2
  from adam.config import Config
3
3
  from adam.repl_state import ReplState
4
- from adam.utils import lines_to_tabular, log
4
+ from adam.utils import tabulize, log
5
5
 
6
6
  class ShowParams(Command):
7
7
  COMMAND = 'show params'
@@ -22,10 +22,7 @@ class ShowParams(Command):
22
22
  if not self.args(cmd):
23
23
  return super().run(cmd, state)
24
24
 
25
- lines = [f'{key}\t{Config().get(key, None)}' for key in Config().keys()]
26
- log(lines_to_tabular(lines, separator='\t'))
27
-
28
- return lines
25
+ return tabulize(Config().keys(), lambda k: f'{k}\t{Config().get(k, None)}', separator='\t')
29
26
 
30
27
  def completion(self, state: ReplState):
31
28
  return super().completion(state)
@@ -1,7 +1,9 @@
1
+ from adam.commands import extract_options, extract_sequence
1
2
  from adam.commands.command import Command
2
3
  from adam.commands.commands_utils import show_table
4
+ from adam.commands.cql.utils_cql import cassandra
3
5
  from adam.config import Config
4
- from adam.k8s_utils.statefulsets import StatefulSets
6
+ from adam.utils_k8s.statefulsets import StatefulSets
5
7
  from adam.repl_state import ReplState, RequiredState
6
8
 
7
9
  class ShowProcesses(Command):
@@ -26,28 +28,22 @@ class ShowProcesses(Command):
26
28
  if not(args := self.args(cmd)):
27
29
  return super().run(cmd, state)
28
30
 
29
- state, args = self.apply_state(args, state)
30
- if not self.validate_state(state):
31
- return state
31
+ with self.validate(args, state) as (args, state):
32
+ with extract_options(args, ['-s', '--show']) as (args, show_out):
33
+ with extract_sequence(args, ['with', 'recipe', '=', 'qing']) as (_, recipe_qing):
34
+ cols = Config().get('processes.columns', 'pod,cpu-metrics,mem')
35
+ header = Config().get('processes.header', 'POD_NAME,M_CPU(USAGE/LIMIT),MEM/LIMIT')
36
+ if recipe_qing:
37
+ cols = Config().get('processes-qing.columns', 'pod,cpu,mem')
38
+ header = Config().get('processes-qing.header', 'POD_NAME,Q_CPU/TOTAL,MEM/LIMIT')
32
39
 
33
- args, show_output = Command.extract_options(args, ['-s', '--show'])
40
+ with cassandra(state) as pods:
41
+ pods.display_table(cols, header, show_out=show_out)
34
42
 
35
- cols = Config().get('processes.columns', 'pod,cpu,mem')
36
- header = Config().get('processes.header', 'POD_NAME,CPU,MEM/LIMIT')
37
-
38
- if state.pod:
39
- show_table(state, [state.pod], cols, header, show_output=show_output)
40
- elif state.sts:
41
- pod_names = [pod.metadata.name for pod in StatefulSets.pods(state.sts, state.namespace)]
42
- show_table(state, pod_names, cols, header, show_output=show_output)
43
-
44
- return state
43
+ return state
45
44
 
46
45
  def completion(self, state: ReplState):
47
- if not state.sts:
48
- return {}
49
-
50
- return super().completion(state)
46
+ return super().completion(state, {'with': {'recipe': {'=': {'metrics': {'-s': None}, 'qing': {'-s': None}}}}, '-s': None})
51
47
 
52
48
  def help(self, _: ReplState):
53
- return f'{ShowProcesses.COMMAND} [-s]\t show process overview -s show commands on nodes'
49
+ return f'{ShowProcesses.COMMAND} [with recipe qing|metrics] [-s]\t show process overview -s show commands on nodes'
@@ -1,7 +1,7 @@
1
+ from adam.commands import extract_options
1
2
  from adam.commands.command import Command
2
- from adam.commands.commands_utils import show_table
3
+ from adam.commands.cql.utils_cql import cassandra
3
4
  from adam.config import Config
4
- from adam.k8s_utils.statefulsets import StatefulSets
5
5
  from adam.repl_state import ReplState, RequiredState
6
6
 
7
7
  class ShowStorage(Command):
@@ -26,27 +26,17 @@ class ShowStorage(Command):
26
26
  if not(args := self.args(cmd)):
27
27
  return super().run(cmd, state)
28
28
 
29
- state, args = self.apply_state(args, state)
30
- if not self.validate_state(state):
31
- return state
29
+ with self.validate(args, state) as (args, state):
30
+ with extract_options(args, ['-s', '--show']) as (args, show_out):
31
+ cols = Config().get('storage.columns', 'pod,volume_root,volume_cassandra,snapshots,data,compactions')
32
+ header = Config().get('storage.header', 'POD_NAME,VOLUME /,VOLUME CASS,SNAPSHOTS,DATA,COMPACTIONS')
33
+ with cassandra(state) as pods:
34
+ pods.display_table(cols, header, show_out=show_out)
32
35
 
33
- args, show_output = Command.extract_options(args, ['-s', '--show'])
34
-
35
- cols = Config().get('storage.columns', 'pod,volume_root,volume_cassandra,snapshots,data,compactions')
36
- header = Config().get('storage.header', 'POD_NAME,VOLUME /,VOLUME CASS,SNAPSHOTS,DATA,COMPACTIONS')
37
- if state.pod:
38
- show_table(state, [state.pod], cols, header, show_output=show_output)
39
- elif state.sts:
40
- pod_names = [pod.metadata.name for pod in StatefulSets.pods(state.sts, state.namespace)]
41
- show_table(state, pod_names, cols, header, show_output=show_output)
42
-
43
- return state
36
+ return state
44
37
 
45
38
  def completion(self, state: ReplState):
46
- if not state.sts:
47
- return {}
48
-
49
- return super().completion(state)
39
+ return super().completion(state, {'-s': None})
50
40
 
51
41
  def help(self, _: ReplState):
52
42
  return f'{ShowStorage.COMMAND} [-s]\t show storage overview -s show commands on nodes'
adam/commands/watch.py CHANGED
@@ -6,12 +6,12 @@ from typing import List
6
6
  from adam.commands.command import Command
7
7
  from adam.commands.commands_utils import show_pods, show_rollout
8
8
  from adam.config import Config
9
- from adam.k8s_utils.statefulsets import StatefulSets
9
+ from adam.utils_k8s.statefulsets import StatefulSets
10
10
  from adam.repl_state import ReplState, RequiredState
11
- from adam.utils import convert_seconds, log2
11
+ from adam.utils import log2
12
12
 
13
13
  class Watch(Command):
14
- COMMAND = 'watch'
14
+ COMMAND = 'watch cassandra pods'
15
15
 
16
16
  # the singleton pattern
17
17
  def __new__(cls, *args, **kwargs):
@@ -26,37 +26,34 @@ class Watch(Command):
26
26
  return Watch.COMMAND
27
27
 
28
28
  def required(self):
29
- return RequiredState.CLUSTER_OR_POD
29
+ return RequiredState.NAMESPACE
30
30
 
31
31
  def run(self, cmd: str, state: ReplState):
32
32
  if not(args := self.args(cmd)):
33
33
  return super().run(cmd, state)
34
34
 
35
- state, args = self.apply_state(args, state)
36
- if not self.validate_state(state):
37
- return state
38
-
39
- pods = StatefulSets.pods(state.sts, state.namespace)
40
- if not pods:
41
- log2("No pods are found.")
42
- return state
35
+ with self.validate(args, state) as (args, state):
36
+ pods = StatefulSets.pods(state.sts, state.namespace)
37
+ if not pods:
38
+ log2("No pods are found.")
39
+ return state
43
40
 
44
- stop_event = threading.Event()
45
- thread = threading.Thread(target=self.loop, args=(stop_event, state.sts, pods, state.namespace), daemon=True)
46
- thread.start()
41
+ stop_event = threading.Event()
42
+ thread = threading.Thread(target=self.loop, args=(stop_event, state.sts, pods, state.namespace), daemon=True)
43
+ thread.start()
47
44
 
48
- try:
49
- log2(f"Press Ctrl+C to break.")
45
+ try:
46
+ log2(f"Press Ctrl+C to break.")
50
47
 
51
- time.sleep(Config().get('watch.timeout', 3600 * 1))
52
- except KeyboardInterrupt:
53
- pass
48
+ time.sleep(Config().get('watch.timeout', 3600 * 1))
49
+ except KeyboardInterrupt:
50
+ pass
54
51
 
55
- log2("Stopping watch...")
56
- stop_event.set()
57
- thread.join()
52
+ log2("Stopping watch...")
53
+ stop_event.set()
54
+ thread.join()
58
55
 
59
- return state
56
+ return state
60
57
 
61
58
  def loop(self, stop_flag: threading.Event, sts: str, pods: List[client.V1Pod], ns: str):
62
59
  show_pods(pods, ns)
@@ -73,13 +70,13 @@ class Watch(Command):
73
70
  cnt = Config().get('watch.interval', 10)
74
71
 
75
72
  def completion(self, state: ReplState):
76
- if state.pod:
77
- return {}
73
+ if sc := super().completion(state):
74
+ if state.sts:
75
+ return sc
78
76
 
79
- if not state.sts:
80
- return {Watch.COMMAND: {n: None for n in StatefulSets.list_sts_names()}}
77
+ return super().completion(state, {n: None for n in StatefulSets.list_sts_names()})
81
78
 
82
- return {Watch.COMMAND: None}
79
+ return {}
83
80
 
84
81
  def help(self, _: ReplState):
85
- return f'{Watch.COMMAND}\t watch pod changes'
82
+ return f'{Watch.COMMAND}\t watch Cassandra pod changes'
adam/config.py CHANGED
@@ -1,14 +1,18 @@
1
+ import os
1
2
  from typing import TypeVar, cast
2
3
  import yaml
3
4
 
4
5
  from . import __version__
5
- from adam.utils import copy_config_file, get_deep_keys, log2
6
+ from adam.utils import LogConfig, copy_config_file, get_deep_keys, log2
6
7
 
7
8
  T = TypeVar('T')
8
9
 
9
10
  class Config:
10
11
  EMBEDDED_PARAMS = {}
11
12
 
13
+ LogConfig.is_debug = lambda: Config().is_debug()
14
+ LogConfig.is_debug_timing = lambda: Config().get('debugs.timings', False)
15
+
12
16
  # the singleton pattern
13
17
  def __new__(cls, *args, **kwargs):
14
18
  if not hasattr(cls, 'instance'): cls.instance = super(Config, cls).__new__(cls)
@@ -38,11 +42,7 @@ class Config:
38
42
  return get_deep_keys(self.params)
39
43
 
40
44
  def is_debug(self):
41
- return Config().get('debug', False)
42
-
43
- def debug(self, s: None):
44
- if self.is_debug():
45
- log2(f'DEBUG {s}')
45
+ return os.getenv('QING_DEV', 'false').lower() == 'true' or Config().get('debug', False)
46
46
 
47
47
  def get(self, key: str, default: T) -> T:
48
48
  # params['nodetool']['status']['max-nodes']
@@ -84,12 +84,4 @@ class Config:
84
84
  log2(f'incorrect path: {key}')
85
85
  return None
86
86
 
87
- return v if v else 'false'
88
-
89
- def wait_log(self, msg: str):
90
- if hasattr(self, 'wait_log_flag') and not self.wait_log_flag:
91
- log2(msg)
92
- self.wait_log_flag = True
93
-
94
- def clear_wait_log_flag(self):
95
- self.wait_log_flag = False
87
+ return v if v else 'false'
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'}, 'alter-tables': {'excludes': 'system_auth,system_traces,reaper_db,system_distributed,system_views,system,system_schema,system_virtual_schema', 'gc-grace-periods': '3600,86400,864000,7776000', 'batching': True}}, '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.14', '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': False, 'debugs': {'timings': False, 'exit-on-error': False, 'show-parallelism': False}}
2
+ return {'app': {'console-endpoint': 'https://{host}/{env}/{app}/static/console/index.html', 'container-name': 'c3-server', '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'}, 'audit': {'endpoint': 'https://4psvtaxlcb.execute-api.us-west-2.amazonaws.com/prod/', 'workers': 3, 'timeout': 10, 'log-audit-queries': False, 'athena': {'auto-repair': {'elapsed_hours': 12}, 'region': 'us-west-2', 'catalog': 'AwsDataCatalog', 'database': 'audit', 'repair-partition-tables': 'audit', 'output': 's3://s3.ops--audit/ddl/results', 'repair-cluster-tables': 'cluster'}, 'queries': {'last10': "SELECT * FROM audit\nWHERE drive <> 'z' and ({date_condition})\nORDER BY ts DESC LIMIT {limit}", 'slow10': "SELECT * FROM audit\nWHERE drive <> 'z' and ({date_condition})\nORDER BY CAST(duration AS REAL) DESC LIMIT {limit}", 'top10': "SELECT min(c) AS cluster, line, COUNT(*) AS cnt, avg(CAST(duration AS REAL)) AS duration\nFROM audit WHERE drive <> 'z' and ({date_condition})\nGROUP BY line ORDER BY cnt DESC LIMIT {limit}"}}, 'bash': {'workers': 32}, 'cassandra': {'service-name': 'all-pods-service'}, 'cql': {'workers': 32, 'samples': 3, 'secret': {'cluster-regex': '(.*?-.*?)-.*', 'name': '{cluster}-superuser', 'password-item': 'password'}, 'alter-tables': {'excludes': 'system_auth,system_traces,reaper_db,system_distributed,system_views,system,system_schema,system_virtual_schema', 'gc-grace-periods': '3600,86400,864000,7776000', 'batching': True}}, '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/{}"}, 'download': {'workers': 8}, 'export': {'workers': 8, 'csv_dir': '/c3/cassandra/tmp', 'column_counts_query': 'select id, count(id) as columns from {table} group by id order by columns desc limit 10', 'default-importer': 'sqlite', 'sqlite': {'workers': 8, 'columns': '<row-key>', 'local-db-dir': '/tmp/qing-db'}, 'athena': {'workers': 8, 'columns': '<keys>', 'bucket': 'c3.ops--qing'}, 'csv': {'workers': 8, 'columns': '<row-key>'}, 'log-prefix': '/tmp/qing'}, '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}, 'local-tmp-dir': '/tmp/qing-db', 'logs': {'path': '/c3/cassandra/logs/system.log'}, 'log-prefix': '/tmp/qing', 'medusa': {'restore-auto-complete': False}, 'nodetool': {'workers': 96, 'commands_in_line': 40, 'status': {'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-metrics,mem', 'header': 'POD_NAME,M_CPU(USAGE/LIMIT),MEM/LIMIT'}, 'processes-qing': {'columns': 'pod,cpu,mem', 'header': 'POD_NAME,Q_CPU/TOTAL,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.14', 'secret': 'ciregistryc3iotio', 'env': {'interval': 24, 'timeout': 60, 'pr': False, 'runs': 1}}, 'repl': {'start-drive': 'c', 'a': {'auto-enter': 'c3/c3/*'}, 'c': {'auto-enter': 'cluster'}, 'x': {'auto-enter': 'latest'}, 'history': {'push-cat-log-file': True, 'push-cat-remote-log-file': True}, 'background-process': {'auto-nohup': 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': False, 'debugs': {'timings': False, 'exit-on-error': False, 'show-parallelism': False}}