From 52f9df913e62a9a8a457aef43b18b7d491754dd2 Mon Sep 17 00:00:00 2001 From: siddhivelankar23 Date: Tue, 11 Mar 2025 01:34:15 -0500 Subject: [PATCH 1/6] added test and compose file for nebula Signed-off-by: siddhivelankar23 --- .../deployment/docker_compose/compose.yaml | 139 ++++++++++++++++++ .../test_third_parties_nebula_docker.sh | 99 +++++++++++++ 2 files changed, 238 insertions(+) create mode 100644 comps/third_parties/nebula/deployment/docker_compose/compose.yaml create mode 100644 tests/third_parties/test_third_parties_nebula_docker.sh diff --git a/comps/third_parties/nebula/deployment/docker_compose/compose.yaml b/comps/third_parties/nebula/deployment/docker_compose/compose.yaml new file mode 100644 index 0000000000..964d4d2931 --- /dev/null +++ b/comps/third_parties/nebula/deployment/docker_compose/compose.yaml @@ -0,0 +1,139 @@ +version: '3.4' +services: + metad0: + image: docker.io/vesoft/nebula-metad:v3.8.0 + environment: + USER: root + TZ: "${TZ}" + STORAGE_CLASS_NAME: test + + command: + - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559 + - --local_ip=metad0 + - --ws_ip=metad0 + - --port=9559 + - --ws_http_port=19559 + - --data_path=/data/meta + - --log_dir=/logs + - --v=0 + - --minloglevel=0 + healthcheck: + test: ["CMD", "curl", "-sf", "http://metad0:19559/status"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 20s + ports: + - 9559 + - 19559 + - 19560 + volumes: + - ./data/meta0:/data/meta + - ./logs/meta0:/logs + networks: + - nebula-net + restart: on-failure + cap_add: + - SYS_PTRACE + + + storaged0: + image: docker.io/vesoft/nebula-storaged:v3.8.0 + environment: + USER: root + TZ: "${TZ}" + command: + - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559 + - --local_ip=storaged0 + - --ws_ip=storaged0 + - --port=9779 + - --ws_http_port=19779 + - --data_path=/data/storage + - --log_dir=/logs + - --v=0 + - --minloglevel=0 + depends_on: + - metad0 + - metad1 + - metad2 + healthcheck: + test: ["CMD", "curl", "-sf", "http://storaged0:19779/status"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 20s + ports: + - 9779 + - 19779 + - 19780 + volumes: + - ./data/storage0:/data/storage + - ./logs/storage0:/logs + networks: + - nebula-net + restart: on-failure + cap_add: + - SYS_PTRACE + + + + graphd: + image: docker.io/vesoft/nebula-graphd:v3.8.0 + environment: + USER: root + TZ: "${TZ}" + command: + - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559 + - --port=9669 + - --local_ip=graphd + - --ws_ip=graphd + - --ws_http_port=19669 + - --log_dir=/logs + - --v=0 + - --minloglevel=0 + depends_on: + - storaged0 + - storaged1 + - storaged2 + healthcheck: + test: ["CMD", "curl", "-sf", "http://graphd:19669/status"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 20s + ports: + - "9669:9669" + - 19669 + - 19670 + volumes: + - ./logs/graph:/logs + networks: + - nebula-net + restart: on-failure + cap_add: + - SYS_PTRACE + + + console: + image: docker.io/vesoft/nebula-console:v3.6.0 + entrypoint: "" + command: + - sh + - -c + - | + for i in `seq 1 60`;do + var=`nebula-console -addr graphd -port 9669 -u root -p nebula -e 'ADD HOSTS "storaged0":9779,"storaged1":9779,"storaged2":9779'`; + if [[ $$? == 0 ]];then + break; + fi; + sleep 1; + echo "retry to add hosts."; + done && tail -f /dev/null; + + depends_on: + - graphd + networks: + - nebula-net + +networks: + nebula-net: diff --git a/tests/third_parties/test_third_parties_nebula_docker.sh b/tests/third_parties/test_third_parties_nebula_docker.sh new file mode 100644 index 0000000000..872352b88a --- /dev/null +++ b/tests/third_parties/test_third_parties_nebula_docker.sh @@ -0,0 +1,99 @@ +#!/bin/bash +set -euo pipefail + +WORKPATH=$(dirname "$PWD") +LOG_PATH="$WORKPATH/tests" + +function check_storage_class() { + echo "Checking storage class..." + STORAGE_CLASS_NAME=$(docker system info --format '{{.DriverStatus}}' | grep "Storage Driver" | cut -d':' -f2- | tr -d ' ') + + if [ -n "$STORAGE_CLASS_NAME" ]; then + echo "Using Storage Driver: $STORAGE_CLASS_NAME" + else + echo "No Storage Driver found." + exit 1 + fi +} + +function start_service() { + echo "Starting Nebula Graph service..." + docker-compose up -d + + # Wait for graphd to be ready + for i in {1..60}; do + status_code=$(curl -s -o /dev/null -w "%{http_code}" http://graphd:19669/status) + if [ "$status_code" = "200" ]; then + break + fi + sleep 1 + done + + if [ "$status_code" != "200" ]; then + echo "Failed to start Nebula Graph" + exit 1 + fi +} + +function validate_database() { + echo "[ test create ] creating space..." + + query="CREATE SPACE my_space(partition_num=10, replica_factor=1, vid_type=FIXED_STRING(32)); USE my_space; CREATE TAG person(name string, age int);" + create_response=$(docker exec -it console nebula-console -addr graphd -port 9669 -u $NEBULA_USER -p $NEBULA_PASSWORD -e "$query" 2>&1) + + if [[ $? -eq 0 ]]; then + echo "[ test create ] create space succeed" + echo $create_response >> ${LOG_PATH}/nebulagraph_create_space.log + else + echo "[ test create ] create space failed" + echo $create_response >> ${LOG_PATH}/nebulagraph_create_space.log + exit 1 + fi + + sleep 30s + + # Test insert data + echo "[ test insert ] inserting data..." + query="USE my_space; INSERT VERTEX person(name, age) VALUES 'person1':('Alice', 30); INSERT VERTEX person(name, age) VALUES 'person2':('Bob', 25);" + insert_response=$(docker exec -it console nebula-console -addr graphd -port 9669 -u $NEBULA_USER -p $NEBULA_PASSWORD -e "$query" 2>&1) + + if [[ $? -eq 0 ]]; then + echo "[ test insert ] insert data succeed" + echo $insert_response >> ${LOG_PATH}/nebulagraph_insert_data.log + else + echo "[ test insert ] insert data failed" + echo $insert_response >> ${LOG_PATH}/nebulagraph_insert_data.log + exit 1 + fi + + sleep 30s + + # Test search data + echo "[ test search ] searching data..." + query="USE my_space; MATCH (p:person) RETURN p;" + search_response=$(docker exec -it console nebula-console -addr graphd -port 9669 -u $NEBULA_USER -p $NEBULA_PASSWORD -e "$query" 2>&1) + + if [[ $? -eq 0 ]]; then + echo "[ test search ] search data succeed" + echo $search_response >> ${LOG_PATH}/nebulagraph_search_data.log + else + echo "[ test search ] search data failed" + echo $search_response >> ${LOG_PATH}/nebulagraph_search_data.log + exit 1 + fi +} + +function stop_service() { + echo "Stopping Nebula Graph service..." + docker-compose down +} + +function main() { + check_storage_class + mkdir -p "$LOG_PATH" + start_service + validate_database + stop_service +} + +main "$@" From 571856054f423ef901cf8ec9f730c13c109ae589 Mon Sep 17 00:00:00 2001 From: siddhivelankar23 Date: Tue, 11 Mar 2025 01:36:48 -0500 Subject: [PATCH 2/6] added header Signed-off-by: siddhivelankar23 --- .../nebula/deployment/docker_compose/compose.yaml | 3 +++ tests/third_parties/test_third_parties_nebula_docker.sh | 3 +++ 2 files changed, 6 insertions(+) diff --git a/comps/third_parties/nebula/deployment/docker_compose/compose.yaml b/comps/third_parties/nebula/deployment/docker_compose/compose.yaml index 964d4d2931..4b1640d478 100644 --- a/comps/third_parties/nebula/deployment/docker_compose/compose.yaml +++ b/comps/third_parties/nebula/deployment/docker_compose/compose.yaml @@ -1,3 +1,6 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + version: '3.4' services: metad0: diff --git a/tests/third_parties/test_third_parties_nebula_docker.sh b/tests/third_parties/test_third_parties_nebula_docker.sh index 872352b88a..b177582f26 100644 --- a/tests/third_parties/test_third_parties_nebula_docker.sh +++ b/tests/third_parties/test_third_parties_nebula_docker.sh @@ -1,4 +1,7 @@ #!/bin/bash +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + set -euo pipefail WORKPATH=$(dirname "$PWD") From ea4a9a07af027577765a2b39a1991ca1fab72e48 Mon Sep 17 00:00:00 2001 From: siddhivelankar23 Date: Mon, 17 Mar 2025 06:18:43 +0000 Subject: [PATCH 3/6] updated test Signed-off-by: siddhivelankar23 --- .../docker_compose/docker-compose.yaml | 349 ++++++++++++++++++ .../test_third_parties_nebula_docker.sh | 114 +++--- 2 files changed, 410 insertions(+), 53 deletions(-) create mode 100644 comps/third_parties/nebula/deployment/docker_compose/docker-compose.yaml diff --git a/comps/third_parties/nebula/deployment/docker_compose/docker-compose.yaml b/comps/third_parties/nebula/deployment/docker_compose/docker-compose.yaml new file mode 100644 index 0000000000..7d68865dc2 --- /dev/null +++ b/comps/third_parties/nebula/deployment/docker_compose/docker-compose.yaml @@ -0,0 +1,349 @@ +version: '3.4' +services: + metad0: + image: docker.io/vesoft/nebula-metad:nightly + environment: + USER: root + TZ: "${TZ}" + command: + - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559 + - --local_ip=metad0 + - --ws_ip=metad0 + - --port=9559 + - --ws_http_port=19559 + - --data_path=/data/meta + - --log_dir=/logs + - --v=0 + - --minloglevel=0 + healthcheck: + test: ["CMD", "curl", "-sf", "http://metad0:19559/status"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 20s + ports: + - 9559 + - 19559 + - 19560 + volumes: + - ./data/meta0:/data/meta + - ./logs/meta0:/logs + networks: + - nebula-net + restart: on-failure + cap_add: + - SYS_PTRACE + + metad1: + image: docker.io/vesoft/nebula-metad:nightly + environment: + USER: root + TZ: "${TZ}" + command: + - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559 + - --local_ip=metad1 + - --ws_ip=metad1 + - --port=9559 + - --ws_http_port=19559 + - --data_path=/data/meta + - --log_dir=/logs + - --v=0 + - --minloglevel=0 + healthcheck: + test: ["CMD", "curl", "-sf", "http://metad1:19559/status"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 20s + ports: + - 9559 + - 19559 + - 19560 + volumes: + - ./data/meta1:/data/meta + - ./logs/meta1:/logs + networks: + - nebula-net + restart: on-failure + cap_add: + - SYS_PTRACE + + metad2: + image: docker.io/vesoft/nebula-metad:nightly + environment: + USER: root + TZ: "${TZ}" + command: + - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559 + - --local_ip=metad2 + - --ws_ip=metad2 + - --port=9559 + - --ws_http_port=19559 + - --data_path=/data/meta + - --log_dir=/logs + - --v=0 + - --minloglevel=0 + healthcheck: + test: ["CMD", "curl", "-sf", "http://metad2:19559/status"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 20s + ports: + - 9559 + - 19559 + - 19560 + volumes: + - ./data/meta2:/data/meta + - ./logs/meta2:/logs + networks: + - nebula-net + restart: on-failure + cap_add: + - SYS_PTRACE + + storaged0: + image: docker.io/vesoft/nebula-storaged:nightly + environment: + USER: root + TZ: "${TZ}" + command: + - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559 + - --local_ip=storaged0 + - --ws_ip=storaged0 + - --port=9779 + - --ws_http_port=19779 + - --data_path=/data/storage + - --log_dir=/logs + - --v=0 + - --minloglevel=0 + depends_on: + - metad0 + - metad1 + - metad2 + healthcheck: + test: ["CMD", "curl", "-sf", "http://storaged0:19779/status"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 20s + ports: + - 9779 + - 19779 + - 19780 + volumes: + - ./data/storage0:/data/storage + - ./logs/storage0:/logs + networks: + - nebula-net + restart: on-failure + cap_add: + - SYS_PTRACE + + storaged1: + image: docker.io/vesoft/nebula-storaged:nightly + environment: + USER: root + TZ: "${TZ}" + command: + - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559 + - --local_ip=storaged1 + - --ws_ip=storaged1 + - --port=9779 + - --ws_http_port=19779 + - --data_path=/data/storage + - --log_dir=/logs + - --v=0 + - --minloglevel=0 + depends_on: + - metad0 + - metad1 + - metad2 + healthcheck: + test: ["CMD", "curl", "-sf", "http://storaged1:19779/status"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 20s + ports: + - 9779 + - 19779 + - 19780 + volumes: + - ./data/storage1:/data/storage + - ./logs/storage1:/logs + networks: + - nebula-net + restart: on-failure + cap_add: + - SYS_PTRACE + + storaged2: + image: docker.io/vesoft/nebula-storaged:nightly + environment: + USER: root + TZ: "${TZ}" + command: + - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559 + - --local_ip=storaged2 + - --ws_ip=storaged2 + - --port=9779 + - --ws_http_port=19779 + - --data_path=/data/storage + - --log_dir=/logs + - --v=0 + - --minloglevel=0 + depends_on: + - metad0 + - metad1 + - metad2 + healthcheck: + test: ["CMD", "curl", "-sf", "http://storaged2:19779/status"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 20s + ports: + - 9779 + - 19779 + - 19780 + volumes: + - ./data/storage2:/data/storage + - ./logs/storage2:/logs + networks: + - nebula-net + restart: on-failure + cap_add: + - SYS_PTRACE + + graphd: + image: docker.io/vesoft/nebula-graphd:nightly + environment: + USER: root + TZ: "${TZ}" + command: + - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559 + - --port=9669 + - --local_ip=graphd + - --ws_ip=graphd + - --ws_http_port=19669 + - --log_dir=/logs + - --v=0 + - --minloglevel=0 + depends_on: + - storaged0 + - storaged1 + - storaged2 + healthcheck: + test: ["CMD", "curl", "-sf", "http://graphd:19669/status"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 20s + ports: + - "9669:9669" + - 19669 + - 19670 + volumes: + - ./logs/graph:/logs + networks: + - nebula-net + restart: on-failure + cap_add: + - SYS_PTRACE + + graphd1: + image: docker.io/vesoft/nebula-graphd:nightly + environment: + USER: root + TZ: "${TZ}" + command: + - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559 + - --port=9669 + - --local_ip=graphd1 + - --ws_ip=graphd1 + - --ws_http_port=19669 + - --log_dir=/logs + - --v=0 + - --minloglevel=0 + depends_on: + - storaged0 + - storaged1 + - storaged2 + healthcheck: + test: ["CMD", "curl", "-sf", "http://graphd1:19669/status"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 20s + ports: + - 9669 + - 19669 + - 19670 + volumes: + - ./logs/graph1:/logs + networks: + - nebula-net + restart: on-failure + cap_add: + - SYS_PTRACE + + graphd2: + image: docker.io/vesoft/nebula-graphd:nightly + environment: + USER: root + TZ: "${TZ}" + command: + - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559 + - --port=9669 + - --local_ip=graphd2 + - --ws_ip=graphd2 + - --ws_http_port=19669 + - --log_dir=/logs + - --v=0 + - --minloglevel=0 + depends_on: + - storaged0 + - storaged1 + - storaged2 + healthcheck: + test: ["CMD", "curl", "-sf", "http://graphd2:19669/status"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 20s + ports: + - 9669 + - 19669 + - 19670 + volumes: + - ./logs/graph2:/logs + networks: + - nebula-net + restart: on-failure + cap_add: + - SYS_PTRACE + + console: + image: docker.io/vesoft/nebula-console:nightly + entrypoint: "" + command: + - sh + - -c + - | + for i in `seq 1 60`;do + var=`nebula-console -addr graphd -port 9669 -u root -p nebula -e 'ADD HOSTS "storaged0":9779,"storaged1":9779,"storaged2":9779'`; + if [[ $$? == 0 ]];then + break; + fi; + sleep 1; + echo "retry to add hosts."; + done && tail -f /dev/null; + + depends_on: + - graphd + networks: + - nebula-net + +networks: + nebula-net: diff --git a/tests/third_parties/test_third_parties_nebula_docker.sh b/tests/third_parties/test_third_parties_nebula_docker.sh index b177582f26..c0e134cb06 100644 --- a/tests/third_parties/test_third_parties_nebula_docker.sh +++ b/tests/third_parties/test_third_parties_nebula_docker.sh @@ -1,102 +1,110 @@ -#!/bin/bash # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -set -euo pipefail +#!/bin/bash +set +e +set -x +# Constants WORKPATH=$(dirname "$PWD") LOG_PATH="$WORKPATH/tests" +MAX_ATTEMPTS=30 +SLEEP_TIME=2 -function check_storage_class() { - echo "Checking storage class..." - STORAGE_CLASS_NAME=$(docker system info --format '{{.DriverStatus}}' | grep "Storage Driver" | cut -d':' -f2- | tr -d ' ') - - if [ -n "$STORAGE_CLASS_NAME" ]; then - echo "Using Storage Driver: $STORAGE_CLASS_NAME" - else - echo "No Storage Driver found." - exit 1 - fi -} +# Function to start NebulaGraph services +start_service() { + echo "Starting NebulaGraph services..." + docker compose up -d + + echo "Waiting for services to become healthy..." + for ((i=1; i<=MAX_ATTEMPTS; i++)); do + HEALTHY_COUNT=$(docker compose ps --filter "status=healthy" | wc -l) + TOTAL_COUNT=$(docker compose ps | wc -l) -function start_service() { - echo "Starting Nebula Graph service..." - docker-compose up -d - - # Wait for graphd to be ready - for i in {1..60}; do - status_code=$(curl -s -o /dev/null -w "%{http_code}" http://graphd:19669/status) - if [ "$status_code" = "200" ]; then + echo "Attempt $i/$MAX_ATTEMPTS: $HEALTHY_COUNT out of $TOTAL_COUNT services are healthy" + + if [ $HEALTHY_COUNT -eq $TOTAL_COUNT ]; then + echo "All services are healthy!" break fi - sleep 1 + + sleep $SLEEP_TIME + echo "Still waiting... ($i/$MAX_ATTEMPTS attempts)" done - - if [ "$status_code" != "200" ]; then - echo "Failed to start Nebula Graph" + + if [ $i -eq $MAX_ATTEMPTS ]; then + echo "Services did not become healthy within timeout period" + echo "Current service statuses:" + docker compose ps exit 1 fi } -function validate_database() { +# Function to validate database operations +validate_database() { + GRAPHD_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker compose ps -q graphd)) + + if [ -z "$GRAPHD_IP" ]; then + echo "Could not determine graphd IP address" + exit 1 + fi + + echo "Using graphd IP: $GRAPHD_IP" + echo "[ test create ] creating space..." - query="CREATE SPACE my_space(partition_num=10, replica_factor=1, vid_type=FIXED_STRING(32)); USE my_space; CREATE TAG person(name string, age int);" - create_response=$(docker exec -it console nebula-console -addr graphd -port 9669 -u $NEBULA_USER -p $NEBULA_PASSWORD -e "$query" 2>&1) - + + create_response=$(docker compose exec console nebula-console -addr "$GRAPHD_IP" -port 9669 -u root -p nebula -e "$query" 2>&1) + if [[ $? -eq 0 ]]; then echo "[ test create ] create space succeed" - echo $create_response >> ${LOG_PATH}/nebulagraph_create_space.log else echo "[ test create ] create space failed" - echo $create_response >> ${LOG_PATH}/nebulagraph_create_space.log exit 1 fi - - sleep 30s - - # Test insert data + + sleep $SLEEP_TIME + echo "[ test insert ] inserting data..." query="USE my_space; INSERT VERTEX person(name, age) VALUES 'person1':('Alice', 30); INSERT VERTEX person(name, age) VALUES 'person2':('Bob', 25);" - insert_response=$(docker exec -it console nebula-console -addr graphd -port 9669 -u $NEBULA_USER -p $NEBULA_PASSWORD -e "$query" 2>&1) - + + insert_response=$(docker compose exec console nebula-console -addr "$GRAPHD_IP" -port 9669 -u root -p nebula -e "$query" 2>&1) + if [[ $? -eq 0 ]]; then echo "[ test insert ] insert data succeed" - echo $insert_response >> ${LOG_PATH}/nebulagraph_insert_data.log else echo "[ test insert ] insert data failed" - echo $insert_response >> ${LOG_PATH}/nebulagraph_insert_data.log exit 1 fi - - sleep 30s - - # Test search data + + sleep $SLEEP_TIME + echo "[ test search ] searching data..." query="USE my_space; MATCH (p:person) RETURN p;" - search_response=$(docker exec -it console nebula-console -addr graphd -port 9669 -u $NEBULA_USER -p $NEBULA_PASSWORD -e "$query" 2>&1) - + + search_response=$(docker compose exec console nebula-console -addr "$GRAPHD_IP" -port 9669 -u root -p nebula -e "$query" 2>&1) + if [[ $? -eq 0 ]]; then echo "[ test search ] search data succeed" - echo $search_response >> ${LOG_PATH}/nebulagraph_search_data.log else echo "[ test search ] search data failed" - echo $search_response >> ${LOG_PATH}/nebulagraph_search_data.log exit 1 fi } -function stop_service() { - echo "Stopping Nebula Graph service..." - docker-compose down +# Function to stop services +stop_service() { + echo "Stopping NebulaGraph services..." + docker compose down --remove-orphans } -function main() { - check_storage_class - mkdir -p "$LOG_PATH" +# Main function +main() { + stop_service start_service validate_database stop_service } +# Run main function main "$@" From 354c0b1c81fd414ad51381c58d6651010f1893a7 Mon Sep 17 00:00:00 2001 From: siddhivelankar23 Date: Mon, 17 Mar 2025 06:23:45 +0000 Subject: [PATCH 4/6] remove duplicate Signed-off-by: siddhivelankar23 --- .../deployment/docker_compose/compose.yaml | 142 ------------------ 1 file changed, 142 deletions(-) delete mode 100644 comps/third_parties/nebula/deployment/docker_compose/compose.yaml diff --git a/comps/third_parties/nebula/deployment/docker_compose/compose.yaml b/comps/third_parties/nebula/deployment/docker_compose/compose.yaml deleted file mode 100644 index 4b1640d478..0000000000 --- a/comps/third_parties/nebula/deployment/docker_compose/compose.yaml +++ /dev/null @@ -1,142 +0,0 @@ -# Copyright (C) 2024 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 - -version: '3.4' -services: - metad0: - image: docker.io/vesoft/nebula-metad:v3.8.0 - environment: - USER: root - TZ: "${TZ}" - STORAGE_CLASS_NAME: test - - command: - - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559 - - --local_ip=metad0 - - --ws_ip=metad0 - - --port=9559 - - --ws_http_port=19559 - - --data_path=/data/meta - - --log_dir=/logs - - --v=0 - - --minloglevel=0 - healthcheck: - test: ["CMD", "curl", "-sf", "http://metad0:19559/status"] - interval: 30s - timeout: 10s - retries: 3 - start_period: 20s - ports: - - 9559 - - 19559 - - 19560 - volumes: - - ./data/meta0:/data/meta - - ./logs/meta0:/logs - networks: - - nebula-net - restart: on-failure - cap_add: - - SYS_PTRACE - - - storaged0: - image: docker.io/vesoft/nebula-storaged:v3.8.0 - environment: - USER: root - TZ: "${TZ}" - command: - - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559 - - --local_ip=storaged0 - - --ws_ip=storaged0 - - --port=9779 - - --ws_http_port=19779 - - --data_path=/data/storage - - --log_dir=/logs - - --v=0 - - --minloglevel=0 - depends_on: - - metad0 - - metad1 - - metad2 - healthcheck: - test: ["CMD", "curl", "-sf", "http://storaged0:19779/status"] - interval: 30s - timeout: 10s - retries: 3 - start_period: 20s - ports: - - 9779 - - 19779 - - 19780 - volumes: - - ./data/storage0:/data/storage - - ./logs/storage0:/logs - networks: - - nebula-net - restart: on-failure - cap_add: - - SYS_PTRACE - - - - graphd: - image: docker.io/vesoft/nebula-graphd:v3.8.0 - environment: - USER: root - TZ: "${TZ}" - command: - - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559 - - --port=9669 - - --local_ip=graphd - - --ws_ip=graphd - - --ws_http_port=19669 - - --log_dir=/logs - - --v=0 - - --minloglevel=0 - depends_on: - - storaged0 - - storaged1 - - storaged2 - healthcheck: - test: ["CMD", "curl", "-sf", "http://graphd:19669/status"] - interval: 30s - timeout: 10s - retries: 3 - start_period: 20s - ports: - - "9669:9669" - - 19669 - - 19670 - volumes: - - ./logs/graph:/logs - networks: - - nebula-net - restart: on-failure - cap_add: - - SYS_PTRACE - - - console: - image: docker.io/vesoft/nebula-console:v3.6.0 - entrypoint: "" - command: - - sh - - -c - - | - for i in `seq 1 60`;do - var=`nebula-console -addr graphd -port 9669 -u root -p nebula -e 'ADD HOSTS "storaged0":9779,"storaged1":9779,"storaged2":9779'`; - if [[ $$? == 0 ]];then - break; - fi; - sleep 1; - echo "retry to add hosts."; - done && tail -f /dev/null; - - depends_on: - - graphd - networks: - - nebula-net - -networks: - nebula-net: From 5fd542d280a387be903f6084b50dd75619fbffd0 Mon Sep 17 00:00:00 2001 From: siddhivelankar23 Date: Mon, 17 Mar 2025 16:21:02 +0000 Subject: [PATCH 5/6] update compose path Signed-off-by: siddhivelankar23 --- tests/third_parties/test_third_parties_nebula_docker.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/third_parties/test_third_parties_nebula_docker.sh b/tests/third_parties/test_third_parties_nebula_docker.sh index c0e134cb06..395316a198 100644 --- a/tests/third_parties/test_third_parties_nebula_docker.sh +++ b/tests/third_parties/test_third_parties_nebula_docker.sh @@ -14,7 +14,9 @@ SLEEP_TIME=2 # Function to start NebulaGraph services start_service() { echo "Starting NebulaGraph services..." + cd $WORKPATH/comps/third_parties/nebula/deployment/docker_compose/ docker compose up -d + echo "Waiting for services to become healthy..." for ((i=1; i<=MAX_ATTEMPTS; i++)); do From 3757a611b2f604e656ffd0caa4ce6d9142bfb8d4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 17 Mar 2025 16:25:48 +0000 Subject: [PATCH 6/6] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../nebula/deployment/docker_compose/docker-compose.yaml | 7 +++++-- tests/third_parties/test_third_parties_nebula_docker.sh | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/comps/third_parties/nebula/deployment/docker_compose/docker-compose.yaml b/comps/third_parties/nebula/deployment/docker_compose/docker-compose.yaml index 7d68865dc2..995c0b94d4 100644 --- a/comps/third_parties/nebula/deployment/docker_compose/docker-compose.yaml +++ b/comps/third_parties/nebula/deployment/docker_compose/docker-compose.yaml @@ -1,3 +1,6 @@ +# Copyright (C) 2025 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + version: '3.4' services: metad0: @@ -323,11 +326,11 @@ services: restart: on-failure cap_add: - SYS_PTRACE - + console: image: docker.io/vesoft/nebula-console:nightly entrypoint: "" - command: + command: - sh - -c - | diff --git a/tests/third_parties/test_third_parties_nebula_docker.sh b/tests/third_parties/test_third_parties_nebula_docker.sh index 395316a198..7ccdd48416 100644 --- a/tests/third_parties/test_third_parties_nebula_docker.sh +++ b/tests/third_parties/test_third_parties_nebula_docker.sh @@ -16,7 +16,7 @@ start_service() { echo "Starting NebulaGraph services..." cd $WORKPATH/comps/third_parties/nebula/deployment/docker_compose/ docker compose up -d - + echo "Waiting for services to become healthy..." for ((i=1; i<=MAX_ATTEMPTS; i++)); do