Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: vec-289 update the Python client to 1.0.2 #55

Merged
merged 2 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -29,7 +29,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/quotes.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