From 1f36c4c0876e92b9ecc8b2494766b90622bc8019 Mon Sep 17 00:00:00 2001 From: dylan Date: Mon, 29 Jul 2024 13:33:35 -0700 Subject: [PATCH] ci: launch 3 avs nodes --- .internal/multi-node/README.md | 4 +- .../aerospike-vector-search.yml | 2 + .../aerospike-vector-search.yml | 2 + .../aerospike-vector-search.yml | 48 +++++++++++++++++++ .../container-volumes/nginx/nginx.conf | 1 + ...=> docker-compose-3-avs-load-balanced.yml} | 44 ++++++++++++++--- ...-balanced.yml => docker-compose-3-avs.yml} | 34 +++++++------ 7 files changed, 112 insertions(+), 23 deletions(-) create mode 100644 .internal/multi-node/container-volumes/avs-3/etc/aerospike-vector-search/aerospike-vector-search.yml rename .internal/multi-node/{docker-compose-2-avs.yml => docker-compose-3-avs-load-balanced.yml} (58%) rename .internal/multi-node/{docker-compose-2-avs-load-balanced.yml => docker-compose-3-avs.yml} (73%) diff --git a/.internal/multi-node/README.md b/.internal/multi-node/README.md index 4dc4148..37e0ed3 100644 --- a/.internal/multi-node/README.md +++ b/.internal/multi-node/README.md @@ -9,12 +9,12 @@ Locate valid `features.conf` in the `./container-volumes/features` directory: ## Load Balanced 2 Node AVS Cluster ```shell -docker compose -f docker-compose-2-avs-load-balanced.yaml up -d +docker compose -f docker-compose-3-avs-load-balanced.yaml up -d ``` ## Plain 2 Node AVS Cluster ```shell -docker compose -f docker-compose-2-avs.yaml up -d +docker compose -3 docker-compose-2-avs.yaml up -d ``` diff --git a/.internal/multi-node/container-volumes/avs-1/etc/aerospike-vector-search/aerospike-vector-search.yml b/.internal/multi-node/container-volumes/avs-1/etc/aerospike-vector-search/aerospike-vector-search.yml index 9c02514..bb0fd2c 100644 --- a/.internal/multi-node/container-volumes/avs-1/etc/aerospike-vector-search/aerospike-vector-search.yml +++ b/.internal/multi-node/container-volumes/avs-1/etc/aerospike-vector-search/aerospike-vector-search.yml @@ -32,6 +32,8 @@ heartbeat: seeds: - address: avs-2 port: 5001 + - address: avs-3 + port: 5001 # Target Aerospike cluster storage: diff --git a/.internal/multi-node/container-volumes/avs-2/etc/aerospike-vector-search/aerospike-vector-search.yml b/.internal/multi-node/container-volumes/avs-2/etc/aerospike-vector-search/aerospike-vector-search.yml index 3b489b1..48ed361 100644 --- a/.internal/multi-node/container-volumes/avs-2/etc/aerospike-vector-search/aerospike-vector-search.yml +++ b/.internal/multi-node/container-volumes/avs-2/etc/aerospike-vector-search/aerospike-vector-search.yml @@ -32,6 +32,8 @@ heartbeat: seeds: - address: avs-1 port: 5001 + - address: avs-3 + port: 5001 # Target Aerospike cluster storage: diff --git a/.internal/multi-node/container-volumes/avs-3/etc/aerospike-vector-search/aerospike-vector-search.yml b/.internal/multi-node/container-volumes/avs-3/etc/aerospike-vector-search/aerospike-vector-search.yml new file mode 100644 index 0000000..617329e --- /dev/null +++ b/.internal/multi-node/container-volumes/avs-3/etc/aerospike-vector-search/aerospike-vector-search.yml @@ -0,0 +1,48 @@ +# Change the configuration for your use case. +cluster: + # Custom node-id. It will be auto-generated if not specified. + # node-id: a1 + + # Unique identifier for this cluster. + cluster-name: multi-node-avs + +# The AVS service listening ports, TLS and network interface. +service: + ports: + 5000: {} + # 5002: + # advertised-listeners: + # default: + # address: 127.0.0.1 + # port: 5002 + +# Management API listening ports, TLS and network interface. +manage: + ports: + 5040: {} + +# Intra cluster interconnect listening ports, TLS and network interface. +interconnect: + ports: + 5001: + addresses: + avs-3 + +heartbeat: + seeds: + - address: avs-1 + port: 5001 + - address: avs-2 + port: 5001 + +# Target Aerospike cluster +storage: + seeds: + - aerospike: + port: 3000 + +# The logging properties. +logging: + enable-console-logging: true + levels: + metrics-ticker: off diff --git a/.internal/multi-node/container-volumes/nginx/nginx.conf b/.internal/multi-node/container-volumes/nginx/nginx.conf index 841d2cd..5689356 100644 --- a/.internal/multi-node/container-volumes/nginx/nginx.conf +++ b/.internal/multi-node/container-volumes/nginx/nginx.conf @@ -4,6 +4,7 @@ http { upstream app { server avs-1:5000; server avs-2:5000; + server avs-3:5000; } server { diff --git a/.internal/multi-node/docker-compose-2-avs.yml b/.internal/multi-node/docker-compose-3-avs-load-balanced.yml similarity index 58% rename from .internal/multi-node/docker-compose-2-avs.yml rename to .internal/multi-node/docker-compose-3-avs-load-balanced.yml index d9f5c1d..339f7ec 100644 --- a/.internal/multi-node/docker-compose-2-avs.yml +++ b/.internal/multi-node/docker-compose-3-avs-load-balanced.yml @@ -14,14 +14,14 @@ services: timeout: 20s retries: 10 networks: - - avs-demo + - avs-balanced avs-1: depends_on: aerospike: condition: service_healthy image: aerospike/aerospike-vector-search:0.9.0 - ports: - - "5000:5000" # change this to 5002 if you are using mac + # ports: + # - "5000:5000" volumes: - ./container-volumes/avs-1/etc/aerospike-vector-search:/etc/aerospike-vector-search - ./container-volumes/features/features.conf:/etc/aerospike-vector-search/features.conf @@ -31,7 +31,7 @@ services: timeout: 20s retries: 10 networks: - - avs-demo + - avs-balanced avs-2: depends_on: aerospike: @@ -48,8 +48,40 @@ services: timeout: 20s retries: 10 networks: - - avs-demo + - avs-balanced + avs-3: + depends_on: + aerospike: + condition: service_healthy + image: aerospike/aerospike-vector-search:0.9.0 + # ports: + # - "5000:5000" + volumes: + - ./container-volumes/avs-3/etc/aerospike-vector-search:/etc/aerospike-vector-search + - ./container-volumes/features/features.conf:/etc/aerospike-vector-search/features.conf + healthcheck: + test: ["CMD", "curl", "-f", "http://avs-3:5040/manage/rest/v1"] + interval: 5s + timeout: 20s + retries: 10 + networks: + - avs-balanced + nginx: + image: nginx:latest + ports: + - "5000:5000" # change this to 5002 for macs, mac port 5000 is in use by default + depends_on: + avs-1: + condition: service_healthy + avs-2: + condition: service_healthy + avs-3: + condition: service_healthy + volumes: + - ./container-volumes/nginx/nginx.conf:/etc/nginx/nginx.conf + networks: + - avs-balanced networks: - avs-demo: {} \ No newline at end of file + avs-balanced: {} \ No newline at end of file diff --git a/.internal/multi-node/docker-compose-2-avs-load-balanced.yml b/.internal/multi-node/docker-compose-3-avs.yml similarity index 73% rename from .internal/multi-node/docker-compose-2-avs-load-balanced.yml rename to .internal/multi-node/docker-compose-3-avs.yml index 7fa78f4..3fc9517 100644 --- a/.internal/multi-node/docker-compose-2-avs-load-balanced.yml +++ b/.internal/multi-node/docker-compose-3-avs.yml @@ -14,14 +14,14 @@ services: timeout: 20s retries: 10 networks: - - avs-demo + - avs-multi-node avs-1: depends_on: aerospike: condition: service_healthy image: aerospike/aerospike-vector-search:0.9.0 - # ports: - # - "5000:5000" + ports: + - "5000:5000" # change this to 5002 if you are using mac volumes: - ./container-volumes/avs-1/etc/aerospike-vector-search:/etc/aerospike-vector-search - ./container-volumes/features/features.conf:/etc/aerospike-vector-search/features.conf @@ -31,7 +31,7 @@ services: timeout: 20s retries: 10 networks: - - avs-demo + - avs-multi-node avs-2: depends_on: aerospike: @@ -48,21 +48,25 @@ services: timeout: 20s retries: 10 networks: - - avs-demo - nginx: - image: nginx:latest - ports: - - "5000:5000" # change this to 5002 for macs, mac port 5000 is in use by default + - avs-multi-node + avs-3: depends_on: - avs-1: - condition: service_healthy - avs-2: + aerospike: condition: service_healthy + image: aerospike/aerospike-vector-search:0.9.0 + # ports: + # - "5000:5000" volumes: - - ./container-volumes/nginx/nginx.conf:/etc/nginx/nginx.conf + - ./container-volumes/avs-3/etc/aerospike-vector-search:/etc/aerospike-vector-search + - ./container-volumes/features/features.conf:/etc/aerospike-vector-search/features.conf + healthcheck: + test: ["CMD", "curl", "-f", "http://avs-3:5040/manage/rest/v1"] + interval: 5s + timeout: 20s + retries: 10 networks: - - avs-demo + - avs-multi-node networks: - avs-demo: {} \ No newline at end of file + avs-multi-node: {} \ No newline at end of file