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

Reorganize GitHub workflows. #837

Merged

Conversation

Yury-Fridlyand
Copy link
Collaborator

@Yury-Fridlyand Yury-Fridlyand commented Sep 16, 2022

Signed-off-by: Yury-Fridlyand [email protected]

Description

  • Remove obsolete workflows, mostly related to releasing ODFE artifacts.
  • Update actions in rest workflows.
  • Limit workflow scopes:
    • Reduce file scope, for example, JDBC workflow will be triggered on JDBC changes only.
    • Reduce action scope, so workflows shouldn't be triggered twice on PR.
  • Strictly define env version to avoid unexpected failures.
  • Upload test reports for SQL plugin workflow.
  • Activate tests for SQL CLI.
  • New workflow added which runs all tests for SQL plugin. Despite of the basic SQL workflow, it doesn't stop on the first failure and runs rests tests too. For more details see Add new test workflow. Bit-Quill/opensearch-project-sql#119.
  • New workflow would run on demand only. The button would appear after merge only.
    image

See also discussion in #118 and #119.

Issues Resolved

  • JDBC/ODBC workflow won't be triggered on SQL plugin fixes and updates.
  • Workflows shouldn't be triggered twice in PRs anymore.
  • Cleanup.
  • Activated CodeQL workflow.
  • Activated SQL CLI testing.

Not included changes

ODBC workflow still uses MacOS env v.10.15 which is obsolete. It fails on MacOS 11. We can't switch to newer MacOS version without changing/updating ODBC build process. This will be done in scope of another PR.

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc added
  • Commits are signed per the DCO using --signoff

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.

**Reorganize GitHub workflows:**

* Remove obsoleve workflows, mostly related to releaseing ODFE artifacts.
* Update actions in rest workflows.
* Limit workflow scopes:
  * Reduce file scope, for example, JDBC workflow will be triggered on JDBC changes only.
  * Reduce action scope, so workflows shouldn't be triggered twice on PR.
* Strictly define env version to avoid unexpected failures.
* Upload test reports for SQL plugin workflow.
* Activate tests for SQL CLI.

Signed-off-by: Yury-Fridlyand <[email protected]>
@Yury-Fridlyand Yury-Fridlyand requested a review from a team as a code owner September 16, 2022 21:18
@Yury-Fridlyand Yury-Fridlyand marked this pull request as draft September 18, 2022 15:23
* Add new test workflow.

Signed-off-by: Yury-Fridlyand <[email protected]>
@Yury-Fridlyand Yury-Fridlyand marked this pull request as ready for review September 23, 2022 16:50
MaxKsyunz
MaxKsyunz previously approved these changes Sep 24, 2022
@@ -7,7 +7,7 @@ on:

jobs:
backport:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am not sure about that, do we have any known issue regarding to ubuntu-latest. Any reason change to 20.04?
I think opensearch-project use ubuntu-latest by default.

Copy link
Collaborator Author

@Yury-Fridlyand Yury-Fridlyand Sep 27, 2022

Choose a reason for hiding this comment

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

Please, follow these 2 links or see TLDR section
Bit-Quill#118 (comment)
https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
TL;DR
ubuntu-latest = ubuntu-20.04 now, but subject to change

