Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type removal breaking changes #151

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 50 additions & 28 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,62 @@ 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;
if [[ "$IS_UNRELEASED" == "false" ]]; then
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"

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;
else
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 \
opensearch:test;
fi

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