trustgraph-cli 2.3.8__tar.gz → 2.3.9__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.
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/PKG-INFO +1 -1
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/verify_system_status.py +104 -70
- trustgraph_cli-2.3.9/trustgraph/cli_version.py +1 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph_cli.egg-info/PKG-INFO +1 -1
- trustgraph_cli-2.3.8/trustgraph/cli_version.py +0 -1
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/README.md +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/pyproject.toml +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/setup.cfg +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/__init__.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/add_library_document.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/delete_collection.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/delete_config_item.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/delete_flow_blueprint.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/delete_kg_core.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/delete_mcp_tool.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/delete_tool.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/dump_msgpack.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/dump_queues.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/get_config_item.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/get_document_content.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/get_flow_blueprint.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/get_kg_core.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/graph_to_turtle.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/init_pulsar_manager.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/init_trustgraph.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/invoke_agent.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/invoke_document_embeddings.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/invoke_document_rag.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/invoke_embeddings.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/invoke_graph_embeddings.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/invoke_graph_rag.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/invoke_llm.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/invoke_mcp_tool.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/invoke_nlp_query.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/invoke_prompt.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/invoke_row_embeddings.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/invoke_rows_query.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/invoke_sparql_query.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/invoke_structured_query.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/list_collections.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/list_config_items.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/list_explain_traces.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/load_doc_embeds.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/load_kg_core.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/load_knowledge.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/load_sample_documents.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/load_structured_data.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/load_turtle.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/monitor_prompts.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/put_config_item.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/put_flow_blueprint.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/put_kg_core.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/query_graph.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/remove_library_document.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/save_doc_embeds.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/set_collection.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/set_mcp_tool.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/set_prompt.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/set_token_costs.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/set_tool.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/show_config.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/show_explain_trace.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/show_extraction_provenance.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/show_flow_blueprints.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/show_flow_state.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/show_flows.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/show_graph.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/show_kg_cores.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/show_library_documents.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/show_library_processing.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/show_mcp_tools.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/show_parameter_types.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/show_processor_state.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/show_prompts.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/show_token_costs.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/show_token_rate.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/show_tools.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/start_flow.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/start_library_processing.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/stop_flow.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/stop_library_processing.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph/cli/unload_kg_core.py +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph_cli.egg-info/SOURCES.txt +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph_cli.egg-info/dependency_links.txt +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph_cli.egg-info/entry_points.txt +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph_cli.egg-info/requires.txt +0 -0
- {trustgraph_cli-2.3.8 → trustgraph_cli-2.3.9}/trustgraph_cli.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: trustgraph-cli
|
|
3
|
-
Version: 2.3.
|
|
3
|
+
Version: 2.3.9
|
|
4
4
|
Summary: TrustGraph provides a means to run a pipeline of flexible AI processing components in a flexible means to achieve a processing pipeline.
|
|
5
5
|
Author-email: "trustgraph.ai" <security@trustgraph.ai>
|
|
6
6
|
Project-URL: Homepage, https://github.com/trustgraph-ai/trustgraph
|
|
@@ -19,6 +19,7 @@ from typing import Tuple, Optional
|
|
|
19
19
|
|
|
20
20
|
# Import existing CLI functions to reuse logic
|
|
21
21
|
from trustgraph.api import Api
|
|
22
|
+
from trustgraph.i18n import get_translator
|
|
22
23
|
|
|
23
24
|
default_pulsar_url = "http://localhost:8080"
|
|
24
25
|
default_api_url = os.getenv("TRUSTGRAPH_URL", "http://localhost:8088/")
|
|
@@ -34,12 +35,14 @@ class HealthChecker:
|
|
|
34
35
|
global_timeout: int = 120,
|
|
35
36
|
check_timeout: int = 10,
|
|
36
37
|
retry_delay: int = 3,
|
|
37
|
-
verbose: bool = False
|
|
38
|
+
verbose: bool = False,
|
|
39
|
+
translator=None,
|
|
38
40
|
):
|
|
39
41
|
self.global_timeout = global_timeout
|
|
40
42
|
self.check_timeout = check_timeout
|
|
41
43
|
self.retry_delay = retry_delay
|
|
42
44
|
self.verbose = verbose
|
|
45
|
+
self.tr = translator
|
|
43
46
|
self.start_time = time.time()
|
|
44
47
|
self.checks_passed = 0
|
|
45
48
|
self.checks_failed = 0
|
|
@@ -98,9 +101,15 @@ class HealthChecker:
|
|
|
98
101
|
attempt += 1
|
|
99
102
|
|
|
100
103
|
if attempt > 1:
|
|
101
|
-
self.
|
|
104
|
+
if self.tr:
|
|
105
|
+
self.log(self.tr.t("cli.verify_system_status.checking_attempt", name=name, attempt=attempt), "progress")
|
|
106
|
+
else:
|
|
107
|
+
self.log(f"Checking {name}... (attempt {attempt})", "progress")
|
|
102
108
|
else:
|
|
103
|
-
self.
|
|
109
|
+
if self.tr:
|
|
110
|
+
self.log(self.tr.t("cli.verify_system_status.checking", name=name), "progress")
|
|
111
|
+
else:
|
|
112
|
+
self.log(f"Checking {name}...", "progress")
|
|
104
113
|
|
|
105
114
|
try:
|
|
106
115
|
# Run the check with timeout
|
|
@@ -124,29 +133,32 @@ class HealthChecker:
|
|
|
124
133
|
time.sleep(self.retry_delay)
|
|
125
134
|
|
|
126
135
|
# Check failed
|
|
127
|
-
self.
|
|
136
|
+
if self.tr:
|
|
137
|
+
self.log(self.tr.t("cli.verify_system_status.failed_timeout", name=name, attempt=attempt), "error")
|
|
138
|
+
else:
|
|
139
|
+
self.log(f"{name}: Failed (timeout after {attempt} attempts)", "error")
|
|
128
140
|
self.checks_failed += 1
|
|
129
141
|
return False
|
|
130
142
|
|
|
131
143
|
|
|
132
|
-
def check_pulsar(url: str, timeout: int) -> Tuple[bool, str]:
|
|
144
|
+
def check_pulsar(url: str, timeout: int, tr) -> Tuple[bool, str]:
|
|
133
145
|
"""Check if Pulsar admin API is responding."""
|
|
134
146
|
try:
|
|
135
147
|
resp = requests.get(f"{url}/admin/v2/clusters", timeout=timeout)
|
|
136
148
|
if resp.status_code == 200:
|
|
137
149
|
clusters = resp.json()
|
|
138
|
-
return True,
|
|
150
|
+
return True, tr.t("cli.verify_system_status.pulsar.healthy", clusters=len(clusters))
|
|
139
151
|
else:
|
|
140
|
-
return False,
|
|
152
|
+
return False, tr.t("cli.verify_system_status.pulsar.status", status_code=resp.status_code)
|
|
141
153
|
except requests.exceptions.Timeout:
|
|
142
|
-
return False, "
|
|
154
|
+
return False, tr.t("cli.verify_system_status.pulsar.timeout")
|
|
143
155
|
except requests.exceptions.ConnectionError:
|
|
144
|
-
return False, "
|
|
156
|
+
return False, tr.t("cli.verify_system_status.pulsar.cannot_connect")
|
|
145
157
|
except Exception as e:
|
|
146
|
-
return False,
|
|
158
|
+
return False, tr.t("cli.verify_system_status.pulsar.error", error=str(e))
|
|
147
159
|
|
|
148
160
|
|
|
149
|
-
def check_api_gateway(url: str, timeout: int, token: Optional[str] = None) -> Tuple[bool, str]:
|
|
161
|
+
def check_api_gateway(url: str, timeout: int, tr, token: Optional[str] = None) -> Tuple[bool, str]:
|
|
150
162
|
"""Check if API Gateway is responding."""
|
|
151
163
|
try:
|
|
152
164
|
# Try to hit the base URL
|
|
@@ -159,18 +171,18 @@ def check_api_gateway(url: str, timeout: int, token: Optional[str] = None) -> Tu
|
|
|
159
171
|
|
|
160
172
|
resp = requests.get(url, headers=headers, timeout=timeout)
|
|
161
173
|
if resp.status_code in [200, 404]: # 404 is OK, means gateway is up
|
|
162
|
-
return True, "
|
|
174
|
+
return True, tr.t("cli.verify_system_status.api_gateway.responding")
|
|
163
175
|
else:
|
|
164
|
-
return False,
|
|
176
|
+
return False, tr.t("cli.verify_system_status.api_gateway.status", status_code=resp.status_code)
|
|
165
177
|
except requests.exceptions.Timeout:
|
|
166
|
-
return False, "
|
|
178
|
+
return False, tr.t("cli.verify_system_status.api_gateway.timeout")
|
|
167
179
|
except requests.exceptions.ConnectionError:
|
|
168
|
-
return False, "
|
|
180
|
+
return False, tr.t("cli.verify_system_status.api_gateway.cannot_connect")
|
|
169
181
|
except Exception as e:
|
|
170
|
-
return False,
|
|
182
|
+
return False, tr.t("cli.verify_system_status.api_gateway.error", error=str(e))
|
|
171
183
|
|
|
172
184
|
|
|
173
|
-
def check_processors(url: str, min_processors: int, timeout: int, token: Optional[str] = None) -> Tuple[bool, str]:
|
|
185
|
+
def check_processors(url: str, min_processors: int, timeout: int, tr, token: Optional[str] = None) -> Tuple[bool, str]:
|
|
174
186
|
"""Check if processors are running via metrics endpoint."""
|
|
175
187
|
try:
|
|
176
188
|
# Construct metrics URL from API URL
|
|
@@ -188,17 +200,17 @@ def check_processors(url: str, min_processors: int, timeout: int, token: Optiona
|
|
|
188
200
|
processor_count = len(data.get("data", {}).get("result", []))
|
|
189
201
|
|
|
190
202
|
if processor_count >= min_processors:
|
|
191
|
-
return True,
|
|
203
|
+
return True, tr.t("cli.verify_system_status.processors.found", count=processor_count, min=min_processors)
|
|
192
204
|
else:
|
|
193
|
-
return False,
|
|
205
|
+
return False, tr.t("cli.verify_system_status.processors.only", count=processor_count, min=min_processors)
|
|
194
206
|
else:
|
|
195
|
-
return False,
|
|
207
|
+
return False, tr.t("cli.verify_system_status.processors.metrics_status", status_code=resp.status_code)
|
|
196
208
|
|
|
197
209
|
except Exception as e:
|
|
198
|
-
return False,
|
|
210
|
+
return False, tr.t("cli.verify_system_status.processors.error", error=str(e))
|
|
199
211
|
|
|
200
212
|
|
|
201
|
-
def check_flow_blueprints(url: str, timeout: int, token: Optional[str] = None) -> Tuple[bool, str]:
|
|
213
|
+
def check_flow_blueprints(url: str, timeout: int, tr, token: Optional[str] = None) -> Tuple[bool, str]:
|
|
202
214
|
"""Check if flow blueprints are loaded."""
|
|
203
215
|
try:
|
|
204
216
|
api = Api(url, token=token, timeout=timeout)
|
|
@@ -207,15 +219,15 @@ def check_flow_blueprints(url: str, timeout: int, token: Optional[str] = None) -
|
|
|
207
219
|
blueprints = flow_api.list_blueprints()
|
|
208
220
|
|
|
209
221
|
if blueprints and len(blueprints) > 0:
|
|
210
|
-
return True,
|
|
222
|
+
return True, tr.t("cli.verify_system_status.flow_blueprints.found", count=len(blueprints))
|
|
211
223
|
else:
|
|
212
|
-
return False, "
|
|
224
|
+
return False, tr.t("cli.verify_system_status.flow_blueprints.none")
|
|
213
225
|
|
|
214
226
|
except Exception as e:
|
|
215
|
-
return False,
|
|
227
|
+
return False, tr.t("cli.verify_system_status.flow_blueprints.error", error=str(e))
|
|
216
228
|
|
|
217
229
|
|
|
218
|
-
def check_flows(url: str, timeout: int, token: Optional[str] = None) -> Tuple[bool, str]:
|
|
230
|
+
def check_flows(url: str, timeout: int, tr, token: Optional[str] = None) -> Tuple[bool, str]:
|
|
219
231
|
"""Check if flow manager is responding."""
|
|
220
232
|
try:
|
|
221
233
|
api = Api(url, token=token, timeout=timeout)
|
|
@@ -224,13 +236,13 @@ def check_flows(url: str, timeout: int, token: Optional[str] = None) -> Tuple[bo
|
|
|
224
236
|
flows = flow_api.list()
|
|
225
237
|
|
|
226
238
|
# Success if we get a response (even if empty)
|
|
227
|
-
return True,
|
|
239
|
+
return True, tr.t("cli.verify_system_status.flows.responding", count=len(flows))
|
|
228
240
|
|
|
229
241
|
except Exception as e:
|
|
230
|
-
return False,
|
|
242
|
+
return False, tr.t("cli.verify_system_status.flows.error", error=str(e))
|
|
231
243
|
|
|
232
244
|
|
|
233
|
-
def check_prompts(url: str, timeout: int, token: Optional[str] = None) -> Tuple[bool, str]:
|
|
245
|
+
def check_prompts(url: str, timeout: int, tr, token: Optional[str] = None) -> Tuple[bool, str]:
|
|
234
246
|
"""Check if prompts are loaded."""
|
|
235
247
|
try:
|
|
236
248
|
api = Api(url, token=token, timeout=timeout)
|
|
@@ -248,15 +260,15 @@ def check_prompts(url: str, timeout: int, token: Optional[str] = None) -> Tuple[
|
|
|
248
260
|
ix = json.loads(values[0].value)
|
|
249
261
|
|
|
250
262
|
if ix and len(ix) > 0:
|
|
251
|
-
return True,
|
|
263
|
+
return True, tr.t("cli.verify_system_status.prompts.found", count=len(ix))
|
|
252
264
|
else:
|
|
253
|
-
return False, "
|
|
265
|
+
return False, tr.t("cli.verify_system_status.prompts.none")
|
|
254
266
|
|
|
255
267
|
except Exception as e:
|
|
256
|
-
return False,
|
|
268
|
+
return False, tr.t("cli.verify_system_status.prompts.error", error=str(e))
|
|
257
269
|
|
|
258
270
|
|
|
259
|
-
def check_library(url: str, timeout: int, token: Optional[str] = None) -> Tuple[bool, str]:
|
|
271
|
+
def check_library(url: str, timeout: int, tr, token: Optional[str] = None) -> Tuple[bool, str]:
|
|
260
272
|
"""Check if library service is responding."""
|
|
261
273
|
try:
|
|
262
274
|
api = Api(url, token=token, timeout=timeout)
|
|
@@ -266,13 +278,13 @@ def check_library(url: str, timeout: int, token: Optional[str] = None) -> Tuple[
|
|
|
266
278
|
docs = library_api.get_documents(user="trustgraph")
|
|
267
279
|
|
|
268
280
|
# Success if we get a valid response (even if empty)
|
|
269
|
-
return True,
|
|
281
|
+
return True, tr.t("cli.verify_system_status.library.responding", count=len(docs))
|
|
270
282
|
|
|
271
283
|
except Exception as e:
|
|
272
|
-
return False,
|
|
284
|
+
return False, tr.t("cli.verify_system_status.library.error", error=str(e))
|
|
273
285
|
|
|
274
286
|
|
|
275
|
-
def check_ui(url: str, timeout: int) -> Tuple[bool, str]:
|
|
287
|
+
def check_ui(url: str, timeout: int, tr) -> Tuple[bool, str]:
|
|
276
288
|
"""Check if Workbench UI is responding."""
|
|
277
289
|
try:
|
|
278
290
|
if not url.endswith('/'):
|
|
@@ -280,15 +292,15 @@ def check_ui(url: str, timeout: int) -> Tuple[bool, str]:
|
|
|
280
292
|
|
|
281
293
|
resp = requests.get(f"{url}index.html", timeout=timeout)
|
|
282
294
|
if resp.status_code == 200:
|
|
283
|
-
return True, "
|
|
295
|
+
return True, tr.t("cli.verify_system_status.ui.responding")
|
|
284
296
|
else:
|
|
285
|
-
return False,
|
|
297
|
+
return False, tr.t("cli.verify_system_status.ui.status", status_code=resp.status_code)
|
|
286
298
|
except requests.exceptions.Timeout:
|
|
287
|
-
return False, "
|
|
299
|
+
return False, tr.t("cli.verify_system_status.ui.timeout")
|
|
288
300
|
except requests.exceptions.ConnectionError:
|
|
289
|
-
return False, "
|
|
301
|
+
return False, tr.t("cli.verify_system_status.ui.cannot_connect")
|
|
290
302
|
except Exception as e:
|
|
291
|
-
return False,
|
|
303
|
+
return False, tr.t("cli.verify_system_status.ui.error", error=str(e))
|
|
292
304
|
|
|
293
305
|
|
|
294
306
|
def main():
|
|
@@ -300,6 +312,12 @@ def main():
|
|
|
300
312
|
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
301
313
|
)
|
|
302
314
|
|
|
315
|
+
parser.add_argument(
|
|
316
|
+
'--lang',
|
|
317
|
+
default=os.getenv("TRUSTGRAPH_LANG", "en"),
|
|
318
|
+
help='Language code for CLI output (default: $TRUSTGRAPH_LANG or en)'
|
|
319
|
+
)
|
|
320
|
+
|
|
303
321
|
parser.add_argument(
|
|
304
322
|
'--global-timeout',
|
|
305
323
|
type=int,
|
|
@@ -366,119 +384,135 @@ def main():
|
|
|
366
384
|
|
|
367
385
|
args = parser.parse_args()
|
|
368
386
|
|
|
387
|
+
tr = get_translator(args.lang)
|
|
388
|
+
|
|
369
389
|
# Create health checker
|
|
370
390
|
checker = HealthChecker(
|
|
371
391
|
global_timeout=args.global_timeout,
|
|
372
392
|
check_timeout=args.check_timeout,
|
|
373
393
|
retry_delay=args.retry_delay,
|
|
374
|
-
verbose=args.verbose
|
|
394
|
+
verbose=args.verbose,
|
|
395
|
+
translator=tr,
|
|
375
396
|
)
|
|
376
397
|
|
|
377
398
|
print("=" * 60)
|
|
378
|
-
print("
|
|
399
|
+
print(tr.t("cli.verify_system_status.title"))
|
|
379
400
|
print("=" * 60)
|
|
380
401
|
print()
|
|
381
402
|
|
|
382
403
|
# Phase 1: Infrastructure
|
|
383
|
-
print("
|
|
404
|
+
print(tr.t("cli.verify_system_status.phase_1"))
|
|
384
405
|
print("-" * 60)
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
406
|
+
if not checker.run_check(
|
|
407
|
+
tr.t("cli.verify_system_status.check_name.pulsar"),
|
|
408
|
+
check_pulsar,
|
|
409
|
+
args.pulsar_url,
|
|
410
|
+
args.check_timeout,
|
|
411
|
+
tr,
|
|
412
|
+
):
|
|
413
|
+
print(f"\n⚠️ {tr.t('cli.verify_system_status.pulsar_not_responding')}")
|
|
414
|
+
print()
|
|
388
415
|
|
|
389
416
|
checker.run_check(
|
|
390
|
-
"
|
|
417
|
+
tr.t("cli.verify_system_status.check_name.api_gateway"),
|
|
391
418
|
check_api_gateway,
|
|
392
419
|
args.api_url,
|
|
393
420
|
args.check_timeout,
|
|
394
|
-
|
|
421
|
+
tr,
|
|
422
|
+
args.token,
|
|
395
423
|
)
|
|
396
424
|
|
|
397
425
|
print()
|
|
398
426
|
|
|
399
427
|
# Phase 2: Core Services
|
|
400
|
-
print("
|
|
428
|
+
print(tr.t("cli.verify_system_status.phase_2"))
|
|
401
429
|
print("-" * 60)
|
|
402
430
|
|
|
403
431
|
checker.run_check(
|
|
404
|
-
"
|
|
432
|
+
tr.t("cli.verify_system_status.check_name.processors"),
|
|
405
433
|
check_processors,
|
|
406
434
|
args.api_url,
|
|
407
435
|
args.min_processors,
|
|
408
436
|
args.check_timeout,
|
|
409
|
-
|
|
437
|
+
tr,
|
|
438
|
+
args.token,
|
|
410
439
|
)
|
|
411
440
|
|
|
412
441
|
checker.run_check(
|
|
413
|
-
"
|
|
442
|
+
tr.t("cli.verify_system_status.check_name.flow_blueprints"),
|
|
414
443
|
check_flow_blueprints,
|
|
415
444
|
args.api_url,
|
|
416
445
|
args.check_timeout,
|
|
417
|
-
|
|
446
|
+
tr,
|
|
447
|
+
args.token,
|
|
418
448
|
)
|
|
419
449
|
|
|
420
450
|
checker.run_check(
|
|
421
|
-
"
|
|
451
|
+
tr.t("cli.verify_system_status.check_name.flows"),
|
|
422
452
|
check_flows,
|
|
423
453
|
args.api_url,
|
|
424
454
|
args.check_timeout,
|
|
425
|
-
|
|
455
|
+
tr,
|
|
456
|
+
args.token,
|
|
426
457
|
)
|
|
427
458
|
|
|
428
459
|
checker.run_check(
|
|
429
|
-
"
|
|
460
|
+
tr.t("cli.verify_system_status.check_name.prompts"),
|
|
430
461
|
check_prompts,
|
|
431
462
|
args.api_url,
|
|
432
463
|
args.check_timeout,
|
|
433
|
-
|
|
464
|
+
tr,
|
|
465
|
+
args.token,
|
|
434
466
|
)
|
|
435
467
|
|
|
436
468
|
print()
|
|
437
469
|
|
|
438
470
|
# Phase 3: Data Services
|
|
439
|
-
print("
|
|
471
|
+
print(tr.t("cli.verify_system_status.phase_3"))
|
|
440
472
|
print("-" * 60)
|
|
441
473
|
|
|
442
474
|
checker.run_check(
|
|
443
|
-
"
|
|
475
|
+
tr.t("cli.verify_system_status.check_name.library"),
|
|
444
476
|
check_library,
|
|
445
477
|
args.api_url,
|
|
446
478
|
args.check_timeout,
|
|
447
|
-
|
|
479
|
+
tr,
|
|
480
|
+
args.token,
|
|
448
481
|
)
|
|
449
482
|
|
|
450
483
|
print()
|
|
451
484
|
|
|
452
485
|
# Phase 4: UI (optional)
|
|
453
486
|
if not args.skip_ui:
|
|
454
|
-
print("
|
|
487
|
+
print(tr.t("cli.verify_system_status.phase_4"))
|
|
455
488
|
print("-" * 60)
|
|
456
489
|
|
|
457
490
|
checker.run_check(
|
|
458
|
-
"
|
|
491
|
+
tr.t("cli.verify_system_status.check_name.workbench_ui"),
|
|
459
492
|
check_ui,
|
|
460
493
|
args.ui_url,
|
|
461
|
-
args.check_timeout
|
|
494
|
+
args.check_timeout,
|
|
495
|
+
tr,
|
|
462
496
|
)
|
|
463
497
|
|
|
464
498
|
print()
|
|
465
499
|
|
|
466
500
|
# Summary
|
|
467
501
|
print("=" * 60)
|
|
468
|
-
print("
|
|
502
|
+
print(tr.t("cli.verify_system_status.summary"))
|
|
469
503
|
print("=" * 60)
|
|
470
504
|
|
|
471
505
|
total_checks = checker.checks_passed + checker.checks_failed
|
|
472
506
|
|
|
473
|
-
print(
|
|
474
|
-
print(
|
|
475
|
-
print(
|
|
507
|
+
print(tr.t("cli.verify_system_status.checks_passed", passed=checker.checks_passed, total=total_checks))
|
|
508
|
+
print(tr.t("cli.verify_system_status.checks_failed", failed=checker.checks_failed, total=total_checks))
|
|
509
|
+
print(tr.t("cli.verify_system_status.total_time", elapsed=checker.elapsed()))
|
|
476
510
|
|
|
477
511
|
if checker.checks_failed == 0:
|
|
478
|
-
print("\n✓
|
|
512
|
+
print(f"\n✓ {tr.t('cli.verify_system_status.system_healthy')}")
|
|
479
513
|
sys.exit(0)
|
|
480
514
|
else:
|
|
481
|
-
print(f"\n✗
|
|
515
|
+
print(f"\n✗ {tr.t('cli.verify_system_status.system_failing', failed=checker.checks_failed)}")
|
|
482
516
|
sys.exit(1)
|
|
483
517
|
|
|
484
518
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.3.9"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: trustgraph-cli
|
|
3
|
-
Version: 2.3.
|
|
3
|
+
Version: 2.3.9
|
|
4
4
|
Summary: TrustGraph provides a means to run a pipeline of flexible AI processing components in a flexible means to achieve a processing pipeline.
|
|
5
5
|
Author-email: "trustgraph.ai" <security@trustgraph.ai>
|
|
6
6
|
Project-URL: Homepage, https://github.com/trustgraph-ai/trustgraph
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "2.3.8"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|