Project calculating shortest path in a distributed graph.
- Go
- kind
- other local version of kubernetes such as
minikubemay be used, but then you're on your own with setting up the cluster and uploading docker images to it.
- other local version of kubernetes such as
- kubectl
- docker
- 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
Inspired by this guide. 1.
./import_graph.sh./update_manager.sh <VERSION>./update_workers.sh <VERSION>- 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()insrc/libs/db/cleaner/cleaner.go.
./clean_postgres.sh- Update grpc proto in
src/services/worker/link/proto/link.proto. -
(cd src && go generate)
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- 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}'
-