-
Notifications
You must be signed in to change notification settings - Fork 282
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/1.3' into 1.x (#2337)
Merging all updates and improvements from 1.3 into 1.x so its build ecosystem is as robust as 1.3. Signed-off-by: Peter Nied <[email protected]>
- Loading branch information
Showing
149 changed files
with
3,241 additions
and
916 deletions.
There are no files selected for viewing
118 changes: 118 additions & 0 deletions
118
.github/actions/start-opensearch-with-one-plugin/action.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
name: 'Launch OpenSearch with a single plugin installed' | ||
description: 'Downloads latest build of OpenSearch, installs a plugin, executes a script and then starts OpenSearch on localhost:9200' | ||
|
||
inputs: | ||
opensearch-version: | ||
description: 'The version of OpenSearch that should be used, e.g "3.0.0"' | ||
required: true | ||
|
||
plugin-name: | ||
description: 'The name of the plugin to use, such as opensearch-security' | ||
required: true | ||
|
||
setup-script-name: | ||
description: 'The name of the setup script you want to run i.e. "setup" (do not include file extension). Leave empty to indicate one should not be run.' | ||
required: false | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
|
||
# Configure longpath names if on Windows | ||
- name: Enable Longpaths if on Windows | ||
if: ${{ runner.os == 'Windows' }} | ||
run: git config --system core.longpaths true | ||
shell: pwsh | ||
|
||
# Download OpenSearch | ||
- name: Download OpenSearch for Windows | ||
uses: peternied/download-file@v2 | ||
if: ${{ runner.os == 'Windows' }} | ||
with: | ||
url: https://artifacts.opensearch.org/snapshots/core/opensearch/${{ inputs.opensearch-version }}-SNAPSHOT/opensearch-min-${{ inputs.opensearch-version }}-SNAPSHOT-windows-x64-latest.zip | ||
|
||
- name: Download OpenSearch for Linux | ||
uses: peternied/download-file@v2 | ||
if: ${{ runner.os == 'Linux' }} | ||
with: | ||
url: https://artifacts.opensearch.org/snapshots/core/opensearch/${{ inputs.opensearch-version }}-SNAPSHOT/opensearch-min-${{ inputs.opensearch-version }}-SNAPSHOT-linux-x64-latest.tar.gz | ||
|
||
# Extract downloaded zip | ||
- name: Extract downloaded tar | ||
if: ${{ runner.os == 'Linux' }} | ||
run: | | ||
tar -xzf opensearch-*.tar.gz | ||
rm -f opensearch-*.tar.gz | ||
shell: bash | ||
|
||
- name: Extract downloaded zip | ||
if: ${{ runner.os == 'Windows' }} | ||
run: | | ||
tar -xzf opensearch-min-${{ inputs.opensearch-version }}-SNAPSHOT-windows-x64-latest.zip | ||
del opensearch-min-${{ inputs.opensearch-version }}-SNAPSHOT-windows-x64-latest.zip | ||
shell: pwsh | ||
|
||
# Install the plugin | ||
- name: Install Plugin into OpenSearch for Linux | ||
if: ${{ runner.os == 'Linux'}} | ||
run: | | ||
chmod +x ./opensearch-${{ inputs.opensearch-version }}-SNAPSHOT/bin/opensearch-plugin | ||
/bin/bash -c "yes | ./opensearch-${{ inputs.opensearch-version }}-SNAPSHOT/bin/opensearch-plugin install file:$(pwd)/opensearch-security.zip" | ||
shell: bash | ||
|
||
- name: Install Plugin into OpenSearch for Windows | ||
if: ${{ runner.os == 'Windows'}} | ||
run: | | ||
'y' | .\opensearch-${{ inputs.opensearch-version }}-SNAPSHOT\bin\opensearch-plugin.bat install file:$(pwd)\${{ inputs.plugin-name }}.zip | ||
shell: pwsh | ||
|
||
# Run any configuration scripts | ||
- name: Run Setup Script for Linux | ||
if: ${{ runner.os == 'Linux' && inputs.setup-script-name != '' }} | ||
run: | | ||
echo "running linux setup" | ||
chmod +x ./${{ inputs.setup-script-name }}.sh | ||
./${{ inputs.setup-script-name }}.sh | ||
shell: bash | ||
|
||
- name: Run Setup Script for Windows | ||
if: ${{ runner.os == 'Windows' && inputs.setup-script-name != '' }} | ||
run: .\${{ inputs.setup-script-name }}.bat | ||
shell: pwsh | ||
|
||
# Run OpenSearch | ||
- name: Run OpenSearch with plugin on Linux | ||
if: ${{ runner.os == 'Linux'}} | ||
run: /bin/bash -c "./opensearch-${{ inputs.opensearch-version }}-SNAPSHOT/bin/opensearch &" | ||
shell: bash | ||
|
||
- name: Run OpenSearch with plugin on Windows | ||
if: ${{ runner.os == 'Windows'}} | ||
run: start .\opensearch-${{ inputs.opensearch-version }}-SNAPSHOT\bin\opensearch.bat | ||
shell: pwsh | ||
|
||
# Give the OpenSearch process some time to boot up before sending any requires, might need to increase the default time! | ||
- name: Sleep while OpenSearch starts | ||
uses: peternied/action-sleep@v1 | ||
with: | ||
seconds: 30 | ||
|
||
# Verify that the server is operational | ||
- name: Check OpenSearch Running on Linux | ||
if: ${{ runner.os != 'Windows'}} | ||
run: curl https://localhost:9200/_cat/plugins -u 'admin:admin' -k -v | ||
shell: bash | ||
|
||
- name: Check OpenSearch Running on Windows | ||
if: ${{ runner.os == 'Windows'}} | ||
run: | | ||
$credentialBytes = [Text.Encoding]::ASCII.GetBytes("admin:admin") | ||
$encodedCredentials = [Convert]::ToBase64String($credentialBytes) | ||
$baseCredentials = "Basic $encodedCredentials" | ||
$Headers = @{ Authorization = $baseCredentials } | ||
Invoke-WebRequest -SkipCertificateCheck -Uri 'https://localhost:9200/_cat/plugins' -Headers $Headers; | ||
shell: pwsh | ||
|
||
- if: always() | ||
run: cat ./opensearch-${{ inputs.opensearch-version }}-SNAPSHOT/logs/opensearch.log | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Plugin Install | ||
|
||
on: [push, pull_request, workflow_dispatch] | ||
|
||
env: | ||
OPENSEARCH_VERSION: 1.4.0 | ||
PLUGIN_NAME: opensearch-security | ||
|
||
jobs: | ||
plugin-install: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, windows-latest] | ||
jdk: [8, 11, 14] | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Set up JDK | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: ${{ matrix.jdk }} | ||
|
||
- name: Checkout Branch | ||
uses: actions/checkout@v2 | ||
|
||
- name: Assemble target plugin | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
arguments: assemble | ||
|
||
# Move and rename the plugin for installation | ||
- name: Move and rename the plugin for installation | ||
run: mv ./build/distributions/${{ env.PLUGIN_NAME }}-*-SNAPSHOT.zip ${{ env.PLUGIN_NAME }}.zip | ||
shell: bash | ||
|
||
- name: Create Setup Script | ||
if: ${{ runner.os == 'Linux' }} | ||
run: | | ||
cat > setup.sh <<'EOF' | ||
chmod +x ./opensearch-${{ env.OPENSEARCH_VERSION }}-SNAPSHOT/plugins/${{ env.PLUGIN_NAME }}/tools/install_demo_configuration.sh | ||
/bin/bash -c "./opensearch-${{ env.OPENSEARCH_VERSION }}-SNAPSHOT/plugins/${{ env.PLUGIN_NAME }}/tools/install_demo_configuration.sh -y" | ||
EOF | ||
- name: Create Setup Script | ||
if: ${{ runner.os == 'Windows' }} | ||
run: | | ||
New-Item .\setup.bat -type file | ||
Set-Content .\setup.bat -Value "powershell.exe .\opensearch-${{ env.OPENSEARCH_VERSION }}-SNAPSHOT\plugins\${{ env.PLUGIN_NAME }}\tools\install_demo_configuration.bat -y" | ||
- name: Run Opensearch with A Single Plugin | ||
uses: ./.github/actions/start-opensearch-with-one-plugin | ||
with: | ||
opensearch-version: ${{ env.OPENSEARCH_VERSION }} | ||
plugin-name: ${{ env.PLUGIN_NAME }} | ||
setup-script-name: setup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
## Contributing to this Project | ||
|
||
OpenSearch is a community project that is built and maintained by people just like **you**. | ||
[This document](https://github.com/opensearch-project/.github/blob/main/CONTRIBUTING.md) explains how you can contribute to this and related projects. | ||
[This document](https://github.com/opensearch-project/.github/blob/main/CONTRIBUTING.md) explains how you can contribute to this and related projects. |
Oops, something went wrong.