From 16228202dede29eb1822a74ba082349a289f008b Mon Sep 17 00:00:00 2001 From: thevindu-w Date: Tue, 5 Nov 2024 23:04:19 +0530 Subject: [PATCH 1/7] Kill main process of worker on shutdown command --- src/server/JasmineGraphInstanceService.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/server/JasmineGraphInstanceService.cpp b/src/server/JasmineGraphInstanceService.cpp index 10e897860..1e638048c 100644 --- a/src/server/JasmineGraphInstanceService.cpp +++ b/src/server/JasmineGraphInstanceService.cpp @@ -13,6 +13,7 @@ limitations under the License. #include "JasmineGraphInstanceService.h" +#include #include #include @@ -1980,6 +1981,8 @@ static inline void close_command(int connFd, bool *loop_exit_p) { static inline void shutdown_command(int connFd) { close(connFd); + pid_t ppid = getppid(); + kill(ppid, SIGTERM); exit(0); } From 40d4fa9a65de44c5b116c6fe6afaf182d3e7a1d0 Mon Sep 17 00:00:00 2001 From: Miyuru Dayarathna Date: Wed, 6 Nov 2024 00:37:06 +0530 Subject: [PATCH 2/7] Add docker compose and related scripts --- conf/prometheus.yaml | 14 ++++++++++++++ docker-compose.yml | 45 ++++++++++++++++++++++++++++++++++++++++++++ start-docker.sh | 2 ++ stop-docker.sh | 18 ++++++++++++++++++ 4 files changed, 79 insertions(+) create mode 100644 conf/prometheus.yaml create mode 100644 docker-compose.yml create mode 100755 start-docker.sh create mode 100755 stop-docker.sh diff --git a/conf/prometheus.yaml b/conf/prometheus.yaml new file mode 100644 index 000000000..8631515d9 --- /dev/null +++ b/conf/prometheus.yaml @@ -0,0 +1,14 @@ +global: + scrape_interval: 15s + external_labels: + monitor: "codelab-monitor" +scrape_configs: + - job_name: "prometheus" + scrape_interval: 5s + static_configs: + - targets: ["localhost:9090"] + + - job_name: "pushgateway" + scrape_interval: 2s + static_configs: + - targets: ["172.28.5.3"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..913f01fce --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,45 @@ +services: + jasminegraph: + image: jasminegraph:latest + ports: + - '7777:7777' + - '7778:7778' + volumes: + - '/var/run/docker.sock:/var/run/docker.sock:rw' + - './env/databases/metadb:/home/ubuntu/software/jasminegraph/metadb' + - './env/databases/performancedb:/home/ubuntu/software/jasminegraph/performancedb' + - './env/data:/var/tmp/data' + - '/tmp/jasminegraph:/tmp/jasminegraph' + networks: + - jasminenet + command: --MODE 1 --MASTERIP 172.28.5.1 --WORKERS 2 --WORKERIP 172.28.5.1 --ENABLE_NMON false + depends_on: + - prometheus + prometheus: + image: prom/prometheus:latest + ports: + - 9090:9090 + volumes: + - './conf/prometheus.yaml:/etc/prometheus/prometheus.yml' + networks: + jasminenet: + ipv4_address: 172.28.5.2 + depends_on: + - pushgateway + pushgateway: + image: prom/pushgateway + ports: + - 9091:9091 + networks: + jasminenet: + ipv4_address: 172.28.5.3 +networks: + jasminenet: + external: false + name: jasminenet + driver: bridge + ipam: + config: + - subnet: 172.28.5.0/24 + ip_range: 172.28.5.0/24 + gateway: 172.28.5.1 diff --git a/start-docker.sh b/start-docker.sh new file mode 100755 index 000000000..83082e18e --- /dev/null +++ b/start-docker.sh @@ -0,0 +1,2 @@ +#!/bin/bash +docker compose up -d jasminegraph prometheus & diff --git a/stop-docker.sh b/stop-docker.sh new file mode 100755 index 000000000..8d29e8fa7 --- /dev/null +++ b/stop-docker.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# Variables +HOST="localhost" +PORT="7777" + +# Establish telnet connection and send command +( +sleep 5 +echo "shdn" +sleep 5 +echo "exit" +sleep 5 +) | telnet "$HOST" "$PORT" + + + +docker compose stop prometheus pushgateway & From 499a66a8e18efda61d66c348c5aa3a626dfa94ca Mon Sep 17 00:00:00 2001 From: Miyuru Dayarathna Date: Wed, 6 Nov 2024 00:44:59 +0530 Subject: [PATCH 3/7] Tag the test to latest if no errors found --- test-docker.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test-docker.sh b/test-docker.sh index 1abd2635e..34dad2512 100755 --- a/test-docker.sh +++ b/test-docker.sh @@ -169,4 +169,7 @@ fi stop_and_remove_containers force_remove "${TEST_ROOT}/env" "${WORKER_LOG_DIR}" +if [ "$exit_code" = '0' ]; then + docker tag jasminegraph:test jasminegraph:latest +fi exit "$exit_code" From a4d7b0d6431224124b63820e7a0410e794188680 Mon Sep 17 00:00:00 2001 From: Miyuru Dayarathna Date: Sun, 10 Nov 2024 23:23:46 +0530 Subject: [PATCH 4/7] Fix network issue --- conf/jasminegraph-server.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/jasminegraph-server.properties b/conf/jasminegraph-server.properties index c03de76e1..7ecc14a19 100644 --- a/conf/jasminegraph-server.properties +++ b/conf/jasminegraph-server.properties @@ -77,8 +77,8 @@ org.jasminegraph.scheduler.performancecollector.timing=30 #-------------------------------------------------------------------------------- #PerformanceCollector #-------------------------------------------------------------------------------- -org.jasminegraph.collector.pushgateway=http://192.168.43.135:9091/ -org.jasminegraph.collector.prometheus=http://192.168.43.135:9090/ +org.jasminegraph.collector.pushgateway=http://172.28.5.1:9091/ +org.jasminegraph.collector.prometheus=http://172.28.5.2:9090/ #-------------------------------------------------------------------------------- #MetaDB information From 67a4a2fa62add481fc17bd19ec87cffca616c85c Mon Sep 17 00:00:00 2001 From: Miyuru Dayarathna Date: Mon, 11 Nov 2024 23:11:33 +0530 Subject: [PATCH 5/7] Fix formatting issue --- stop-docker.sh | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/stop-docker.sh b/stop-docker.sh index 8d29e8fa7..56881c99b 100755 --- a/stop-docker.sh +++ b/stop-docker.sh @@ -6,13 +6,11 @@ PORT="7777" # Establish telnet connection and send command ( -sleep 5 -echo "shdn" -sleep 5 -echo "exit" -sleep 5 + sleep 5 + echo "shdn" + sleep 5 + echo "exit" + sleep 5 ) | telnet "$HOST" "$PORT" - - docker compose stop prometheus pushgateway & From ed53ddc7c08447aebd0fe93043caf214b8ba9233 Mon Sep 17 00:00:00 2001 From: Miyuru Dayarathna Date: Fri, 15 Nov 2024 01:02:58 +0530 Subject: [PATCH 6/7] Fix lint issue of too many args --- src_python/fl_client.py | 1 + src_python/fl_client_shed.py | 1 + src_python/fl_server.py | 1 + src_python/fl_server_shed.py | 1 + src_python/org_agg.py | 1 + src_python/org_server.py | 1 + 6 files changed, 6 insertions(+) diff --git a/src_python/fl_client.py b/src_python/fl_client.py index 89c037ae4..3347b4166 100644 --- a/src_python/fl_client.py +++ b/src_python/fl_client.py @@ -49,6 +49,7 @@ class Client: (Without partition sheduling) """ + #pylint: disable=too-many-arguments def __init__(self, model, graph_params, weights_path, graph_id, partition_id, epochs=10, ip=socket.gethostname(), port=5000, header_length=10): diff --git a/src_python/fl_client_shed.py b/src_python/fl_client_shed.py index a821bf77e..0ec549558 100644 --- a/src_python/fl_client_shed.py +++ b/src_python/fl_client_shed.py @@ -53,6 +53,7 @@ class Client: on a given GCN model (With partition sheduling) """ + #pylint: disable=too-many-arguments def __init__(self, client_id, weights_path, graph_id, partition_ids, epochs=10, ip=socket.gethostname(), port=5000, header_length=10): diff --git a/src_python/fl_server.py b/src_python/fl_server.py index 7a8a85d7e..e28d0ffda 100644 --- a/src_python/fl_server.py +++ b/src_python/fl_server.py @@ -36,6 +36,7 @@ class Server: learning process (Without partition sheduling) """ + #pylint: disable=too-many-arguments def __init__(self, model, rounds, weights_path, graph_id, max_conn=2, ip=socket.gethostname(), port=5000, header_length=10): diff --git a/src_python/fl_server_shed.py b/src_python/fl_server_shed.py index 33779de23..3407aff49 100644 --- a/src_python/fl_server_shed.py +++ b/src_python/fl_server_shed.py @@ -35,6 +35,7 @@ class Server: learning process (With partition sheduling) """ + #pylint: disable=too-many-arguments def __init__(self, model_weights, rounds, weights_path, graph_id, num_clients=2, ip=socket.gethostname(), port=5000, header_length=10): diff --git a/src_python/org_agg.py b/src_python/org_agg.py index aabf83625..0a338adb1 100644 --- a/src_python/org_agg.py +++ b/src_python/org_agg.py @@ -38,6 +38,7 @@ class Aggregator: """Aggregator """ + #pylint: disable=too-many-arguments def __init__(self, model, rounds, num_orgs, ip, port): # Parameters diff --git a/src_python/org_server.py b/src_python/org_server.py index ecc2ec886..4ed5e1ca2 100644 --- a/src_python/org_server.py +++ b/src_python/org_server.py @@ -39,6 +39,7 @@ class Server: """Server """ + #pylint: disable=too-many-arguments def __init__(self, org_id, model_weights, rounds, num_clients, ip, port): # Parameters From 9dc7b0cc6aa55af81af4e51a2403e8884cf44589 Mon Sep 17 00:00:00 2001 From: Miyuru Dayarathna Date: Fri, 15 Nov 2024 01:11:35 +0530 Subject: [PATCH 7/7] Fix lint issue of too many args --- src_python/fl_client.py | 2 +- src_python/fl_client_shed.py | 2 +- src_python/fl_server.py | 2 +- src_python/fl_server_shed.py | 2 +- src_python/org_agg.py | 2 +- src_python/org_server.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src_python/fl_client.py b/src_python/fl_client.py index 3347b4166..36edb8297 100644 --- a/src_python/fl_client.py +++ b/src_python/fl_client.py @@ -49,7 +49,7 @@ class Client: (Without partition sheduling) """ - #pylint: disable=too-many-arguments + #pylint: disable=too-many-positional-arguments def __init__(self, model, graph_params, weights_path, graph_id, partition_id, epochs=10, ip=socket.gethostname(), port=5000, header_length=10): diff --git a/src_python/fl_client_shed.py b/src_python/fl_client_shed.py index 0ec549558..ed42283e7 100644 --- a/src_python/fl_client_shed.py +++ b/src_python/fl_client_shed.py @@ -53,7 +53,7 @@ class Client: on a given GCN model (With partition sheduling) """ - #pylint: disable=too-many-arguments + #pylint: disable=too-many-positional-arguments def __init__(self, client_id, weights_path, graph_id, partition_ids, epochs=10, ip=socket.gethostname(), port=5000, header_length=10): diff --git a/src_python/fl_server.py b/src_python/fl_server.py index e28d0ffda..076baecce 100644 --- a/src_python/fl_server.py +++ b/src_python/fl_server.py @@ -36,7 +36,7 @@ class Server: learning process (Without partition sheduling) """ - #pylint: disable=too-many-arguments + #pylint: disable=too-many-positional-arguments def __init__(self, model, rounds, weights_path, graph_id, max_conn=2, ip=socket.gethostname(), port=5000, header_length=10): diff --git a/src_python/fl_server_shed.py b/src_python/fl_server_shed.py index 3407aff49..ac15e57b6 100644 --- a/src_python/fl_server_shed.py +++ b/src_python/fl_server_shed.py @@ -35,7 +35,7 @@ class Server: learning process (With partition sheduling) """ - #pylint: disable=too-many-arguments + #pylint: disable=too-many-positional-arguments def __init__(self, model_weights, rounds, weights_path, graph_id, num_clients=2, ip=socket.gethostname(), port=5000, header_length=10): diff --git a/src_python/org_agg.py b/src_python/org_agg.py index 0a338adb1..13c6a9df5 100644 --- a/src_python/org_agg.py +++ b/src_python/org_agg.py @@ -38,7 +38,7 @@ class Aggregator: """Aggregator """ - #pylint: disable=too-many-arguments + #pylint: disable=too-many-positional-arguments def __init__(self, model, rounds, num_orgs, ip, port): # Parameters diff --git a/src_python/org_server.py b/src_python/org_server.py index 4ed5e1ca2..5d5683db8 100644 --- a/src_python/org_server.py +++ b/src_python/org_server.py @@ -39,7 +39,7 @@ class Server: """Server """ - #pylint: disable=too-many-arguments + #pylint: disable=too-many-positional-arguments def __init__(self, org_id, model_weights, rounds, num_clients, ip, port): # Parameters