cursus.steps.scripts.run_gconstruct¶
GraphConstruction step script (Nexus run_gconstruct.sh → Cursus).
Ports the Nexus run_gconstruct.sh wrapper into a contract-driven Python entry point. Runs
inside the BYO GraphStorm image (GraphStorm + DGL are baked into the image, not pip-provisioned).
- Responsibilities (verbatim port of the shell wrapper):
Path rewrite — GraphFeatureProcessing (Step 2) wrote
/opt/ml/processing/output/...paths intogconstruct_config.json; here those files mount at/opt/ml/processing/input/data/.... Rewrite the config in place and chdir into the data dir so any relative paths resolve.GraphStorm bug patch — inject
hard_edge_neg_ops = []afteredges = {}in the container’sconstruct_graph.py(an unbound-variable bug), idempotently. Prefer pinning a fixed GraphStorm version in the Dockerfile so this becomes unnecessary; the guard stays for image-version drift.Run
python3 -m graphstorm.gconstruct.construct_graphwith the fixed--conf-file/--output-dir(constant container paths) plus the config-sourced--graph-name/--num-processes/--num-parts/[--skip-nonexist-edges]— multi-process partitioning on a single instance. Emits a partitioned DGL heterograph.
Contract args (from graph_construction.step.yaml job_arguments): –graph-name, –num-processes,
–num-parts (+ –skip-nonexist-edges appended by the config’s gconstruct_arguments when set).
- rewrite_config_paths()[source]¶
Rewrite the Step-2 output paths in gconstruct_config.json to the Step-3 input mount.