kaqing 2.0.89__tar.gz → 2.0.90__tar.gz
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.
- {kaqing-2.0.89 → kaqing-2.0.90}/PKG-INFO +1 -1
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/bash.py +6 -6
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/cql/cql_utils.py +4 -1
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/nodetool.py +4 -1
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/embedded_params.py +1 -1
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/k8s_utils/cassandra_clusters.py +3 -4
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/k8s_utils/cassandra_nodes.py +2 -2
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/k8s_utils/pods.py +14 -6
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/k8s_utils/secrets.py +2 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/repl.py +4 -1
- kaqing-2.0.90/adam/version.py +5 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/kaqing.egg-info/PKG-INFO +1 -1
- {kaqing-2.0.89 → kaqing-2.0.90}/setup.py +1 -1
- kaqing-2.0.89/adam/version.py +0 -5
- {kaqing-2.0.89 → kaqing-2.0.90}/README +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/__init__.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/app_session.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/apps.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/batch.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/checks/__init__.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/checks/check.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/checks/check_context.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/checks/check_result.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/checks/check_utils.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/checks/compactionstats.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/checks/cpu.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/checks/disk.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/checks/gossip.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/checks/issue.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/checks/memory.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/checks/status.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/cli.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/cli_group.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/columns/__init__.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/columns/column.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/columns/columns.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/columns/compactions.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/columns/cpu.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/columns/dir_data.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/columns/dir_snapshots.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/columns/gossip.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/columns/host_id.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/columns/memory.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/columns/node_address.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/columns/node_load.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/columns/node_owns.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/columns/node_status.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/columns/node_tokens.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/columns/node_utils.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/columns/pod_name.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/columns/volume_cassandra.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/columns/volume_root.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/__init__.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/alter_tables.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/app.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/app_ping.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/audit/__init__.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/audit/audit.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/audit/audit_repair_tables.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/cd.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/check.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/cli_commands.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/command.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/command_helpers.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/commands_utils.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/cp.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/cql/__init__.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/cql/cql_completions.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/cql/cql_table_completer.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/cql/cqlsh.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/deploy/__init__.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/deploy/code_start.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/deploy/code_stop.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/deploy/code_utils.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/deploy/deploy.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/deploy/deploy_frontend.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/deploy/deploy_pg_agent.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/deploy/deploy_pod.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/deploy/deploy_utils.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/deploy/undeploy.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/deploy/undeploy_frontend.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/deploy/undeploy_pg_agent.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/deploy/undeploy_pod.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/describe/__init__.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/describe/describe.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/describe/describe_keyspace.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/describe/describe_keyspaces.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/describe/describe_table.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/describe/describe_tables.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/devices.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/exit.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/help.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/issues.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/login.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/logs.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/ls.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/medusa/__init__.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/medusa/medusa.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/medusa/medusa_backup.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/medusa/medusa_restore.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/medusa/medusa_show_backupjobs.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/medusa/medusa_show_restorejobs.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/nodetool_commands.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/param_get.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/param_set.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/postgres/__init__.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/postgres/postgres.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/postgres/postgres_ls.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/postgres/postgres_preview.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/postgres/postgres_session.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/postgres/postgres_utils.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/postgres/psql_completions.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/postgres/psql_table_completer.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/preview_table.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/pwd.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/reaper/__init__.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/reaper/reaper.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/reaper/reaper_forward.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/reaper/reaper_forward_stop.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/reaper/reaper_restart.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/reaper/reaper_run_abort.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/reaper/reaper_runs.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/reaper/reaper_runs_abort.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/reaper/reaper_schedule_activate.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/reaper/reaper_schedule_start.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/reaper/reaper_schedule_stop.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/reaper/reaper_schedules.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/reaper/reaper_session.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/reaper/reaper_status.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/repair/__init__.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/repair/repair.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/repair/repair_log.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/repair/repair_run.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/repair/repair_scan.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/repair/repair_stop.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/report.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/restart.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/rollout.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/shell.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/show/__init__.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/show/show.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/show/show_adam.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/show/show_app_actions.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/show/show_app_id.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/show/show_app_queues.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/show/show_cassandra_status.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/show/show_cassandra_version.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/show/show_commands.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/show/show_host.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/show/show_login.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/show/show_params.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/show/show_processes.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/show/show_repairs.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/show/show_storage.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/commands/watch.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/config.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/embedded_apps.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/k8s_utils/__init__.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/k8s_utils/config_maps.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/k8s_utils/custom_resources.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/k8s_utils/deployment.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/k8s_utils/ingresses.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/k8s_utils/jobs.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/k8s_utils/kube_context.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/k8s_utils/service_accounts.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/k8s_utils/services.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/k8s_utils/statefulsets.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/k8s_utils/volumes.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/log.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/pod_exec_result.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/repl_commands.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/repl_session.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/repl_state.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/sql/__init__.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/sql/sql_completer.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/sql/state_machine.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/sql/term_completer.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/sso/__init__.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/sso/authenticator.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/sso/authn_ad.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/sso/authn_okta.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/sso/cred_cache.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/sso/id_token.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/sso/idp.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/sso/idp_login.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/sso/idp_session.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/sso/sso_config.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/utils.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/utils_athena.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/adam/utils_net.py +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/kaqing.egg-info/SOURCES.txt +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/kaqing.egg-info/dependency_links.txt +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/kaqing.egg-info/entry_points.txt +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/kaqing.egg-info/top_level.txt +0 -0
- {kaqing-2.0.89 → kaqing-2.0.90}/setup.cfg +0 -0
|
@@ -38,8 +38,7 @@ class Bash(Command):
|
|
|
38
38
|
|
|
39
39
|
return r
|
|
40
40
|
else:
|
|
41
|
-
|
|
42
|
-
command = f'bash -c "{a}"'
|
|
41
|
+
command = ' '.join(args)
|
|
43
42
|
|
|
44
43
|
if state.pod:
|
|
45
44
|
CassandraNodes.exec(state.pod, state.namespace, command, show_out=True)
|
|
@@ -65,15 +64,16 @@ class Bash(Command):
|
|
|
65
64
|
if pwd := state.bash_session.pwd(state):
|
|
66
65
|
args = ['cd', pwd, '&&'] + args
|
|
67
66
|
|
|
68
|
-
|
|
69
|
-
command = f'bash -c "{a}"'
|
|
67
|
+
command = ' '.join(args)
|
|
70
68
|
|
|
71
69
|
rs = []
|
|
72
70
|
|
|
73
71
|
if state.pod:
|
|
74
|
-
rs = [CassandraNodes.exec(state.pod, state.namespace, command,
|
|
72
|
+
rs = [CassandraNodes.exec(state.pod, state.namespace, command,
|
|
73
|
+
show_out=not session_just_created, shell='bash')]
|
|
75
74
|
elif state.sts:
|
|
76
|
-
rs = CassandraClusters.exec(state.sts, state.namespace, command, action='bash',
|
|
75
|
+
rs = CassandraClusters.exec(state.sts, state.namespace, command, action='bash',
|
|
76
|
+
show_out=not session_just_created, shell='bash')
|
|
77
77
|
|
|
78
78
|
return rs
|
|
79
79
|
|
|
@@ -11,7 +11,10 @@ from adam.utils import log2
|
|
|
11
11
|
|
|
12
12
|
@functools.lru_cache()
|
|
13
13
|
def keyspaces(state: ReplState, on_any=False):
|
|
14
|
-
|
|
14
|
+
if state.pod:
|
|
15
|
+
Config().wait_log(f'Inspecting Cassandra Keyspaces on {state.pod}...')
|
|
16
|
+
else:
|
|
17
|
+
Config().wait_log(f'Inspecting Cassandra Keyspaces...')
|
|
15
18
|
|
|
16
19
|
r: list[PodExecResult] = run_cql(state, 'describe keyspaces', show_out=False, on_any=on_any)
|
|
17
20
|
if not r:
|
|
@@ -7,7 +7,7 @@ from adam.config import Config
|
|
|
7
7
|
from adam.k8s_utils.cassandra_clusters import CassandraClusters
|
|
8
8
|
from adam.k8s_utils.cassandra_nodes import CassandraNodes
|
|
9
9
|
from adam.repl_state import ReplState, RequiredState
|
|
10
|
-
from adam.utils import log
|
|
10
|
+
from adam.utils import log, random_alphanumeric
|
|
11
11
|
|
|
12
12
|
class NodeTool(Command):
|
|
13
13
|
COMMAND = 'nodetool'
|
|
@@ -36,6 +36,9 @@ class NodeTool(Command):
|
|
|
36
36
|
return state
|
|
37
37
|
|
|
38
38
|
user, pw = state.user_pass()
|
|
39
|
+
# if args and args[len(args) - 1] == '&':
|
|
40
|
+
# command = f'bash -c "nohup nodetool -u {user} -pw {pw} {" ".join(args[:-1])} &> /tmp/qing-{random_alphanumeric(6)}.log &"'
|
|
41
|
+
# else:
|
|
39
42
|
command = f"nodetool -u {user} -pw {pw} {' '.join(args)}"
|
|
40
43
|
|
|
41
44
|
if state.pod:
|
|
@@ -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'}, 'audit': {'endpoint': 'https://4psvtaxlcb.execute-api.us-west-2.amazonaws.com/prod/', 'workers': 3, 'timeout': 10, 'log-audit-queries': False, 'athena': {'region': 'us-west-2', 'catalog': 'AwsDataCatalog', 'database': 'audit', 'tables': 'audit', 'output': 's3://s3.ops--audit/ddl/results'}}, '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':
|
|
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'}, 'audit': {'endpoint': 'https://4psvtaxlcb.execute-api.us-west-2.amazonaws.com/prod/', 'workers': 3, 'timeout': 10, 'log-audit-queries': False, 'athena': {'region': 'us-west-2', 'catalog': 'AwsDataCatalog', 'database': 'audit', 'tables': 'audit', 'output': 's3://s3.ops--audit/ddl/results'}}, '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': 'cluster'}, '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}}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
from collections.abc import Callable
|
|
2
1
|
from concurrent.futures import ThreadPoolExecutor
|
|
3
2
|
import sys
|
|
4
3
|
from typing import TypeVar
|
|
5
4
|
|
|
6
|
-
from adam.config import Config
|
|
7
5
|
from adam.k8s_utils.cassandra_nodes import CassandraNodes
|
|
8
6
|
from adam.pod_exec_result import PodExecResult
|
|
9
7
|
from adam.utils import log2
|
|
@@ -15,10 +13,11 @@ T = TypeVar('T')
|
|
|
15
13
|
|
|
16
14
|
# utility collection on cassandra clusters; methods are all static
|
|
17
15
|
class CassandraClusters:
|
|
18
|
-
def exec(statefulset: str, namespace: str, command: str, action: str = 'action',
|
|
16
|
+
def exec(statefulset: str, namespace: str, command: str, action: str = 'action',
|
|
17
|
+
max_workers=0, show_out=True, on_any = False, shell = '/bin/sh') -> list[PodExecResult]:
|
|
19
18
|
def body(executor: ThreadPoolExecutor, pod: str, namespace: str, show_out: bool):
|
|
20
19
|
if executor:
|
|
21
|
-
return executor.submit(CassandraNodes.exec, pod, namespace, command, False, False,)
|
|
20
|
+
return executor.submit(CassandraNodes.exec, pod, namespace, command, False, False, shell)
|
|
22
21
|
|
|
23
22
|
return CassandraNodes.exec(pod, namespace, command, show_out=show_out)
|
|
24
23
|
|
|
@@ -5,8 +5,8 @@ from adam.pod_exec_result import PodExecResult
|
|
|
5
5
|
|
|
6
6
|
# utility collection on cassandra nodes; methods are all static
|
|
7
7
|
class CassandraNodes:
|
|
8
|
-
def exec(pod_name: str, namespace: str, command: str, show_out = True, throw_err = False) -> PodExecResult:
|
|
9
|
-
return Pods.exec(pod_name, "cassandra", namespace, command, show_out, throw_err)
|
|
8
|
+
def exec(pod_name: str, namespace: str, command: str, show_out = True, throw_err = False, shell = '/bin/sh') -> PodExecResult:
|
|
9
|
+
return Pods.exec(pod_name, "cassandra", namespace, command, show_out = show_out, throw_err = throw_err, shell = shell)
|
|
10
10
|
|
|
11
11
|
def get_host_id(pod_name: str, ns: str):
|
|
12
12
|
try:
|
|
@@ -10,7 +10,7 @@ from kubernetes.stream.ws_client import ERROR_CHANNEL
|
|
|
10
10
|
from adam.config import Config
|
|
11
11
|
from adam.k8s_utils.volumes import ConfigMapMount
|
|
12
12
|
from adam.pod_exec_result import PodExecResult
|
|
13
|
-
from adam.utils import elapsed_time, log2
|
|
13
|
+
from adam.utils import elapsed_time, log2, random_alphanumeric
|
|
14
14
|
from .kube_context import KubeContext
|
|
15
15
|
|
|
16
16
|
T = TypeVar('T')
|
|
@@ -93,7 +93,8 @@ class Pods:
|
|
|
93
93
|
|
|
94
94
|
return results
|
|
95
95
|
|
|
96
|
-
def exec(pod_name: str, container: str, namespace: str, command: str, show_out = True, throw_err = False,
|
|
96
|
+
def exec(pod_name: str, container: str, namespace: str, command: str, show_out = True, throw_err = False, shell = '/bin/sh',
|
|
97
|
+
interaction: Callable[[any, list[str]], any] = None):
|
|
97
98
|
if _TEST_POD_EXEC_OUTS:
|
|
98
99
|
return _TEST_POD_EXEC_OUTS
|
|
99
100
|
|
|
@@ -101,8 +102,15 @@ class Pods:
|
|
|
101
102
|
|
|
102
103
|
api = client.CoreV1Api()
|
|
103
104
|
|
|
104
|
-
|
|
105
|
-
|
|
105
|
+
tty = True
|
|
106
|
+
exec_command = [shell, '-c', command]
|
|
107
|
+
if command.endswith(' &'):
|
|
108
|
+
command = f"nohup {command.strip(' &')} > /tmp/qing-{random_alphanumeric(6)}.log 2>&1 &"
|
|
109
|
+
exec_command = [shell, '-c', command]
|
|
110
|
+
# should be false for starting a backgroud process
|
|
111
|
+
tty = False
|
|
112
|
+
|
|
113
|
+
k_command = f'kubectl exec {pod_name} -c {container} -n {namespace} -- {shell} -c "{command}"'
|
|
106
114
|
if show_out:
|
|
107
115
|
print(k_command)
|
|
108
116
|
|
|
@@ -115,7 +123,7 @@ class Pods:
|
|
|
115
123
|
stderr=True,
|
|
116
124
|
stdin=True,
|
|
117
125
|
stdout=True,
|
|
118
|
-
tty=
|
|
126
|
+
tty=tty,
|
|
119
127
|
_preload_content=False,
|
|
120
128
|
)
|
|
121
129
|
|
|
@@ -140,7 +148,7 @@ class Pods:
|
|
|
140
148
|
try:
|
|
141
149
|
# get the exit code from server
|
|
142
150
|
error_output = resp.read_channel(ERROR_CHANNEL)
|
|
143
|
-
except Exception:
|
|
151
|
+
except Exception as e:
|
|
144
152
|
pass
|
|
145
153
|
except Exception as e:
|
|
146
154
|
if throw_err:
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import base64
|
|
2
|
+
import functools
|
|
2
3
|
import re
|
|
3
4
|
from typing import cast
|
|
4
5
|
from kubernetes import client
|
|
@@ -9,6 +10,7 @@ from adam.utils import log2
|
|
|
9
10
|
|
|
10
11
|
# utility collection on secrets; methods are all static
|
|
11
12
|
class Secrets:
|
|
13
|
+
@functools.lru_cache()
|
|
12
14
|
def list_secrets(namespace: str = None, name_pattern: str = None):
|
|
13
15
|
Config().wait_log('Inspecting Cassandra Instances...')
|
|
14
16
|
|
|
@@ -69,13 +69,16 @@ def enter_repl(state: ReplState):
|
|
|
69
69
|
Log.log2(f'kaqing {__version__}')
|
|
70
70
|
|
|
71
71
|
if state.device == ReplState.C:
|
|
72
|
+
auto_enter = Config().get('repl.auto-enter-only-cluster', 'cluster')
|
|
72
73
|
ss = StatefulSets.list_sts_name_and_ns()
|
|
73
74
|
if not ss:
|
|
74
75
|
raise Exception("no Cassandra clusters found")
|
|
75
|
-
elif not state.sts and len(ss) == 1 and
|
|
76
|
+
elif not state.sts and len(ss) == 1 and auto_enter in ['cluster', 'first-pod']:
|
|
76
77
|
cluster = ss[0]
|
|
77
78
|
state.sts = cluster[0]
|
|
78
79
|
state.namespace = cluster[1]
|
|
80
|
+
if auto_enter == 'first-pod':
|
|
81
|
+
state.pod = f'{state.sts}-0'
|
|
79
82
|
if KubeContext().in_cluster_namespace:
|
|
80
83
|
Config().wait_log(f'Moving to the only Cassandra cluster: {state.sts}...')
|
|
81
84
|
else:
|
kaqing-2.0.89/adam/version.py
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|