Skip to content

Commit

Permalink
Type removal breaking changes (#151)
Browse files Browse the repository at this point in the history
* Breaking changes for type removal

Signed-off-by: Vacha Shah <[email protected]>

* Adding support to test against unreleased OpenSearch

Signed-off-by: Vacha Shah <[email protected]>

* Formatting

Signed-off-by: Vacha Shah <[email protected]>

* Addressing comments to refactor run-opensearch.sh

Signed-off-by: Vacha Shah <[email protected]>
  • Loading branch information
VachaShah authored Apr 13, 2022
1 parent 092a013 commit b1eaba0
Show file tree
Hide file tree
Showing 31 changed files with 206 additions and 624 deletions.
63 changes: 34 additions & 29 deletions .ci/run-opensearch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ environment=($(cat <<-END
END
))

if [[ "$SECURE_INTEGRATION" == "false" ]] && [[ "$CLUSTER" == "opensearch" ]]; then
if [[ "$SECURE_INTEGRATION" == "false" ]] && [[ "$CLUSTER" == "opensearch" ]] && [[ "$IS_UNRELEASED" == "false" ]]; then
security=($(cat <<-END
--env plugins.security.disabled=true
END
Expand Down Expand Up @@ -58,40 +58,45 @@ END
local_detach="true"
if [[ "$i" == "$((NUMBER_OF_NODES-1))" ]]; then local_detach=$DETACH; fi

echo -e "\033[34;1mINFO: building $CLUSTER container\033[0m"
docker build \
--file=.ci/$CLUSTER/Dockerfile \
--build-arg SECURE_INTEGRATION=$SECURE_INTEGRATION \
--build-arg OPENSEARCH_VERSION=$OPENSEARCH_VERSION \
--tag=$CLUSTER-secure-$SECURE_INTEGRATION \
.

echo -e "\033[34;1mINFO:\033[0m Starting container $node_name \033[0m"
set -x
healthcmd="curl -vvv -s --fail http://localhost:9200/_cluster/health || exit 1"
if [[ "$SECURE_INTEGRATION" == "true" ]]; then
healthcmd="curl -vvv -s --insecure -u admin:admin --fail https://localhost:9200/_cluster/health || exit 1"
fi

docker run \
--name "$node_name" \
--network "$network_name" \
--env "ES_JAVA_OPTS=-Xms1g -Xmx1g" \
"${environment[@]}" \
"${volumes[@]}" \
"${security[@]}" \
--publish "$http_port":9200 \
--ulimit nofile=65536:65536 \
--ulimit memlock=-1:-1 \
--detach="$local_detach" \
--health-cmd="$(echo $healthcmd)" \
--health-interval=2s \
--health-retries=20 \
--health-timeout=2s \
--rm \
-d \
$CLUSTER-secure-$SECURE_INTEGRATION;

CLUSTER_TAG=$CLUSTER
if [[ "$IS_UNRELEASED" == "false" ]]; then
CLUSTER_TAG=$CLUSTER_TAG-secure-$SECURE_INTEGRATION
echo -e "\033[34;1mINFO: building $CLUSTER container\033[0m"
docker build \
--file=.ci/$CLUSTER/Dockerfile \
--build-arg SECURE_INTEGRATION=$SECURE_INTEGRATION \
--build-arg OPENSEARCH_VERSION=$OPENSEARCH_VERSION \
--tag=$CLUSTER_TAG \
.
else
CLUSTER_TAG=$CLUSTER_TAG:test
fi
echo -e "\033[34;1mINFO:\033[0m Starting container $node_name \033[0m"
docker run \
--name "$node_name" \
--network "$network_name" \
--env "ES_JAVA_OPTS=-Xms1g -Xmx1g" \
"${environment[@]}" \
"${volumes[@]}" \
"${security[@]}" \
--publish "$http_port":9200 \
--ulimit nofile=65536:65536 \
--ulimit memlock=-1:-1 \
--detach="$local_detach" \
--health-cmd="$(echo $healthcmd)" \
--health-interval=2s \
--health-retries=20 \
--health-timeout=2s \
--rm \
-d \
$CLUSTER_TAG;

set +x
if wait_for_container "$opensearch_node_name" "$network_name"; then
echo -e "\033[32;1mSUCCESS:\033[0m Running on: $node_url\033[0m"
Expand Down
6 changes: 6 additions & 0 deletions .ci/run-tests
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ else
export OPENSEARCH_URL_EXTENSION="http"
fi

export IS_UNRELEASED=false
if [[ "$OPENSEARCH_VERSION" == *"SNAPSHOT" ]]; then
IS_UNRELEASED=true
fi

echo -e "\033[1m>>>>> Unreleased is $IS_UNRELEASED >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m"
script_path=$(dirname $(realpath -s $0))
source $script_path/functions/imports.sh
set -euo pipefail
Expand Down
18 changes: 0 additions & 18 deletions .github/workflows/integration-opendistro.yml

This file was deleted.

35 changes: 35 additions & 0 deletions .github/workflows/integration-unreleased.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Integration with Unreleased OpenSearch

on:
push:
branches:
- "main"
pull_request:
branches:
- "main"

env:
OPENSEARCH_VERSION: '2.0'

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout OpenSearch
uses: actions/checkout@v2
with:
repository: opensearch-project/opensearch
ref: ${{ env.OPENSEARCH_VERSION }}
path: opensearch

# This step builds the docker image tagged as opensearch:test. It will be further used in /ci/run-tests to test against unreleased OpenSearch.
# Reference: https://github.com/opensearch-project/OpenSearch/blob/2.0/distribution/docker/build.gradle#L190
- name: Assemble OpenSearch
run: |
cd opensearch
./gradlew assemble
- name: Checkout Python Client
uses: actions/checkout@v2

- name: Run Integration Test
run: "./.ci/run-tests opensearch false ${{ env.OPENSEARCH_VERSION }}.0-SNAPSHOT"
5 changes: 4 additions & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ jobs:
matrix:
cluster: ["opensearch"]
secured: ["true", "false"]
opensearch_version: [1.0.0, 1.0.1, 1.1.0, 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.2.4, 1.3.0, 1.3.1]
opensearch_version: []

steps:
- name: Checkout
if: ${{ matrix.opensearch_version != ''}}
uses: actions/checkout@v2

- name: Integ ${{ matrix.cluster }} secured=${{ matrix.secured }} version=${{matrix.opensearch_version}}
if: ${{ matrix.opensearch_version != ''}}
run: "./.ci/run-tests ${{ matrix.cluster }} ${{ matrix.secured }} ${{ matrix.opensearch_version }}"
Loading

0 comments on commit b1eaba0

Please sign in to comment.