sbcli-pre 1.1.7__zip → 1.1.9__zip
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.
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/PKG-INFO +1 -1
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/env_var +1 -1
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/sbcli_pre.egg-info/PKG-INFO +1 -1
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_cli/cli.py +10 -2
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/cluster_ops.py +0 -22
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/controllers/tasks_controller.py +34 -1
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/controllers/tasks_events.py +5 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/kv_store.py +5 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/models/job_schedule.py +2 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/services/tasks_runner_restart.py +12 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/storage_node_ops.py +2 -2
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/README.md +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/pyproject.toml +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/sbcli_pre.egg-info/SOURCES.txt +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/sbcli_pre.egg-info/dependency_links.txt +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/sbcli_pre.egg-info/entry_points.txt +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/sbcli_pre.egg-info/requires.txt +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/sbcli_pre.egg-info/top_level.txt +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/setup.cfg +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/setup.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_cli/main.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/__init__.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/cnode_client.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/compute_node_ops.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/constants.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/controllers/__init__.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/controllers/caching_node_controller.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/controllers/cluster_events.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/controllers/device_controller.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/controllers/device_events.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/controllers/events_controller.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/controllers/health_controller.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/controllers/lvol_controller.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/controllers/lvol_events.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/controllers/mgmt_events.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/controllers/pool_controller.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/controllers/pool_events.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/controllers/snapshot_controller.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/controllers/snapshot_events.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/controllers/storage_events.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/distr_controller.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/mgmt_node_ops.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/models/__init__.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/models/base_model.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/models/caching_node.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/models/cluster.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/models/compute_node.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/models/events.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/models/global_settings.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/models/iface.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/models/lvol_model.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/models/mgmt_node.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/models/nvme_device.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/models/pool.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/models/port_stat.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/models/snapshot.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/models/stats.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/models/storage_node.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/pci_utils.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/rpc_client.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/scripts/__init__.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/scripts/alerting/alert_resources.yaml.j2 +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/scripts/alerting/alert_rules.yaml +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/scripts/clean_local_storage_deploy.sh +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/scripts/config_docker.sh +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/scripts/dashboards/cluster.json +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/scripts/dashboards/devices.json +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/scripts/dashboards/lvols.json +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/scripts/dashboards/node-exporter.json +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/scripts/dashboards/nodes.json +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/scripts/dashboards/pools.json +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/scripts/datasource.yml +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/scripts/db_config_double.sh +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/scripts/db_config_single.sh +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/scripts/deploy_stack.sh +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/scripts/docker-compose-swarm-monitoring.yml +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/scripts/docker-compose-swarm.yml +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/scripts/haproxy.cfg +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/scripts/install_deps.sh +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/scripts/prometheus.yml +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/scripts/run_ssh.sh +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/scripts/set_db_config.sh +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/scripts/stack_deploy_wait.sh +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/services/__init__.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/services/caching_node_monitor.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/services/cap_monitor.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/services/capacity_and_stats_collector.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/services/device_monitor.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/services/distr_event_collector.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/services/health_check_service.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/services/install_service.sh +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/services/log_agg_service.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/services/lvol_monitor.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/services/lvol_stat_collector.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/services/mgmt_node_monitor.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/services/port_stat_collector.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/services/remove_service.sh +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/services/service_template.service +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/services/storage_node_monitor.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/services/tasks_runner_migration.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/shell_utils.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/snode_client.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/utils.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_web/__init__.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_web/app.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_web/auth_middleware.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_web/blueprints/__init__.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_web/blueprints/caching_node_ops.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_web/blueprints/caching_node_ops_k8s.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_web/blueprints/node_api_basic.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_web/blueprints/node_api_caching_docker.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_web/blueprints/node_api_caching_ks.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_web/blueprints/snode_ops.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_web/blueprints/web_api_caching_node.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_web/blueprints/web_api_cluster.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_web/blueprints/web_api_device.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_web/blueprints/web_api_lvol.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_web/blueprints/web_api_mgmt_node.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_web/blueprints/web_api_pool.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_web/blueprints/web_api_snapshot.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_web/blueprints/web_api_storage_node.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_web/caching_node_app.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_web/caching_node_app_k8s.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_web/node_utils.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_web/node_webapp.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_web/snode_app.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_web/static/delete.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_web/static/deploy.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_web/static/deploy_cnode.yaml +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_web/static/deploy_spdk.yaml +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_web/static/is_up.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_web/static/list_deps.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_web/static/rpac.yaml +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_web/static/tst.py +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_web/templates/deploy_spdk.yaml.j2 +0 -0
- {sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_web/utils.py +0 -0
@@ -10,7 +10,8 @@ from simplyblock_core import compute_node_ops as compute_ops
|
|
10
10
|
from simplyblock_core import storage_node_ops as storage_ops
|
11
11
|
from simplyblock_core import mgmt_node_ops as mgmt_ops
|
12
12
|
from simplyblock_core import constants
|
13
|
-
from simplyblock_core.controllers import pool_controller, lvol_controller, snapshot_controller, device_controller
|
13
|
+
from simplyblock_core.controllers import pool_controller, lvol_controller, snapshot_controller, device_controller, \
|
14
|
+
tasks_controller
|
14
15
|
from simplyblock_core.controllers import caching_node_controller, health_controller
|
15
16
|
from simplyblock_core.models.pool import Pool
|
16
17
|
|
@@ -324,6 +325,10 @@ class CLIWrapper:
|
|
324
325
|
sub_command = self.add_sub_command(subparser, "list-tasks", 'List tasks by cluster ID')
|
325
326
|
sub_command.add_argument("cluster_id", help='UUID of the cluster')
|
326
327
|
|
328
|
+
# cancel task
|
329
|
+
sub_command = self.add_sub_command(subparser, "cancel-task", 'Cancel task by ID')
|
330
|
+
sub_command.add_argument("id", help='UUID of the Task')
|
331
|
+
|
327
332
|
# delete cluster
|
328
333
|
sub_command = self.add_sub_command(
|
329
334
|
subparser, 'delete', 'Delete Cluster',
|
@@ -846,7 +851,10 @@ class CLIWrapper:
|
|
846
851
|
ret = cluster_ops.update_cluster(args.id)
|
847
852
|
|
848
853
|
elif sub_command == "list-tasks":
|
849
|
-
ret =
|
854
|
+
ret = tasks_controller.list_tasks(args.cluster_id)
|
855
|
+
|
856
|
+
elif sub_command == "cancel-task":
|
857
|
+
ret = tasks_controller.cancel_task(args.id)
|
850
858
|
|
851
859
|
elif sub_command == "graceful-shutdown":
|
852
860
|
ret = cluster_ops.cluster_grace_shutdown(args.id)
|
@@ -588,28 +588,6 @@ def update_cluster(cl_id):
|
|
588
588
|
logger.info("Done")
|
589
589
|
return True
|
590
590
|
|
591
|
-
|
592
|
-
def list_tasks(cluster_id):
|
593
|
-
db_controller = DBController()
|
594
|
-
cluster = db_controller.get_cluster_by_id(cluster_id)
|
595
|
-
if not cluster:
|
596
|
-
logger.error("Cluster not found: %s", cluster_id)
|
597
|
-
return False
|
598
|
-
|
599
|
-
data = []
|
600
|
-
tasks = db_controller.get_job_tasks(cluster_id)
|
601
|
-
for task in tasks:
|
602
|
-
data.append({
|
603
|
-
"Task ID": task.uuid,
|
604
|
-
"Target ID": task.device_id or task.node_id,
|
605
|
-
"Function": task.function_name,
|
606
|
-
"Retry": f"{task.retry}/{constants.TASK_EXEC_RETRY_COUNT}",
|
607
|
-
"Status": task.status,
|
608
|
-
"Result": task.function_result,
|
609
|
-
"Date": time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime(task.date)),
|
610
|
-
})
|
611
|
-
return utils.print_table(data)
|
612
|
-
|
613
591
|
|
614
592
|
def cluster_grace_startup(cl_id):
|
615
593
|
db_controller = DBController()
|
@@ -3,7 +3,7 @@ import logging
|
|
3
3
|
import time
|
4
4
|
import uuid
|
5
5
|
|
6
|
-
from simplyblock_core import kv_store
|
6
|
+
from simplyblock_core import kv_store, constants, utils
|
7
7
|
from simplyblock_core.controllers import tasks_events
|
8
8
|
from simplyblock_core.models.job_schedule import JobSchedule
|
9
9
|
|
@@ -68,3 +68,36 @@ def add_device_to_auto_restart(device):
|
|
68
68
|
|
69
69
|
def add_node_to_auto_restart(node):
|
70
70
|
return _add_task(JobSchedule.FN_NODE_RESTART, node.cluster_id, node.get_id(), "")
|
71
|
+
|
72
|
+
|
73
|
+
def list_tasks(cluster_id):
|
74
|
+
cluster = db_controller.get_cluster_by_id(cluster_id)
|
75
|
+
if not cluster:
|
76
|
+
logger.error("Cluster not found: %s", cluster_id)
|
77
|
+
return False
|
78
|
+
|
79
|
+
data = []
|
80
|
+
tasks = db_controller.get_job_tasks(cluster_id)
|
81
|
+
for task in tasks:
|
82
|
+
data.append({
|
83
|
+
"Task ID": task.uuid,
|
84
|
+
"Target ID": task.device_id or task.node_id,
|
85
|
+
"Function": task.function_name,
|
86
|
+
"Retry": f"{task.retry}/{constants.TASK_EXEC_RETRY_COUNT}",
|
87
|
+
"Status": task.status,
|
88
|
+
"Result": task.function_result,
|
89
|
+
"Date": time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime(task.date)),
|
90
|
+
})
|
91
|
+
return utils.print_table(data)
|
92
|
+
|
93
|
+
|
94
|
+
def cancel_task(task_id):
|
95
|
+
task = db_controller.get_task_by_id(task_id)
|
96
|
+
if not task:
|
97
|
+
logger.error("Task not found: %s", task_id)
|
98
|
+
return False
|
99
|
+
|
100
|
+
task.canceled = True
|
101
|
+
task.write_to_db(db_controller.kv_store)
|
102
|
+
tasks_events.task_canceled(task)
|
103
|
+
return True
|
@@ -30,3 +30,8 @@ def task_updated(task, caused_by=ec.CAUSED_BY_CLI):
|
|
30
30
|
|
31
31
|
def task_status_change(task, new_state, old_status, caused_by=ec.CAUSED_BY_CLI):
|
32
32
|
_task_event(task, f"task status changed from: {old_status} to: {new_state}", caused_by, ec.EVENT_STATUS_CHANGE)
|
33
|
+
|
34
|
+
|
35
|
+
def task_canceled(task, caused_by=ec.CAUSED_BY_CLI):
|
36
|
+
_task_event(task, f"Task canceled: {task.uuid}", caused_by, ec.EVENT_STATUS_CHANGE)
|
37
|
+
|
@@ -274,3 +274,8 @@ class DBController:
|
|
274
274
|
|
275
275
|
def get_job_tasks(self, cluster_id, reverse=True):
|
276
276
|
return JobSchedule().read_from_db(self.kv_store, id=cluster_id, reverse=reverse)
|
277
|
+
|
278
|
+
def get_task_by_id(self, task_id):
|
279
|
+
for task in self.get_job_tasks(""):
|
280
|
+
if task.uuid == task_id:
|
281
|
+
return task
|
@@ -19,6 +19,8 @@ class JobSchedule(BaseModel):
|
|
19
19
|
"device_id": {"type": str, 'default': ""},
|
20
20
|
"date": {"type": int, 'default': 0},
|
21
21
|
|
22
|
+
"canceled": {"type": bool, 'default': False},
|
23
|
+
|
22
24
|
"function_name": {"type": str, 'default': ""},
|
23
25
|
"function_params": {"type": dict, 'default': {}},
|
24
26
|
"function_result": {"type": str, 'default': ""},
|
@@ -79,6 +79,12 @@ def task_runner_device(task):
|
|
79
79
|
device_controller.device_set_unavailable(device.get_id())
|
80
80
|
return True
|
81
81
|
|
82
|
+
if task.canceled:
|
83
|
+
task.function_result = "canceled"
|
84
|
+
task.status = JobSchedule.STATUS_DONE
|
85
|
+
task.write_to_db(db_controller.kv_store)
|
86
|
+
return True
|
87
|
+
|
82
88
|
node = db_controller.get_storage_node_by_id(task.node_id)
|
83
89
|
if node.status != StorageNode.STATUS_ONLINE:
|
84
90
|
logger.error(f"Node is not online: {node.get_id()}, retry")
|
@@ -152,6 +158,12 @@ def task_runner_node(task):
|
|
152
158
|
task.write_to_db(db_controller.kv_store)
|
153
159
|
return True
|
154
160
|
|
161
|
+
if task.canceled:
|
162
|
+
task.function_result = "canceled"
|
163
|
+
task.status = JobSchedule.STATUS_DONE
|
164
|
+
task.write_to_db(db_controller.kv_store)
|
165
|
+
return True
|
166
|
+
|
155
167
|
if task.status != JobSchedule.STATUS_RUNNING:
|
156
168
|
task.status = JobSchedule.STATUS_RUNNING
|
157
169
|
task.write_to_db(db_controller.kv_store)
|
@@ -720,8 +720,8 @@ def add_node(cluster_id, node_ip, iface_name, data_nics_list,
|
|
720
720
|
snode.iobuf_small_bufsize = small_bufsize or 0
|
721
721
|
snode.iobuf_large_bufsize = large_bufsize or 0
|
722
722
|
|
723
|
-
snode.num_partitions_per_dev = num_partitions_per_dev
|
724
|
-
snode.jm_percent = jm_percent
|
723
|
+
snode.num_partitions_per_dev = num_partitions_per_dev
|
724
|
+
snode.jm_percent = jm_percent
|
725
725
|
|
726
726
|
snode.write_to_db(kv_store)
|
727
727
|
|
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
|
{sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/scripts/alerting/alert_resources.yaml.j2
RENAMED
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
|
{sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/scripts/docker-compose-swarm-monitoring.yml
RENAMED
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
|
{sbcli_pre-1.1.7 → sbcli_pre-1.1.9}/simplyblock_core/services/capacity_and_stats_collector.py
RENAMED
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
|