imbajin commented on code in PR #492:
URL: https://github.com/apache/hugegraph-doc/pull/492#discussion_r4031348989
##########
content/en/docs/quickstart/hugegraph-ai/vermeer-python-client.md:
##########
@@ -105,19 +112,38 @@ create_response = client.tasks.create_task(
)
)
print(create_response.errcode, create_response.message)
+if create_response.errcode != 0:
+ raise RuntimeError(f"Could not create load task:
{create_response.message}")
-# Read the task back and check its state
+# Poll this load task until it succeeds, fails, or times out
task_id = create_response.task.id
-task = client.tasks.get_task(task_id)
-print(task.task.state)
+poll_timeout = 300.0
+deadline = time.monotonic() + poll_timeout
+while time.monotonic() < deadline:
+ task = client.tasks.get_task(task_id)
+ if task.errcode != 0:
+ raise RuntimeError(f"Could not read task {task_id}: {task.message}")
+ state = task.task.state
+ print(task_id, state)
+ if state == "loaded":
+ break
+ if state in ("error", "canceled"):
+ raise RuntimeError(f"Load task {task_id} ended with state {state}")
+ remaining = deadline - time.monotonic()
+ if remaining > 0:
+ time.sleep(min(1.0, remaining))
+else:
+ raise TimeoutError(f"Load task {task_id} did not finish within
{poll_timeout}s")
# Once the graph is loaded, inspect it
print(client.graph.get_graph("DEFAULT-example").to_dict())
```
+A load task succeeds with state `loaded`; `error` or `canceled` stops the
example without reading the graph. Adjust `poll_timeout` (300 seconds here) for
your data size. The polling deadline is independent of HTTP connect and read
timeouts, and an in-flight request and SDK retries can extend the actual wait
beyond it. A timeout stops the client from waiting; it does not cancel the
server-side task.
+
Never hardcode a real HugeGraph password into a script or a configuration
file. Read it from an environment variable or a credential store, as above.
-After installing the module you can also run the shipped demo as is:
+The bundled `task_demo.py` uses `8688`. Before running it, change the
`PyVermeerClient` `port` to `6688` to match the default master HTTP port:
Review Comment:
⚠️ The standalone installation instructions leave the user in
`hugegraph-ai/vermeer-python-client` (`cd` at lines 37-40), but this command
uses `vermeer-python-client/src/...`, which resolves to a nonexistent nested
path and fails to start the demo. Use `python src/pyvermeer/demo/task_demo.py`
for that install path, or explicitly tell the reader to return to the
repository root; mirror the correction in the Chinese page.
##########
content/en/docs/quickstart/computing/hugegraph-vermeer.md:
##########
@@ -14,6 +14,8 @@ The master is responsible for communication, forwarding, and
aggregation, with m
The framework's runtime configuration can be passed via command-line
parameters or specified in configuration files located in the `config/`
directory. The `--env` parameter can specify which configuration file to use,
e.g., `--env=master` specifies using `master.ini`. Note that the master needs
to specify the listening port, and the worker needs to specify the listening
port and the master's `ip:port`.
+The default master HTTP port is `6688` for REST API and Python clients.
Workers connect to the master through gRPC port `6689`. The Docker examples
below publish HTTP with `6688:6688`; keep `http_peer=0.0.0.0:6688` in the
master configuration.
Review Comment:
⚠️ The new Docker recipes publish the master's HTTP port but never configure
the worker's master gRPC peer. The shipped `config/worker.ini` defaults to
`master_peer=127.0.0.1:6689`; inside `vermeer-worker`, loopback points back to
the worker, so it cannot register with `vermeer-master` even though the new
HTTP health check succeeds. Set `master_peer=vermeer-master:6689` (or
`172.20.0.10:6689`) in the worker config for both Docker examples, and mirror
the fix in the Chinese page.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]