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

Add support to test against multiple versions of OpenSearch #228

Merged
merged 3 commits into from
May 3, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion .ci/opensearch/Dockerfile.opensearch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG OPENSEARCH_VERSION
FROM opensearchproject/opensearch:$OPENSEARCH_VERSION
FROM opensearchproject/opensearch:${OPENSEARCH_VERSION}

ARG opensearch_path=/usr/share/opensearch
ARG opensearch_yml=$opensearch_path/config/opensearch.yml
Expand Down
66 changes: 66 additions & 0 deletions .github/workflows/compatibility.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Integration for Compatibility

on: [push, pull_request]

jobs:
integration-test-compatibility:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
entry:
- { version: '1.1.0', secured: 'true' }
Copy link
Member

@saratvemulapalli saratvemulapalli May 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be Im totally off, I see we are replicating few pieces of code (workflows, compatibility etc ) in all client repositories.
Is there a way we can define these in a single place (May be opensearch-clients) which is the source of truth and consume it in all our client repos?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you found a really nice way to do this in https://github.com/opensearch-project/opensearch-py/pull/163/files @VachaShah - want to update it here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dblock Updated the workflow matrix.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@saratvemulapalli Do you mean like having a template in opensearch-clients?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont know what a template is :/.
I was looking for a single place where common code can live. Lets take compatibility as an example:

  • Defining this in a central place will make it easier when we add new version support.
  • Enforces our CIs to test against new versions.
  • Keeps all clients in sync.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh got it! Yeah we are trying to keep it as consistent as possible across the client repos but I will keep this in mind if we can place common code. My current thought is having a single place might be difficult since the clients can be on different versions with different compatibility, their CIs are written differently etc. But will explore this once the breaking changes are done.

- { version: '1.1.0', secured: 'false' }
- { version: '1.2.0', secured: 'true' }
- { version: '1.2.0', secured: 'false' }
- { version: '1.2.1', secured: 'true' }
- { version: '1.2.1', secured: 'false' }
- { version: '1.2.2', secured: 'true' }
- { version: '1.2.2', secured: 'false' }
- { version: '1.2.3', secured: 'true' }
- { version: '1.2.3', secured: 'false' }
- { version: '1.2.4', secured: 'true' }
- { version: '1.2.4', secured: 'false' }
- { version: '1.3.0', secured: 'true' }
- { version: '1.3.0', secured: 'false' }
- { version: '1.3.1', secured: 'true' }
- { version: '1.3.1', secured: 'false' }

steps:
- uses: actions/checkout@v2

- name: Configure sysctl limits
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144

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

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

- name: Install
run: |
npm install

- name: Integration test without security
if: ${{ matrix.entry.secured == 'false'}}
run: |
npm run test:integration:helpers

- name: Integration test with security
if: ${{ matrix.entry.secured == 'true'}}
run: |
npm run test:integration:helpers-secure

- name: Stop the OpenSearch cluster
run: |
make cluster.opensearch.stop
18 changes: 18 additions & 0 deletions COMPATIBILITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
- [Compatibility with OpenSearch](#compatibility-with-opensearch)

## Compatibility with OpenSearch

The below matrix shows the compatibility of the [`opensearch-js`](https://www.npmjs.com/package/@opensearch-project/opensearch) with versions of [`OpenSearch`](https://opensearch.org/downloads.html#opensearch).

| OpenSearch Version | Client Version |
| --- | --- |
| 1.0.0 | 1.0.0 |
| 1.0.1 | 1.0.0 |
| 1.1.0 | 1.1.0 |
| 1.2.0 | 1.1.0 |
| 1.2.1 | 1.1.0 |
| 1.2.2 | 1.1.0 |
| 1.2.3 | 1.1.0 |
| 1.2.4 | 1.1.0 |
| 1.3.0 | 1.1.0 |
| 1.3.1 | 1.1.0 |