Skip to content

Commit

Permalink
chore: change docker compose mapped AVS port to 5555, use port 5555 i…
Browse files Browse the repository at this point in the history
…n example readme run commands. Add a warning for mac users using basic search with port 5000
  • Loading branch information
dwelch-spike committed Dec 12, 2024
1 parent 93c9a62 commit cc66491
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion basic-search/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@ python3 search.py --help

Run the example.
```shell
python3 search.py
python3 search.py --port 5555
```
40 changes: 22 additions & 18 deletions basic-search/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,24 +61,28 @@
)
args = arg_parser.parse_args()

with AdminClient(
seeds=types.HostPort(host=args.host, port=args.port),
listener_name=listener_name,
is_loadbalancer=args.load_balancer,
) as adminClient:
try:
print("creating index")
adminClient.index_create(
namespace=args.namespace,
name=index_name,
vector_field="vector",
dimensions=2,
sets=args.set,
index_storage=types.IndexStorage(namespace=args.index_namespace, set_name=args.index_set),
)
except Exception as e:
print("failed creating index " + str(e))
pass
try:
with AdminClient(
seeds=types.HostPort(host=args.host, port=args.port),
listener_name=listener_name,
is_loadbalancer=args.load_balancer,
) as adminClient:
try:
print("creating index")
adminClient.index_create(
namespace=args.namespace,
name=index_name,
vector_field="vector",
dimensions=2,
sets=args.set,
index_storage=types.IndexStorage(namespace=args.index_namespace, set_name=args.index_set),
)
except Exception as e:
print("failed creating index " + str(e))
pass
except Exception as e:
raise Exception(f"you are trying to connect to AVS on port {args.port}, "
"on MacOS airplay uses port 5000 by default, make sure there is not a conflict") from e

with Client(
seeds=types.HostPort(host=args.host, port=args.port),
Expand Down
6 changes: 1 addition & 5 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
## Prerequisite
Locate valid `features.conf` in the `./config` directory:

> [!IMPORTANT]
> If you are running MacOS you will need to replace all occurrences of port 5000 with
> port 5002 in your docker compose file and aerospike-vector-search.yml file.
## Installation Aerospike and AVS Clusters (docker-compose)
```shell
docker compose -f docker-compose.yaml up -d
Expand Down Expand Up @@ -46,7 +42,7 @@ docker run -d \
docker run -d \
--name aerospike-vs \
--network svc \
-p 5000:5000 \
-p 5555:5000 \
-p 5040:5040 \
-v ./config:/etc/aerospike-vector-search \
aerospike/aerospike-vector-search:1.0.0
Expand Down
2 changes: 1 addition & 1 deletion docker/docker-compose-asdb-6.4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ services:
aerospike-cluster:
condition: service_healthy
ports:
- "5000:5000"
- "5555:5000"
- "5040:5040"
networks:
- svc
Expand Down
2 changes: 1 addition & 1 deletion docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ services:
aerospike-cluster:
condition: service_healthy
ports:
- "5000:5000"
- "5555:5000"
- "5040:5040"
networks:
- svc
Expand Down
2 changes: 1 addition & 1 deletion prism-image-search/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ ln -s ~/Pictures static/images/data
> likely not be in your path.
```shell
waitress-serve --host 127.0.0.1 --port 8080 --threads 32 prism:app
AVS_PORT=5555 waitress-serve --host 127.0.0.1 --port 8080 --threads 32 prism:app
```

## Performing an image search
Expand Down
2 changes: 1 addition & 1 deletion quote-semantic-search/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ shown [here](https://dev.to/thetrebelcc/how-to-run-a-flask-app-over-https-using-
#### Start the application

```shell
waitress-serve --host 127.0.0.1 --port 8080 --threads 32 quote_search:app
AVS_PORT=5555 waitress-serve --host 127.0.0.1 --port 8080 --threads 32 quote_search:app
```

#### Run for development
Expand Down

0 comments on commit cc66491

Please sign in to comment.