Skip to content

[LIVY-972] Add GitHub Action for CI image - #393

Merged
gyogal merged 12 commits into
masterfrom
feature/github-actions
Apr 8, 2023
Merged

[LIVY-972] Add GitHub Action for CI image#393
gyogal merged 12 commits into
masterfrom
feature/github-actions

Conversation

@dacort

@dacort dacort commented Mar 14, 2023

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

  • Adds Several GitHub Workflows
    • CI image builder
    • Unit tests for git push
    • Integration tests for PRs

How was this patch tested?

Manual validation in the course of the pull request and new GitHub Actions workflows.

@ksumit ksumit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for taking this up.

Comment thread .github/workflows/build-ci-image.yaml Outdated
Comment thread .github/workflows/unit-tests.yaml Outdated
@dacort dacort changed the title Add GitHub Action for CI image [LIVY-972] Add GitHub Action for CI image Mar 14, 2023
@codecov-commenter

codecov-commenter commented Mar 15, 2023

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.25%. Comparing base (45e07fe) to head (01b12d4).
⚠️ Report is 62 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #393      +/-   ##
============================================
- Coverage     68.37%   68.25%   -0.12%     
+ Complexity      849      847       -2     
============================================
  Files           103      103              
  Lines          5989     5989              
  Branches        911      911              
============================================
- Hits           4095     4088       -7     
- Misses         1330     1340      +10     
+ Partials        564      561       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dacort
dacort marked this pull request as ready for review March 20, 2023 18:13

@ksumit ksumit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would it make sense to merge integration-tests.yaml and unit-tests.yaml and use some sort of flag to use one vs the other. We could also avoid building the repository two times (though I don't think that's a big problem since the builds are happening in parallel and probably not adding to the runtime of the overall pipelines). Thoughts?

Comment thread .github/workflows/build-ci-image.yaml
id: docker_build
uses: docker/build-push-action@v4
with:
push: true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is where we could change the logic to false if it's a PR build?

Comment thread .github/workflows/integration-tests.yaml
Comment thread .github/workflows/integration-tests.yaml
Comment thread .github/workflows/unit-tests.yaml
container: ghcr.io/${{ github.repository_owner }}/livy-ci:latest
strategy:
matrix:
spark_version: ["2.4", "3.0"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we can add the unit-test vs integration-test logic here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@dacort I wouldn't want to hold this PR for minor things. If you feel comfortable with the current state, I would push it as it is (something better than nothing) and then iterate on the improvements later on. Let me know what you think.

@dacort

dacort commented Mar 21, 2023

Copy link
Copy Markdown
Contributor Author

Would it make sense to merge integration-tests.yaml and unit-tests.yaml

I wasn't quite sure if there was an easy way to do that. Can definitely look more into it, but ideas welcome.

@ksumit

ksumit commented Mar 23, 2023

Copy link
Copy Markdown
Contributor

Would it make sense to merge integration-tests.yaml and unit-tests.yaml

I wasn't quite sure if there was an easy way to do that. Can definitely look more into it, but ideas welcome.

Here is an example that i found on https://docs.github.com/en/actions/learn-github-actions/contexts

name: CI
on: push
jobs:
  prod-check:
    if: ${{ github.ref == 'refs/heads/main' }}
    runs-on: ubuntu-latest
    steps:
      - run: echo "Deploying to production server on branch $GITHUB_REF"

@gyogal

gyogal commented Apr 6, 2023

Copy link
Copy Markdown
Contributor

Thanks a lot for working on this @dacort! I agree with @ksumit's points and if you feel like this is good to go as is, we could merge it to restore CI functionality for the project.
Post-merge would it be possible to run this for PRs received recently where the builds were not kicked off (such as #396)?

@dacort

dacort commented Apr 7, 2023

Copy link
Copy Markdown
Contributor Author

Thanks @gyogal - Yea, @ksumit I think for now we should merge this. I imagine the PR workflow and unit-test workflow will diverge in the future so would rather get this merged and iterate.

@gyogal re: run the checks retroactively, I don't think it'll happen automatically but if folks push another commit it should.

@lmccay lmccay left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1

@gyogal
gyogal merged commit da246ff into master Apr 8, 2023
@dacort
dacort deleted the feature/github-actions branch April 10, 2023 16:16
@gyogal

gyogal commented Apr 11, 2023

Copy link
Copy Markdown
Contributor

@dacort Thank you for your work on this! I have merged your commit and pre-commit checks are looking good now. There are two minor issues I noticed (maybe these are just temporary and will go away after a few builds):

  1. codecov seems to report an unrealistic drop in coverage on PRs (Merging ... will decrease coverage by 40.09%.)
  2. post-commit unit tests are reporting failures in org.apache.livy.rsc.TestSparkClient

Again, many thanks for adding these workflows because it unblocks PRs and is of great help for the project!

@dacort

dacort commented Apr 11, 2023

Copy link
Copy Markdown
Contributor Author

@gyogal Yep I noticed that too as I work on #392. I initially thought it was related to my changes, but then noticed the failures on the main branch after this PR got merged in. I'm not quite sure what's going on as the unit tests ran fine in the PR.

I'm also guessing the codecov might be related to the unit tests not running but that's just a theory at this point.

jimenefe pushed a commit to onedot-data/incubator-livy that referenced this pull request Oct 15, 2024
* Add GitHub Action for CI image

* Update push action

* Add sample unit test

* Add matrix based on spark version

* Update spark version to be strings for proper comparison

* Fix syntax

* Add maven cache and integration tests

* Just use actions/cache

* Be more explicty with pom locations because container build is running as root. actions/runner#449

* Add MAVEN_OPTS to avoid timeouts[1] and ignore livy in m2 cache
[1] apache/iotdb#3121

* Update cache paths

* Add codecov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants