diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index b8d3912c..a598da2c 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -26,4 +26,4 @@ jobs: - uses: ncipollo/release-action@v1 with: github_token: ${{ steps.github_app_token.outputs.token }} - bodyFile: release-notes/opensearch.release-notes-${{steps.tag.outputs.tag}}.md + bodyFile: release-notes/opensearch-asynchronous-search.release-notes-${{steps.tag.outputs.tag}}.md \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 60cf75d1..9c26cda3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,13 @@ on: - "*" jobs: + Get-CI-Image-Tag: + uses: opensearch-project/opensearch-build/.github/workflows/get-ci-image-tag.yml@main + with: + product: opensearch + linux-build: + needs: Get-CI-Image-Tag strategy: matrix: java: @@ -18,7 +24,16 @@ jobs: # Job name name: Build Asynchronous Search # This job runs on Linux. + outputs: + build-test-linux: ${{ steps.step-build-test-linux.outputs.build-test-linux }} runs-on: ubuntu-latest + container: + # using the same image which is used by opensearch-build team to build the OpenSearch Distribution + # this image tag is subject to change as more dependencies and updates will arrive over time + image: ${{ needs.Get-CI-Image-Tag.outputs.ci-image-version-linux }} + # need to switch to root so that github actions can install runner binary on container without permission issues. + options: --user root + steps: # This step uses the setup-java Github action: https://github.com/actions/setup-java - name: Set Up JDK ${{ matrix.java }} @@ -29,33 +44,68 @@ jobs: - name: Checkout Branch uses: actions/checkout@v2 - name: Build with Gradle - run: ./gradlew build + id: step-build-test-linux + run: | + chown -R 1000:1000 `pwd` + su `id -un 1000` -c "./gradlew build" + plugin=`basename $(ls build/distributions/*.zip)` + echo plugin $plugin + mv -v build/distributions/$plugin ./ + echo "build-test-linux=$plugin" >> $GITHUB_OUTPUT + - name: Uploads coverage + uses: codecov/codecov-action@v1.2.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + - uses: actions/upload-artifact@v3 + with: + name: async-plugin-linux-${{ matrix.java }} + path: ${{ steps.step-build-test-linux.outputs.build-test-linux }} + if-no-files-found: error + + linux-test-docker: + needs: linux-build + strategy: + matrix: + java: + - 11 + - 17 + # Job name + name: Test Asynchronous Search with opensearchstaging docker + # This job runs on Linux. + runs-on: ubuntu-latest + steps: + - name: Checkout Branch + uses: actions/checkout@v2 + - uses: actions/download-artifact@v3 + with: + name: async-plugin-linux-${{ matrix.java }} - name: Pull and Run Docker for security tests run: | - version=`./gradlew properties -q | grep "opensearch_version:" | awk '{print $2}'` - IFS='-' read -r -a version_array <<< "$version" - plugin_version="${version_array[0]}.0"; for entry in ${version_array[@]:1}; do plugin_version+="-$entry"; done - docker_version="${version_array[0]}-${version_array[1]}" + plugin=${{ needs.linux-build.outputs.build-test-linux }} + version=`echo $plugin|awk -F- '{print $3}'| cut -d. -f 1-3` + plugin_version=`echo $plugin|awk -F- '{print $3}'| cut -d. -f 1-4` + qualifier=`echo $plugin|awk -F- '{print $4}'| cut -d. -f 1-1` - echo version $version - echo plugin_version $plugin_version - echo docker_version $docker_version + if [ -n "$qualifier" ] && [ "$qualifier" != "SNAPSHOT" ]; then + qualifier=-${qualifier} + else + qualifier="" + fi - pwd=`pwd` - echo $pwd - cd .. - pwd1=`pwd` - echo $pwd1 - list_of_all_files=`ls asynchronous-search/build/distributions/` - echo "listing distributions" - echo $list_of_all_files + docker_version=$version$qualifier + + + echo plugin version plugin_version qualifier docker_version + echo "($plugin) ($version) ($plugin_version) ($qualifier) ($docker_version)" + + pwd && ls -l ./$plugin if docker pull opensearchstaging/opensearch:$docker_version then echo "FROM opensearchstaging/opensearch:$docker_version" >> Dockerfile echo "RUN if [ -d /usr/share/opensearch/plugins/opensearch-asynchronous-search ]; then /usr/share/opensearch/bin/opensearch-plugin remove opensearch-asynchronous-search; fi" >> Dockerfile - echo "ADD asynchronous-search/build/distributions/opensearch-asynchronous-search-$plugin_version.zip /tmp/" >> Dockerfile - echo "RUN /usr/share/opensearch/bin/opensearch-plugin install --batch file:/tmp/opensearch-asynchronous-search-$plugin_version.zip" >> Dockerfile + echo "ADD $plugin /tmp/" >> Dockerfile + echo "RUN /usr/share/opensearch/bin/opensearch-plugin install --batch file:/tmp/$plugin" >> Dockerfile docker build -t opensearch-asynchronous-search:test . echo "imagePresent=true" >> $GITHUB_ENV else @@ -85,20 +135,7 @@ jobs: with: name: logs path: build/testclusters/integTest-*/logs/* - - name: Create Artifact Path - run: | - mkdir -p asynchronous-search-artifacts - cp ./build/distributions/*.zip asynchronous-search-artifacts - - name: Uploads coverage - uses: codecov/codecov-action@v1.2.1 - with: - token: ${{ secrets.CODECOV_TOKEN }} - # This step uses the upload-artifact Github action: https://github.com/actions/upload-artifact - - name: Upload Artifacts - uses: actions/upload-artifact@v1 - with: - name: asynchronous-search-plugin-ubuntu - path: asynchronous-search-artifacts + windows-build: # Job name name: Build Asynchronous Search @@ -127,6 +164,7 @@ jobs: with: name: asynchronous-search-plugin-windows path: asynchronous-search-artifacts + mac-os-build: # Job name name: Build Asynchronous Search diff --git a/.github/workflows/dco-check.yml b/.github/workflows/dco-check.yml deleted file mode 100644 index cf30ea89..00000000 --- a/.github/workflows/dco-check.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Developer Certificate of Origin Check - -on: [pull_request] - -jobs: - check: - runs-on: ubuntu-latest - - steps: - - name: Get PR Commits - id: 'get-pr-commits' - uses: tim-actions/get-pr-commits@v1.1.0 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: DCO Check - uses: tim-actions/dco@v1.1.0 - with: - commits: ${{ steps.get-pr-commits.outputs.commits }} diff --git a/.github/workflows/multi-node-test-workflow.yml b/.github/workflows/multi-node-test-workflow.yml index 1e1aef10..5661391e 100644 --- a/.github/workflows/multi-node-test-workflow.yml +++ b/.github/workflows/multi-node-test-workflow.yml @@ -12,11 +12,24 @@ on: - "*" jobs: + Get-CI-Image-Tag: + uses: opensearch-project/opensearch-build/.github/workflows/get-ci-image-tag.yml@main + with: + product: opensearch + build: # Job name + needs: Get-CI-Image-Tag name: Build Asynchronous Search # This job runs on Linux runs-on: ubuntu-latest + container: + # using the same image which is used by opensearch-build team to build the OpenSearch Distribution + # this image tag is subject to change as more dependencies and updates will arrive over time + image: ${{ needs.Get-CI-Image-Tag.outputs.ci-image-version-linux }} + # need to switch to root so that github actions can install runner binary on container without permission issues. + options: --user root + steps: # This step uses the setup-java Github action: https://github.com/actions/setup-java - name: Set Up JDK 11 @@ -28,11 +41,14 @@ jobs: - name: Checkout Branch uses: actions/checkout@v2 - name: Run integration tests with multi node config - run: ./gradlew integTest -PnumNodes=5 + run: | + chown -R 1000:1000 `pwd` + su `id -un 1000` -c "./gradlew integTest -PnumNodes=5" - name: Run Backwards Compatibility Tests run: | echo "Running backwards compatibility tests ..." - ./gradlew bwcTestSuite -Dtests.security.manager=false + chown -R 1000:1000 `pwd` + su `id -un 1000` -c "./gradlew bwcTestSuite -Dtests.security.manager=false" - name: Upload failed logs uses: actions/upload-artifact@v2 if: failure() diff --git a/build.gradle b/build.gradle index e9c6d74f..1103b6fd 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ buildscript { opensearch_group = "org.opensearch" isSnapshot = "true" == System.getProperty("build.snapshot", "true") opensearch_version = System.getProperty("opensearch.version", "3.0.0-SNAPSHOT") - opensearch_plugin_version = System.getProperty("bwc.version", "2.10.0.0") + opensearch_plugin_version = System.getProperty("bwc.version", "2.11.0.0") buildVersionQualifier = System.getProperty("build.version_qualifier", "") // 2.0.0-rc1-SNAPSHOT -> 2.0.0.0-rc1-SNAPSHOT version_tokens = opensearch_version.tokenize('-') @@ -259,10 +259,10 @@ ext.getPluginResource = { download_to_folder, download_from_src -> } String baseName = "asynSearchCluster" -String bwcVersionShort = "2.10.0" +String bwcVersionShort = "2.11.0" String bwcVersion = bwcVersionShort + ".0" String bwcFilePath = "src/test/resources/org/opensearch/search/asynchronous/bwc/" -String bwcRemoteFile = "https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.10.0/8288/linux/x64/tar/builds/opensearch/plugins/opensearch-asynchronous-search-2.10.0.0.zip" +String bwcRemoteFile = "https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/"+ bwcVersionShort + "/latest/linux/x64/tar/builds/opensearch/plugins/opensearch-asynchronous-search-"+ bwcVersion +".zip" getPluginResource(bwcFilePath + bwcVersion, bwcRemoteFile) // Creates two test clusters of previous version and loads opensearch plugin of bwcVersion 2.times { i -> diff --git a/release-notes/opensearch-asynchronous-search.release-notes-2.10.0.0.md b/release-notes/opensearch-asynchronous-search.release-notes-2.10.0.0.md new file mode 100644 index 00000000..1a3a21af --- /dev/null +++ b/release-notes/opensearch-asynchronous-search.release-notes-2.10.0.0.md @@ -0,0 +1,15 @@ +## Version 2.8.0.0 2023-09-25 + +Compatible with OpenSearch 2.10.0 + +### Maintenance +* Upgrade Guava version to 32.0.1 ([#347](https://github.com/opensearch-project/asynchronous-search/pull/347)) +* Increment version to 2.10.0 ([#321](https://github.com/opensearch-project/asynchronous-search/pull/321)) + +### Infrastructure +* Updates demo certs used in rest tests ([#341](https://github.com/opensearch-project/asynchronous-search/pull/341)) +* Adding release workflow for the asynchronous search ([#330](https://github.com/opensearch-project/asynchronous-search/pull/330)) +* Refactoring changes in main ([#328](https://github.com/opensearch-project/asynchronous-search/pull/328)) + +### Documentation +* Add 2.10.0 release notes ([#353](https://github.com/opensearch-project/asynchronous-search/pull/353)) diff --git a/release-notes/opensearch-asynchronous-search.release-notes-2.11.0.0.md b/release-notes/opensearch-asynchronous-search.release-notes-2.11.0.0.md new file mode 100644 index 00000000..87951f8a --- /dev/null +++ b/release-notes/opensearch-asynchronous-search.release-notes-2.11.0.0.md @@ -0,0 +1,6 @@ +## Version 2.11.0.0 2023-10-18 + +Compatible with OpenSearch 2.11.0 + +### Maintenance +* Increment version to 2.11.0 ([#446](https://github.com/opensearch-project/asynchronous-search/pull/446)) diff --git a/release-notes/opensearch-asynchronous-search.release-notes-2.9.0.0.md b/release-notes/opensearch-asynchronous-search.release-notes-2.9.0.0.md new file mode 100644 index 00000000..592900c3 --- /dev/null +++ b/release-notes/opensearch-asynchronous-search.release-notes-2.9.0.0.md @@ -0,0 +1,6 @@ +## Version 2.9.0.0 2023-08-31 + +Compatible with OpenSearch 2.9.0 + +### Maintenance +* Increment version to 2.9.0 ([336](https://github.com/opensearch-project/asynchronous-search/pull/336)) \ No newline at end of file diff --git a/src/test/java/org/opensearch/search/asynchronous/management/AsynchronousSearchManagementServiceTests.java b/src/test/java/org/opensearch/search/asynchronous/management/AsynchronousSearchManagementServiceTests.java index 85c33233..eb916ef0 100644 --- a/src/test/java/org/opensearch/search/asynchronous/management/AsynchronousSearchManagementServiceTests.java +++ b/src/test/java/org/opensearch/search/asynchronous/management/AsynchronousSearchManagementServiceTests.java @@ -25,6 +25,7 @@ import org.opensearch.common.settings.Settings; import org.opensearch.common.util.set.Sets; import org.opensearch.core.index.Index; +import org.opensearch.telemetry.tracing.noop.NoopTracer; import org.opensearch.test.ClusterServiceUtils; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.test.transport.MockTransport; @@ -115,7 +116,8 @@ protected void onSendRequest(long requestId, String action, TransportRequest req }; final TransportService transportService = mockTransport.createTransportService(settings, deterministicTaskQueue.getThreadPool(), NOOP_TRANSPORT_INTERCEPTOR, boundTransportAddress -> - new DiscoveryNode("local-node", buildNewFakeTransportAddress(), Version.CURRENT), null, emptySet()); + new DiscoveryNode("local-node", buildNewFakeTransportAddress(), Version.CURRENT), null, emptySet(), + NoopTracer.INSTANCE); transportService.start(); transportService.acceptIncomingRequests(); AsynchronousSearchManagementService managementService = new AsynchronousSearchManagementService(settings, mockClusterService, diff --git a/src/test/resources/2.10.0.0/opensearch-asynchronous-search-2.10.0.0.zip b/src/test/resources/2.10.0.0/opensearch-asynchronous-search-2.10.0.0.zip deleted file mode 100644 index 91e9b6e0..00000000 Binary files a/src/test/resources/2.10.0.0/opensearch-asynchronous-search-2.10.0.0.zip and /dev/null differ diff --git a/src/test/resources/org/opensearch/search/asynchronous/bwc/2.11.0.0/opensearch-asynchronous-search-2.11.0.0.zip b/src/test/resources/org/opensearch/search/asynchronous/bwc/2.11.0.0/opensearch-asynchronous-search-2.11.0.0.zip new file mode 100644 index 00000000..813d8205 Binary files /dev/null and b/src/test/resources/org/opensearch/search/asynchronous/bwc/2.11.0.0/opensearch-asynchronous-search-2.11.0.0.zip differ diff --git a/src/test/resources/org/opensearch/search/asynchronous/bwc/2.9.0.0/opensearch-asynchronous-search-2.9.0.0.zip b/src/test/resources/org/opensearch/search/asynchronous/bwc/2.9.0.0/opensearch-asynchronous-search-2.9.0.0.zip deleted file mode 100644 index fa482667..00000000 Binary files a/src/test/resources/org/opensearch/search/asynchronous/bwc/2.9.0.0/opensearch-asynchronous-search-2.9.0.0.zip and /dev/null differ