Skip to content

Commit

Permalink
adding scripts for BEIR testing
Browse files Browse the repository at this point in the history
Signed-off-by: Samuel Herman <[email protected]>
  • Loading branch information
samuel-oci committed Dec 9, 2023
1 parent 2b84c48 commit 4843b7b
Show file tree
Hide file tree
Showing 4 changed files with 535 additions and 0 deletions.
9 changes: 9 additions & 0 deletions scripts/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Build with the following command
# docker build --tag="opensearch-zscore-test:2.11.0" .
FROM opensearchproject/opensearch:2.11.0
# Remove previous neural search plugin and install new one
RUN /usr/share/opensearch/bin/opensearch-plugin remove opensearch-neural-search
# Make sure the build is preset, to create it `./gradlew clean assemble -Dopensearch.version="2.11.0"`
# Then copy it locally `cp ../build/distributions/opensearch-neural-search-2.11.0.0-SNAPSHOT.zip .`
COPY opensearch-neural-search-2.11.0.0-SNAPSHOT.zip /usr/share/opensearch/
RUN /usr/share/opensearch/bin/opensearch-plugin install -b file:/usr/share/opensearch/opensearch-neural-search-2.11.0.0-SNAPSHOT.zip
16 changes: 16 additions & 0 deletions scripts/cleanup-previous-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

#### Procedure to cleanup all previous experiments with docker compose ####

# Stop the container(s) using the following command:
docker-compose down

# Delete all containers using the following command:
docker rm -f $(docker ps -a -q)

# Delete all volumes using the following command:
docker volume rm $(docker volume ls -q)

# Restart the containers using the following command:
docker-compose up

48 changes: 48 additions & 0 deletions scripts/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
version: '3'
services:
opensearch-node1: # This is also the hostname of the container within the Docker network (i.e. https://opensearch-node1/)
#image: opensearchproject/opensearch:2.11.0
image: opensearch-zscore-test:2.11.0
container_name: opensearch-node1
environment:
- cluster.name=opensearch-cluster # Name the cluster
- node.name=opensearch-node1 # Name the node that will run in this container
- discovery.seed_hosts=opensearch-node1 # Nodes to look for when discovering the cluster
- cluster.initial_cluster_manager_nodes=opensearch-node1 # Nodes eligibile to serve as cluster manager
- bootstrap.memory_lock=true # Disable JVM heap memory swapping
- plugins.security.disabled=true # Disable security plugin so it's easy to test
- "DISABLE_INSTALL_DEMO_CONFIG=true" # Disable security plugin so it's easy to test
- "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m" # Set min and max JVM heap sizes to at least 50% of system RAM
ulimits:
memlock:
soft: -1 # Set memlock to unlimited (no soft or hard limit)
hard: -1
nofile:
soft: 65536 # Maximum number of open files for the opensearch user - set to at least 65536
hard: 65536
volumes:
- opensearch-data1:/usr/share/opensearch/data # Creates volume called opensearch-data1 and mounts it to the container
ports:
- 9200:9200 # REST API
- 9600:9600 # Performance Analyzer
networks:
- opensearch-net # All of the containers will join the same Docker bridge network
opensearch-dashboards:
image: opensearchproject/opensearch-dashboards:2.11.0 # Make sure the version of opensearch-dashboards matches the version of opensearch installed on other nodes
container_name: opensearch-dashboards
ports:
- 5601:5601 # Map host port 5601 to container port 5601
expose:
- "5601" # Expose port 5601 for web access to OpenSearch Dashboards
environment:
- 'OPENSEARCH_HOSTS=["http://opensearch-node1:9200"]' # Define the OpenSearch nodes that OpenSearch Dashboards will query (Plain HTTP, security disabled)
- "DISABLE_SECURITY_DASHBOARDS_PLUGIN=true" # disables security dashboards plugin in OpenSearch Dashboards
networks:
- opensearch-net

volumes:
opensearch-data1:

networks:
opensearch-net:

Loading

0 comments on commit 4843b7b

Please sign in to comment.