# tests are designed to run against http://localhost:9200, so we have to disable/remove security plugin
- name: Download and run OpenSearch
run: |
docker run -p 9200:9200 -e "discovery.type=single-node" -e "DISABLE_SECURITY_PLUGIN=true" --name test -d opensearchproject/opensearch:${{ matrix.opensearch-version }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

it may not work. e.g, currently, SQL plugin depend on OpenSearch 2.4. But OpenSearch 2.4 Docker Images is not released yet.

Copy link
Collaborator Author

@Yury-Fridlyand Yury-Fridlyand Sep 27, 2022

Choose a reason for hiding this comment

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

Currently, there are only 2.2.1 and latest in the test matrix. latest grabs the latest released version.
I can create another sub-job to download and build OpenSearch. So tests would run on the current version, e.g. 2.4 for now.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Might be worthwhile the next time someone has a chance.
Another side-effect, is that we would have an artefact to download for our own local development usage... instead of having to download and setup the latest OpenSearch.

with:
name: opensearch-sql
path: opensearch-sql-builds

- name: Upload test reports
Copy link
Collaborator

Choose a reason for hiding this comment

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

why add this? upload to where?

Copy link
Collaborator Author

@Yury-Fridlyand Yury-Fridlyand Sep 27, 2022

Choose a reason for hiding this comment

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

It create a downloadable artifact, like you see there on bottom by following the link. Default lifetime of those is few days or one week.
https://github.com/Bit-Quill/opensearch-project-sql/actions/runs/3087022572

Copy link
Member

@joshuali925 joshuali925 left a comment

Choose a reason for hiding this comment

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

a few questions

.github/workflows/draft-release-notes-workflow.yml Outdated Show resolved Hide resolved
.github/workflows/link-checker.yml Outdated Show resolved Hide resolved
.github/workflows/sql-cli-test-and-build-workflow.yml Outdated Show resolved Hide resolved
.github/workflows/sql-test-workflow.yml Outdated Show resolved Hide resolved
@dai-chen dai-chen added the infrastructure Changes to infrastructure, testing, CI/CD, pipelines, etc. label Sep 27, 2022
Signed-off-by: Yury-Fridlyand <[email protected]>
MaxKsyunz
MaxKsyunz previously approved these changes Sep 27, 2022
Signed-off-by: Yury-Fridlyand <[email protected]>
Copy link
Member

@joshuali925 joshuali925 left a comment

Choose a reason for hiding this comment

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

thanks

@@ -39,6 +39,7 @@ def test_query(self, connection):
)

@estest
@pytest.mark.skip(reason="Test is not compatible with OpenSearch >= 2.3.0, it returns HTTP/503 instead of HTTP/400")
Copy link
Collaborator

Choose a reason for hiding this comment

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

I've left a comment on the bug to revert this if it's fixed: #851

@Yury-Fridlyand Yury-Fridlyand merged commit 10e44ee into opensearch-project:2.x Sep 28, 2022
@Yury-Fridlyand Yury-Fridlyand deleted the integ-reorganize-workflows branch September 28, 2022 18:13
@opensearch-trigger-bot
Copy link
Contributor

The backport to 1.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.x 1.x
# Navigate to the new working tree
cd .worktrees/backport-1.x
# Create a new branch
git switch --create backport/backport-837-to-1.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 10e44ee6439cf130fdc9bff3081503951c42a1cd
# Push it to GitHub
git push --set-upstream origin backport/backport-837-to-1.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.x

Then, create a pull request where the base branch is 1.x and the compare/head branch is backport/backport-837-to-1.x.

@opensearch-trigger-bot
Copy link
Contributor

The backport to main failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-main main
# Navigate to the new working tree
cd .worktrees/backport-main
# Create a new branch
git switch --create backport/backport-837-to-main
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 10e44ee6439cf130fdc9bff3081503951c42a1cd
# Push it to GitHub
git push --set-upstream origin backport/backport-837-to-main
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-main

Then, create a pull request where the base branch is main and the compare/head branch is backport/backport-837-to-main.

Yury-Fridlyand added a commit to Bit-Quill/opensearch-project-sql that referenced this pull request Sep 28, 2022
…nize-workflows

Reorganize GitHub workflows.

(cherry picked from commit 10e44ee)
Yury-Fridlyand added a commit to Bit-Quill/opensearch-project-sql that referenced this pull request Sep 28, 2022
…nize-workflows

Reorganize GitHub workflows.

(cherry picked from commit 10e44ee)
Signed-off-by: Yury-Fridlyand <[email protected]>
Yury-Fridlyand added a commit to Bit-Quill/opensearch-project-sql that referenced this pull request Sep 28, 2022
…nize-workflows

Reorganize GitHub workflows.

(cherry picked from commit 10e44ee)
Signed-off-by: Yury-Fridlyand <[email protected]>
dai-chen pushed a commit that referenced this pull request Sep 28, 2022
Reorganize GitHub workflows.

(cherry picked from commit 10e44ee)
Signed-off-by: Yury-Fridlyand <[email protected]>
dai-chen pushed a commit that referenced this pull request Sep 28, 2022
Reorganize GitHub workflows.

(cherry picked from commit 10e44ee)
Signed-off-by: Yury-Fridlyand <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport main backport 1.x infrastructure Changes to infrastructure, testing, CI/CD, pipelines, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants