diff --git a/ann_benchmark.sh b/ann_benchmark.sh index 21a18aee..1006e03e 100755 --- a/ann_benchmark.sh +++ b/ann_benchmark.sh @@ -24,10 +24,19 @@ echo "Building all required containers" ( cd apps/ann-benchmarks/ && docker build -t ann_benchmarks . ) echo "Starting Weaviate..." +echo "ASYNC_INDEXING: $ASYNC_INDEXING" docker compose -f apps/weaviate-no-restart-on-crash/docker-compose.yml up -d wait_weaviate +echo "Current directory: $PWD" +echo "Exising files in current directory: $(ls -la)" + +echo "Printing environment variables" +apt install python3-pip -y +python3 -m pip install docker +python3 get_env_var.py + echo "Run benchmark script" mkdir -p datasets ( diff --git a/ann_benchmark_gcp.sh b/ann_benchmark_gcp.sh index 90d275ef..f10d351d 100755 --- a/ann_benchmark_gcp.sh +++ b/ann_benchmark_gcp.sh @@ -43,6 +43,7 @@ gcloud compute ssh --zone $ZONE $instance -- "mkdir -p ~/apps/" gcloud compute scp --zone $ZONE --recurse apps/ann-benchmarks "$instance:~/apps/" gcloud compute scp --zone $ZONE --recurse apps/weaviate-no-restart-on-crash/ "$instance:~/apps/" gcloud compute scp --zone $ZONE --recurse ann_benchmark.sh "$instance:~" -gcloud compute ssh --zone $ZONE $instance -- "DATASET=$DATASET DISTANCE=$DISTANCE REQUIRED_RECALL=$REQUIRED_RECALL WEAVIATE_VERSION=$WEAVIATE_VERSION MACHINE_TYPE=$MACHINE_TYPE CLOUD_PROVIDER=$CLOUD_PROVIDER OS=$OS bash ann_benchmark.sh" +gcloud compute scp --zone $ZONE --recurse get_env_var.py "$instance:~" +gcloud compute ssh --zone $ZONE $instance -- "ASYNC_INDEXING=$ASYNC_INDEXING DATASET=$DATASET DISTANCE=$DISTANCE REQUIRED_RECALL=$REQUIRED_RECALL WEAVIATE_VERSION=$WEAVIATE_VERSION MACHINE_TYPE=$MACHINE_TYPE CLOUD_PROVIDER=$CLOUD_PROVIDER OS=$OS bash ann_benchmark.sh" mkdir -p results gcloud compute scp --zone $ZONE --recurse "$instance:~/results/*.json" results/ diff --git a/apps/ann-benchmarks/requirements.txt b/apps/ann-benchmarks/requirements.txt index cc8ebf03..9eeb5cfa 100644 --- a/apps/ann-benchmarks/requirements.txt +++ b/apps/ann-benchmarks/requirements.txt @@ -3,3 +3,4 @@ loguru==0.5.3 seaborn==0.12.2 h5py==3.11.0 pandas==2.2.2 +docker==7.1.0 diff --git a/apps/get_env_var.sh b/apps/get_env_var.sh new file mode 100644 index 00000000..5dc08ff3 --- /dev/null +++ b/apps/get_env_var.sh @@ -0,0 +1,25 @@ +import docker + +def get_env_variables(partial_image_name): + client = docker.from_env() + # List all running containers + containers = client.containers.list() + + # Filter containers where the image name matches the partial name + matching_containers = [ + container for container in containers if partial_image_name in container.image.tags[0] + ] + + if not matching_containers: + print(f"No running containers found matching image name: {partial_image_name}") + return + + # Retrieve and print environment variables for each matching container + for container in matching_containers: + print(f"Environment variables for container {container.short_id}:") + exec_result = container.exec_run("env", stdout=True, stderr=True) + print(exec_result.output.decode()) + print("--------------------------------------------") + +# Replace with a partial image name +get_env_variables("weaviate") \ No newline at end of file diff --git a/get_env_var.py b/get_env_var.py new file mode 100755 index 00000000..88c4b748 --- /dev/null +++ b/get_env_var.py @@ -0,0 +1,22 @@ +import docker + +def get_env_variables(partial_image_name): + client = docker.from_env() + containers = client.containers.list() + + matching_containers = [ + container for container in containers if partial_image_name in container.image.tags[0] + ] + + if not matching_containers: + print(f"No running containers found matching image name: {partial_image_name}") + return + + for container in matching_containers: + print(f"Environment variables for container {container.short_id}:") + exec_result = container.exec_run("env", stdout=True, stderr=True) + print(exec_result.output.decode()) + print("--------------------------------------------") + +get_env_variables("weaviate") +