Add support to test against various versions of OpenSearch (#146)

* Adding support to run integration tests across various versions of OpenSearch

Signed-off-by: Vacha Shah <vachshah@amazon.com>

* Adding a compatibility matrix and getting started guide with formatting

Signed-off-by: Vacha Shah <vachshah@amazon.com>

* Splitting jobs for opendistro and opensearch

Signed-off-by: Vacha Shah <vachshah@amazon.com>
This commit is contained in:
Vacha Shah
2022-04-05 14:06:54 -07:00
committed by GitHub
parent fe1730a88b
commit 172a3179ab
12 changed files with 257 additions and 202 deletions
+1 -5
View File
@@ -1,4 +1,4 @@
ARG OPENSEARCH_VERSION=1.0.0
ARG OPENSEARCH_VERSION
FROM opensearchproject/opensearch:$OPENSEARCH_VERSION
ARG opensearch_path=/usr/share/opensearch
@@ -6,7 +6,3 @@ ARG opensearch_yml=$opensearch_path/config/opensearch.yml
ARG SECURE_INTEGRATION
RUN if [ "$SECURE_INTEGRATION" != "true" ] ; then echo "plugins.security.disabled: true" >> $opensearch_yml; fi
COPY --chown=opensearch:opensearch .ci/opensearch/opensearch-run.sh $opensearch_path/
CMD /usr/share/opensearch/opensearch-run.sh
-4
View File
@@ -1,4 +0,0 @@
#!/bin/bash
set -ex
/usr/share/opensearch/bin/opensearch -Ediscovery.type=single-node
+10 -14
View File
@@ -3,21 +3,8 @@
# Launch one or more OpenSearch nodes via the Docker image,
# to form a cluster suitable for running the REST API tests.
#
# Export the STACK_VERSION variable, eg. '8.0.0-SNAPSHOT'.
# Export the TEST_SUITE variable, i.e. 'oss'
# Export the NUMBER_OF_NODES variable to start more than 1 node
# Version 1.4.0
# - Initial version of the run-opensearch.sh script
# - Deleting the volume should not dependent on the container still running
# - Fixed `ES_JAVA_OPTS` config
# - Moved to STACK_VERSION and TEST_VERSION
# - Refactored into functions and imports
# - Support NUMBER_OF_NODES
# - Added 5 retries on docker pull for fixing transient network errors
# - Added flags to make local CCR configurations work
# - Added action.destructive_requires_name=false as the default will be true in v8
script_path=$(dirname $(realpath -s $0))
source $script_path/functions/imports.sh
set -euo pipefail
@@ -32,7 +19,7 @@ declare -a volumes
environment=($(cat <<-END
--env node.name=$opensearch_node_name
--env cluster.name=$cluster_name
--env cluster.initial_master_nodes=$master_node_name
--env discovery.type=single-node
--env discovery.seed_hosts=$master_node_name
--env cluster.routing.allocation.disk.threshold_enabled=false
--env bootstrap.memory_lock=true
@@ -43,6 +30,13 @@ environment=($(cat <<-END
END
))
if [[ "$SECURE_INTEGRATION" == "false" ]] && [[ "$CLUSTER" == "opensearch" ]]; then
security=($(cat <<-END
--env plugins.security.disabled=true
END
))
fi
NUMBER_OF_NODES=${NUMBER_OF_NODES-1}
http_port=9200
for (( i=0; i<$NUMBER_OF_NODES; i++, http_port++ )); do
@@ -68,6 +62,7 @@ END
docker build \
--file=.ci/$CLUSTER/Dockerfile \
--build-arg SECURE_INTEGRATION=$SECURE_INTEGRATION \
--build-arg OPENSEARCH_VERSION=$OPENSEARCH_VERSION \
--tag=$CLUSTER-secure-$SECURE_INTEGRATION \
.
@@ -84,6 +79,7 @@ END
--env "ES_JAVA_OPTS=-Xms1g -Xmx1g" \
"${environment[@]}" \
"${volumes[@]}" \
"${security[@]}" \
--publish "$http_port":9200 \
--ulimit nofile=65536:65536 \
--ulimit memlock=-1:-1 \
+2 -3
View File
@@ -1,8 +1,6 @@
#!/usr/bin/env bash
#
# Version 1.1
# - Moved to .ci folder and seperated out `run-repository.sh`
# - Add `$RUNSCRIPTS` env var for running opensearch dependent products
# Entrypoint to run integration tests
# Default environment variables
export TEST_SUITE="${TEST_SUITE:=oss}"
@@ -10,6 +8,7 @@ export PYTHON_VERSION="${PYTHON_VERSION:=3.9}"
export PYTHON_CONNECTION_CLASS="${PYTHON_CONNECTION_CLASS:=Urllib3HttpConnection}"
export CLUSTER="${1:-opensearch}"
export SECURE_INTEGRATION="${2:-false}"
export OPENSEARCH_VERSION="${3:-latest}"
if [[ "$SECURE_INTEGRATION" == "true" ]]; then
export OPENSEARCH_URL_EXTENSION="https"
else