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

Sync workflows with main #549

Merged
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 1 addition & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
# This should match the team set up in https://github.com/orgs/opensearch-project/teams and include any additional contributors
* @opensearch-project/clients
* @ananzh @kavilla @seanneumann @dblock @VachaShah @nhtruong @harshavamsi @timursaurus
33 changes: 0 additions & 33 deletions .github/ISSUE_TEMPLATE/BUG_TEMPLATE.md

This file was deleted.

19 changes: 0 additions & 19 deletions .github/ISSUE_TEMPLATE/FEATURE_REQUEST_TEMPLATE.md

This file was deleted.

23 changes: 0 additions & 23 deletions .github/ISSUE_TEMPLATE/PROPOSAL_TEMPLATE.md

This file was deleted.

7 changes: 0 additions & 7 deletions .github/ISSUE_TEMPLATE/config.yml

This file was deleted.

8 changes: 4 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
### Description

[Describe what this change achieves]
_Describe what this change achieves._

### Issues Resolved

[List any issues this PR will resolve]
_List any issues this PR will resolve, e.g. Closes [...]._

### Check List

- [ ] New functionality includes testing.
- [ ] All tests pass
- [ ] New functionality has been documented.
- [ ] New functionality has javadoc added
- [ ] Linter check was successfull - `yarn run lint` doesn't show any errors
- [ ] Commits are signed per the DCO using --signoff
- [ ] Changelog was updated.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check [here](https://github.com/opensearch-project/OpenSearch/blob/main/CONTRIBUTING.md#developer-certificate-of-origin).
32 changes: 24 additions & 8 deletions .github/workflows/bundler.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
name: Bundler

on: [push, pull_request]
# trigger on every commit push and PR for all branches
on:
push:
branches: ['**']
paths-ignore:
- '**/*.md'
pull_request:
branches: ['**']
paths-ignore:
- '**/*.md'

jobs:
bundler-support:
name: Bundler support
runs-on: ubuntu-latest

strategy:
matrix:
cluster: ['opendistro', 'opensearch']

steps:
- uses: actions/checkout@v2

Expand All @@ -21,15 +26,26 @@ jobs:
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144

- name: Runs ${{ matrix.cluster }} cluster
- name: Runs OpenSearch cluster
run: |
make cluster.clean cluster.${{ matrix.cluster }}.build cluster.${{ matrix.cluster }}.start
make cluster.clean cluster.opensearch.build cluster.opensearch.start

- name: Use Node.js 14.x
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 14.x

# NPM started understanding yarn.lock file starting from v7
- name: Update NPM
shell: bash
run: |
export NPM_VERSION=$(npm -v)
export IS_NPM_SUITABLE=$(node -p "parseInt(process.env.NPM_ROOT, 10) >= 7")
if [ "$IS_NPM_SUITABLE" == "false" ]; then
echo "NPM needs upgrading!"
npm i npm@7 -g
fi

- name: Install
run: |
npm install
Expand Down
18 changes: 16 additions & 2 deletions .github/workflows/compatibility.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
name: Integration for Compatibility

on: [push, pull_request]
# trigger on every commit push and PR for all branches
on:
push:
branches: ['**']
paths-ignore:
- '**/*.md'
pull_request:
branches: ['**']
paths-ignore:
- '**/*.md'

jobs:
integration-test-compatibility:
Expand All @@ -18,7 +27,10 @@ jobs:
- { opensearch_version: 1.2.4 }
- { opensearch_version: 1.3.0 }
- { opensearch_version: 1.3.1 }
- { opensearch_version: 1.3.2 }
- { opensearch_version: 1.3.3 }
- { opensearch_version: 2.0.0 }
- { opensearch_version: 2.0.1 }

steps:
- uses: actions/checkout@v2
Expand All @@ -31,13 +43,14 @@ jobs:
sudo sysctl -w vm.max_map_count=262144

- name: Runs OpenSearch cluster
id: start_opensearch_cluster
run: |
export OPENSEARCH_VERSION=${{ matrix.entry.opensearch_version }}
export SECURE_INTEGRATION=${{ matrix.secured }}
make cluster.clean cluster.opensearch.build cluster.opensearch.start

- name: Use Node.js 16.x
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 16.x

Expand All @@ -56,5 +69,6 @@ jobs:
npm run test:integration:helpers-secure

- name: Stop the OpenSearch cluster
if: ${{ steps.start_opensearch_cluster.outcome == 'success'}}
run: |
make cluster.opensearch.stop
25 changes: 22 additions & 3 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
name: Coverage

on: [push, pull_request]

# trigger on every commit push and PR for all branches
on:
push:
branches: ['**']
paths-ignore:
- '**/*.md'
pull_request:
branches: ['**']
paths-ignore:
- '**/*.md'
jobs:
code-coverage:
name: Code coverage
Expand All @@ -15,10 +23,21 @@ jobs:
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

# NPM started understanding yarn.lock file starting from v7
- name: Update NPM
shell: bash
run: |
export NPM_VERSION=$(npm -v)
export IS_NPM_SUITABLE=$(node -p "parseInt(process.env.NPM_ROOT, 10) >= 7")
if [ "$IS_NPM_SUITABLE" == "false" ]; then
echo "NPM needs upgrading!"
npm i npm@7 -g
fi

- name: Install
run: |
npm install
Expand Down
82 changes: 65 additions & 17 deletions .github/workflows/integration-unreleased.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ on:
push:
branches:
- 'main'
paths-ignore:
- '**/*.md'
pull_request:
branches:
- 'main'
paths-ignore:
- '**/*.md'

jobs:
test:
Expand All @@ -15,41 +19,85 @@ jobs:
fail-fast: false
matrix:
entry:
- { opensearch_ref: '1.x' }
- { opensearch_ref: '2.0' }
- { opensearch_ref: '2.x' }
- { opensearch_ref: 'main' }
- { node_version: '16.x', opensearch_ref: '1.x' }
- { node_version: '16.x', opensearch_ref: '2.0' }
- { node_version: '16.x', opensearch_ref: '2.x' }
- { node_version: '16.x', opensearch_ref: 'main' }
steps:
- name: Checkout OpenSearch
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: opensearch-project/OpenSearch
ref: ${{ matrix.entry.opensearch_ref }}
path: opensearch

- name: Get OpenSearch branch top
id: get-key
working-directory: opensearch
run: echo key=`git log -1 --format='%H'` >> $GITHUB_OUTPUT

- name: Restore cached build
id: cache-restore
uses: actions/cache/restore@v3
with:
path: opensearch/distribution/archives/linux-tar/build/distributions
key: ${{ steps.get-key.outputs.key }}

- name: Assemble OpenSearch
if: steps.cache-restore.outputs.cache-hit != 'true'
working-directory: opensearch
run: ./gradlew :distribution:archives:linux-tar:assemble

- name: Save cached build
if: steps.cache-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v3
with:
path: opensearch/distribution/archives/linux-tar/build/distributions
key: ${{ steps.get-key.outputs.key }}

- name: Run OpenSearch
working-directory: opensearch/distribution/archives/linux-tar/build/distributions
run: |
cd opensearch
./gradlew assemble
# This step runs the docker image generated during gradle assemble in OpenSearch. It is tagged as opensearch:test.
# Reference: https://github.com/opensearch-project/OpenSearch/blob/2.0/distribution/docker/build.gradle#L190
- name: Run Docker Image
run: |
docker run -p 9200:9200 -p 9600:9600 -d -e "discovery.type=single-node" -e "bootstrap.memory_lock=true" opensearch:test
sleep 90
tar xf opensearch-min-*
./opensearch-*/bin/opensearch \
-Enode.attr.testattr=test \
-Epath.repo=/tmp \
-Erepositories.url.allowed_urls='http://snapshot.*' \
-d
for attempt in {1..20}; do
sleep 5
if curl -s localhost:9200; then
echo '=====> ready'
exit 0
fi
echo '=====> waiting...'
done
exit 1

- name: Checkout Javascript Client
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: js-client

- name: Use Node.js 16.x
uses: actions/setup-node@v1
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.x
node-version: ${{ matrix.entry.node_version }}

- name: Install
working-directory: js-client
run: |
npm install

- name: Integration test
working-directory: js-client
run: |
npm run test:integration:helpers

- name: Save server logs
if: failure()
uses: actions/upload-artifact@v3
with:
name: opensearch-logs-${{ matrix.entry.opensearch_ref }}-js-${{ matrix.entry.node_version }}
path: |
opensearch/distribution/archives/linux-tar/build/distributions/**/logs/*
Loading
Loading