diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..e15c51de --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +tests/features.conf filter=git-crypt diff=git-crypt diff --git a/.github/workflows/integration_test.yml b/.github/workflows/integration_test.yml new file mode 100644 index 00000000..5ff27ba2 --- /dev/null +++ b/.github/workflows/integration_test.yml @@ -0,0 +1,49 @@ +name: Run Unit Tests + +on: + pull_request: + branches: + - dev + +jobs: + test: + runs-on: ubuntu-latest + + + strategy: + matrix: + python-version: ["3.9", "3.10", "3.11", "3.12"] + + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Start Aerospike Server + run: | + docker run -d --network=host --name aerospike -p 3000:3000 -v .:/etc/aerospike aerospike/aerospike-server-enterprise:latest + working-directory: tests + + + - name: Start Aerospike Proximus + run: | + docker run -d --network=host -p 5000:5000 -v ./aerospike-proximus.yml:/etc/aerospike-proximus/aerospike-proximus.yml -v ./features.conf:/etc/aerospike-proximus/features.conf aerospike/aerospike-proximus:0.4.0 + working-directory: tests + + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python setup.py + pip install -r requirements.txt + working-directory: tests + + - name: Run unit tests + run: | + python -m pytest -s + working-directory: tests \ No newline at end of file diff --git a/README.md b/README.md index ab346708..f761ee69 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Python client for Aerospike Vector Search Database ## Prerequisites - - Python 3.9 or higher + - Python 3.9 or higher - pip version 9.0.1 or higher - Aerospike Vector Search DB and Aerospike clusters running. diff --git a/tests/aerospike-proximus.yml b/tests/aerospike-proximus.yml new file mode 100644 index 00000000..ab79d385 --- /dev/null +++ b/tests/aerospike-proximus.yml @@ -0,0 +1,57 @@ +# Change the configuration for your use case. +# TODO: Link to Proximus docs + +cluster: + # Custom node-id. It will be auto-generated if not specified. + # node-id: a1 + + # Unique identifier for this cluster. + cluster-name: aerospike-proximus + node-id: ffffffffffffffff + +# The Proximus service listening ports, TLS and network interface. +service: + ports: + 5000: + addresses: + localhost + # Required when running behind NAT + #advertised-listeners: + # default: + # # List of externally accessible addresses and ports for this Proximus instance. + # - address: 10.0.0.1 + # port: 5000 + + +# Management API listening ports, TLS and network interface. +manage: + ports: + 5040: { } + +# Intra cluster interconnect listening ports, TLS and network interface. +interconnect: + ports: + 5001: + addresses: + localhost + +#heartbeat: +# seeds: +# - address: localhost +# port: 6001 + +# Target Aerospike cluster +aerospike: + seeds: + - localhost: + port: 3000 + +# The logging properties. +logging: + #format: json + #file: /var/log/aerospike-proximus/aerospike-proximus.log + enable-console-logging: true + levels: + com.aerospike.vector.index.cache.IndexCacheCoordinator: debug + # metrics-ticker: info + # root: debug \ No newline at end of file diff --git a/tests/aerospike.conf b/tests/aerospike.conf new file mode 100644 index 00000000..4e7bc9ad --- /dev/null +++ b/tests/aerospike.conf @@ -0,0 +1,71 @@ + +# Aerospike database configuration file +# This template sets up a single-node, single namespace developer environment. +# +# Alternatively, you can pass in your own configuration file. +# You can see more examples at +# https://github.com/aerospike/aerospike-server/tree/master/as/etc + +# This stanza must come first. +service { + feature-key-file /etc/aerospike/features.conf + cluster-name proximus +} + +logging { + + + + + + # Send log messages to stdout + console { + context any info + } +} + +network { + service { + address any + port 3000 + + # Uncomment the following to set the 'access-address' parameter to the + # IP address of the Docker host. This will the allow the server to correctly + # publish the address which applications and other nodes in the cluster to + # use when addressing this node. + # access-address + } + + heartbeat { + # mesh is used for environments that do not support multicast + mode mesh + address local + port 3002 + interval 150 + timeout 10 + } + + fabric { + # Intra-cluster communication port (migrates, replication, etc) + # default to same address in 'service' + address local + port 3001 + } + +} + +namespace proximus-meta { + replication-factor 2 +storage-engine memory { + data-size 2G +} +nsup-period 100 +} + +namespace test { + replication-factor 2 + storage-engine memory { + data-size 1G + } + nsup-period 60 +} \ No newline at end of file diff --git a/tests/features.conf b/tests/features.conf new file mode 100644 index 00000000..02510946 Binary files /dev/null and b/tests/features.conf differ