Skip to content

Commit

Permalink
build: vec-289 update the AVS Python client to 1.0.2 (#55)
Browse files Browse the repository at this point in the history
* chore: set AVS_IS_LOADBALANCER config to true by default

* build: vec-289 update avs python client to 1.0.2
  • Loading branch information
dwelch-spike authored Aug 19, 2024
1 parent a3a84d4 commit e21f497
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 8 deletions.
2 changes: 1 addition & 1 deletion basic-search/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
aerospike-vector-search==1.0.0
aerospike-vector-search==1.0.2
4 changes: 3 additions & 1 deletion basic-search/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
dest="load_balancer",
action="store_true",
required=False,
default=False,
# using a load balancer with AVS is best practice so this is the default
# you should set this to False if you are not using a load balancer with an AVS cluster of more than 1 node
default=True,
help="Use this if the host is a load balancer.",
)
args = arg_parser.parse_args()
Expand Down
7 changes: 6 additions & 1 deletion prism-image-search/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ python3 -m pip install -r requirements.txt
The application can be configured by setting the following environment variable.
If not set defaults are used.

[!NOTE]
Using a load balancer with AVS is best practice. Therefore AVS_IS_LOADBAlANCER defaults to True.
This works fine for AVS clusters with a load balancer or clusters with only 1 node. If you are using
the examples with an AVS cluster larger than 1 node without load balancing you should set AVS_IS_LOADBAlANCER to False.

| Environment Variable | Default | Description |
|------------------------|--------------------|-----------------------------------------------------------------|
| APP_USERNAME | | If set, the username for basic authentication |
Expand All @@ -116,7 +121,7 @@ If not set defaults are used.
| AVS_INDEX_SET | image-index | The Aerospike set for storing the HNSW index |
| AVS_INDEX_NAME | prism-image-search | The name of the index |
| AVS_MAX_RESULTS | 20 | Maximum number of vector search results to return |
| AVS_IS_LOADBALANCER | False | If true, the first seed address will be treated as a load balancer node.```
| AVS_IS_LOADBALANCER | True | If true, the first seed address will be treated as a load balancer node.```

### Setup networking (optional)

Expand Down
4 changes: 3 additions & 1 deletion prism-image-search/prism/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@ class Config(object):
AVS_VERIFY_TLS = get_bool_env("VERIFY_TLS", True)
AVS_MAX_RESULTS = int(os.environ.get("AVS_MAX_RESULTS") or 20)
MAX_CONTENT_LENGTH = int(os.environ.get("MAX_CONTENT_LENGTH") or 10485760)
AVS_IS_LOADBALANCER = get_bool_env("AVS_IS_LOADBALANCER", False)
# using a load balancer with AVS is best practice so this is the default
# you should set this to False if you are not using a load balancer with an AVS cluster of more than 1 node
AVS_IS_LOADBALANCER = get_bool_env("AVS_IS_LOADBALANCER", True)
2 changes: 1 addition & 1 deletion prism-image-search/prism/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# TODO: Include exact versions
# Aerospike dependencies
aerospike-vector-search==1.0.0
aerospike-vector-search==1.0.2

# Flask framework
flask~=2.3.2
Expand Down
7 changes: 6 additions & 1 deletion quote-semantic-search/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ python3 -m pip install -r requirements.txt
The application can be configured by setting the following environment variable.
If not set defaults are used.

[!NOTE]
Using a load balancer with AVS is best practice. Therefore AVS_IS_LOADBAlANCER defaults to True.
This works fine for AVS clusters with a load balancer or clusters with only 1 node. If you are using
the examples with an AVS cluster larger than 1 node without load balancing you should set AVS_IS_LOADBAlANCER to False.

| Environment Variable | Default | Description |
|-----------------------------|--------------------|-----------------------------------------------------------------|
| APP_USERNAME | | If set, the username for basic authentication |
Expand All @@ -107,7 +112,7 @@ If not set defaults are used.
| AVS_INDEX_SET | quote-index | The Aerospike set for storing the HNSW index |
| AVS_INDEX_NAME | quote-search | The name of the index |
| AVS_MAX_RESULTS | 20 | Maximum number of vector search results to return |
| AVS_IS_LOADBALANCER | False | If true, the first seed address will be treated as a load balancer node.```
| AVS_IS_LOADBALANCER | True | If true, the first seed address will be treated as a load balancer node.```

### Setup networking (optional)

Expand Down
4 changes: 3 additions & 1 deletion quote-semantic-search/quote-search/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ class Config(object):
AVS_MAX_RESULTS = int(os.environ.get("AVS_MAX_RESULTS") or 5)
INDEXER_PARALLELISM = int(os.environ.get("APP_INDEXER_PARALLELISM") or 1)
MAX_CONTENT_LENGTH = int(os.environ.get("MAX_CONTENT_LENGTH") or 10485760)
AVS_IS_LOADBALANCER = get_bool_env("AVS_IS_LOADBALANCER", False)
# using a load balancer with AVS is best practice so this is the default
# you should set this to False if you are not using a load balancer with an AVS cluster of more than 1 node
AVS_IS_LOADBALANCER = get_bool_env("AVS_IS_LOADBALANCER", True)
DATASET_FILE_PATH = (
os.environ.get("DATASET_FILE_PATH")
or "../container-volumes/quote-search/data/quote-embeddings.csv"
Expand Down
2 changes: 1 addition & 1 deletion quote-semantic-search/quote-search/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# TODO: Include exact versions
# Aerospike dependencies
aerospike-vector-search==1.0.0
aerospike-vector-search==1.0.2


# Flask framework
Expand Down

0 comments on commit e21f497

Please sign in to comment.