Discover Packages
github.com/badochov/distributed-shortest-path
module
Version:
v0.0.0-...-3e6ee68
Opens a new window with list of versions in this module.
Published: Jan 31, 2023
License: MIT
Opens a new window with license information.
README
README
¶
distributed-shortest-path
Project calculating shortest path in a distributed graph.
Local development
Dependencies:
Go
kind
other local version of kubernetes such as minikube
may be used, but then you're on your own with setting up the cluster and uploading docker images to it.
kubectl
docker
Initialization
Setup cluster: kind create cluster --config cluster/local-kind-cluster.yaml
Generate docker images for manager and worker.
./src/services/worker/new_version.sh 0.0.1
./src/services/manager/new_version.sh 0.0.1
./cluster/deploy.sh --local
Querying manager
Inspired by this guide .
1.
Uploading OSM map
./import_graph.sh
Updates
Manager
./update_manager.sh <VERSION>
Workers
./update_workers.sh <VERSION>
DB Schema
Update models in src/libs/db/model
.
If new models are added adjust the list in src/libs/db/models/list.go
.
(cd src && go generate)
If new models are added adjust the list in func (c*Cleaner) getAllTables()
in src/libs/db/cleaner/cleaner.go
.
Cleaning postgres
./clean_postgres.sh
GRPC proto
Update grpc proto in src/services/worker/link/proto/link.proto
.
(cd src && go generate)
Manual connecting to Postgres:
kubectl run postgresql-dev-client --rm --tty -i --restart='Never' --namespace postgres --image docker.io/bitnami/postgresql:14.1.0-debian-10-r80 --env="PGPASSWORD=psltest" \
--command -- psql --host postgres -U admin -d postgresdb -p 5432
Sending requests to Manager running on kind:
Setup
./setup_curl_container.sh
Performing requests:
RecalculateDS
./curl.sh /recalculate_ds
ShortestPath
./curl.sh /shortest_path -H "Content-Type: application/json" -d '{"from":21911863, "to":21911883}'
Expand ▾
Collapse ▴
Directories
¶
cluster
Click to show internal directories.
Click to hide internal directories.