-
Run
./download_input.sh
once to download input data -
Flip the
if false
part ofserialise_files
andcreate_graph_walk_len
insrc/main.rs
totrue
so the files are serialised -
Run with
cargo run --release
to serialise all files. End the process once the API is listening -
Flip the
if false
part ofserialise_files
andcreate_graph_walk_len
insrc/main.rs
tofalse
to run without serialising any files -
Build with
cargo build --release
-
Run with
./target/release/rust_connectivity
The current version hosts an API, which accepts start node IDs and initial travel times. It requires about 3gb of RAM if you have no target destinations and loads in 10s on our GCE instance.
Check it's listening:
curl http://0.0.0.0:7328/
Run PT algorithm on 3 start nodes:
wget -O- --post-data='{"start_nodes_user_input": [9380647, 9183046, 2420336], "init_travel_times_user_input": [16, 10, 10], "trip_start_seconds": 28800, "graph_walk_additions": [], "graph_pt_additions": [], "new_nodes_count": 0, "graph_walk_updates_keys": [], "graph_walk_updates_additions": [], "year": 2022, "new_build_additions": [], "target_destinations": []}' \
--header='Content-Type:application/json' \
'http://0.0.0.0:7328/floodfill_pt/'
Run PT algorithm on 1000 start nodes using 2022 network:
wget --post-file="example_payload_1000_start_nodes.json" \
--header='Content-Type:application/json' \
'http://0.0.0.0:7328/floodfill_pt/'
Run PT algorithm on 1000 start nodes using 2019 network:
wget --post-file="example_payload_1000_start_nodes_2019.json" \
--header='Content-Type:application/json' \
'http://0.0.0.0:7328/floodfill_pt/'
Run PT algorithm on ~3000 start nodes using 2022 network, with a new route and building:
wget --post-file="example_payload_2022_new_route_and_build.json" \
--header='Content-Type:application/json' \
'http://0.0.0.0:7328/floodfill_pt/'
To make and run docker image. For networks from 2016 to 2022 the image is 15gb.
docker build --progress=plain -t rust_connectivity:latest .
docker run -p 0.0.0.0:7328:7328 rust_connectivity:latest
To push build image to dockerhub
docker tag connectivity_rust:latest adambricknell/connectivity_rust
docker push adambricknell/connectivity_rust
To deploy with Cloud Run do the below, then use Cloud Run UI in GCP to deploy
docker build --progress=plain -t rust_connectivity:latest . && \
docker tag rust_connectivity:latest gcr.io/dft-dst-prt-connectivitymetric/adambricknell/connectivity_rust:latest && \
docker push gcr.io/dft-dst-prt-connectivitymetric/adambricknell/connectivity_rust:latest