From 87cc338c59a90c242736c9e251d1022249c33acc Mon Sep 17 00:00:00 2001 From: dylan Date: Fri, 26 Jul 2024 12:11:03 -0700 Subject: [PATCH] ci: vec-265 add multinode avs docker compose files --- .../aerospike/etc/aerospike/aerospike.conf | 74 +++++++++++++++++++ .../aerospike-vector-search.yml | 46 ++++++++++++ .../aerospike-vector-search.yml | 46 ++++++++++++ .../container-volumes/nginx/nginx.conf | 16 ++++ .../docker-compose-2-avs-load-balanced.yml | 68 +++++++++++++++++ .internal/multi-node/docker-compose-2-avs.yml | 55 ++++++++++++++ 6 files changed, 305 insertions(+) create mode 100644 .internal/multi-node/container-volumes/aerospike/etc/aerospike/aerospike.conf create mode 100644 .internal/multi-node/container-volumes/avs-1/etc/aerospike-vector-search/aerospike-vector-search.yml create mode 100644 .internal/multi-node/container-volumes/avs-2/etc/aerospike-vector-search/aerospike-vector-search.yml create mode 100644 .internal/multi-node/container-volumes/nginx/nginx.conf create mode 100644 .internal/multi-node/docker-compose-2-avs-load-balanced.yml create mode 100644 .internal/multi-node/docker-compose-2-avs.yml diff --git a/.internal/multi-node/container-volumes/aerospike/etc/aerospike/aerospike.conf b/.internal/multi-node/container-volumes/aerospike/etc/aerospike/aerospike.conf new file mode 100644 index 0000000..8a01f56 --- /dev/null +++ b/.internal/multi-node/container-volumes/aerospike/etc/aerospike/aerospike.conf @@ -0,0 +1,74 @@ +# Aerospike database configuration file for use with systemd. + +service { + cluster-name quote-demo + proto-fd-max 15000 +} + + +logging { + file /var/log/aerospike/aerospike.log { + context any info + } + + # Send log messages to stdout + console { + context any info + context query critical + } +} + +network { + service { + address any + port 3000 + } + + heartbeat { + mode multicast + multicast-group 239.1.99.222 + port 9918 + + # To use unicast-mesh heartbeats, remove the 3 lines above, and see + # aerospike_mesh.conf for alternative. + + interval 150 + timeout 10 + } + + fabric { + port 3001 + } + + info { + port 3003 + } +} + +namespace test { + replication-factor 1 + nsup-period 60 + + storage-engine device { + file /opt/aerospike/data/test.dat + filesize 16G + } +} + +namespace avs-meta { + replication-factor 1 + nsup-period 100 + + storage-engine memory { + data-size 1G + } + + # To use file storage backing, comment out the line above and use the + # following lines instead. +# storage-engine device { +# file /opt/aerospike/data/bar.dat +# filesize 16G +# data-in-memory true # Store data in memory in addition to file. +# } +} + 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 new file mode 100644 index 0000000..9c02514 --- /dev/null +++ b/.internal/multi-node/container-volumes/avs-1/etc/aerospike-vector-search/aerospike-vector-search.yml @@ -0,0 +1,46 @@ +# 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 Proximus service listening ports, TLS and network interface. +service: + ports: + 5000: {} + # 5001: + # advertised-listeners: + # default: + # address: 127.0.0.1 + # port: 5001 + +# 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-1 + +heartbeat: + seeds: + - address: avs-2 + port: 5001 + +# Target Aerospike cluster +storage: + seeds: + - aerospike: + port: 3000 + +# The logging properties. +logging: + enable-console-logging: true + levels: + metrics-ticker: info 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 new file mode 100644 index 0000000..3b489b1 --- /dev/null +++ b/.internal/multi-node/container-volumes/avs-2/etc/aerospike-vector-search/aerospike-vector-search.yml @@ -0,0 +1,46 @@ +# 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-2 + +heartbeat: + seeds: + - address: avs-1 + 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 new file mode 100644 index 0000000..841d2cd --- /dev/null +++ b/.internal/multi-node/container-volumes/nginx/nginx.conf @@ -0,0 +1,16 @@ +events { worker_connections 1024; } + +http { + upstream app { + server avs-1:5000; + server avs-2:5000; + } + + server { + http2 on; + listen 5000; + location / { + grpc_pass grpc://app; + } + } +} \ 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-2-avs-load-balanced.yml new file mode 100644 index 0000000..7fa78f4 --- /dev/null +++ b/.internal/multi-node/docker-compose-2-avs-load-balanced.yml @@ -0,0 +1,68 @@ +services: + aerospike: + image: aerospike/aerospike-server-enterprise:7.0.0.2 + # ports: + # - "3000:3000" + volumes: + - ./container-volumes/aerospike/etc/aerospike:/opt/aerospike/etc/aerospike + command: + - "--config-file" + - "/opt/aerospike/etc/aerospike/aerospike.conf" + healthcheck: + test: [ "CMD", "asinfo", "-p", "3000", "-v", "build" ] + interval: 5s + timeout: 20s + retries: 10 + networks: + - avs-demo + avs-1: + depends_on: + aerospike: + condition: service_healthy + image: aerospike/aerospike-vector-search:0.9.0 + # 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 + healthcheck: + test: ["CMD", "curl", "-f", "http://avs-1:5040/manage/rest/v1"] + interval: 5s + timeout: 20s + retries: 10 + networks: + - avs-demo + avs-2: + depends_on: + aerospike: + condition: service_healthy + image: aerospike/aerospike-vector-search:0.9.0 + # ports: + # - "5000:5000" + volumes: + - ./container-volumes/avs-2/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-2:5040/manage/rest/v1"] + interval: 5s + 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 + depends_on: + avs-1: + condition: service_healthy + avs-2: + condition: service_healthy + volumes: + - ./container-volumes/nginx/nginx.conf:/etc/nginx/nginx.conf + networks: + - avs-demo + + +networks: + avs-demo: {} \ No newline at end of file diff --git a/.internal/multi-node/docker-compose-2-avs.yml b/.internal/multi-node/docker-compose-2-avs.yml new file mode 100644 index 0000000..d9f5c1d --- /dev/null +++ b/.internal/multi-node/docker-compose-2-avs.yml @@ -0,0 +1,55 @@ +services: + aerospike: + image: aerospike/aerospike-server-enterprise:7.0.0.2 + # ports: + # - "3000:3000" + volumes: + - ./container-volumes/aerospike/etc/aerospike:/opt/aerospike/etc/aerospike + command: + - "--config-file" + - "/opt/aerospike/etc/aerospike/aerospike.conf" + healthcheck: + test: [ "CMD", "asinfo", "-p", "3000", "-v", "build" ] + interval: 5s + timeout: 20s + retries: 10 + networks: + - avs-demo + 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 + volumes: + - ./container-volumes/avs-1/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-1:5040/manage/rest/v1"] + interval: 5s + timeout: 20s + retries: 10 + networks: + - avs-demo + avs-2: + depends_on: + aerospike: + condition: service_healthy + image: aerospike/aerospike-vector-search:0.9.0 + # ports: + # - "5000:5000" + volumes: + - ./container-volumes/avs-2/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-2:5040/manage/rest/v1"] + interval: 5s + timeout: 20s + retries: 10 + networks: + - avs-demo + + +networks: + avs-demo: {} \ No newline at end of file