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

CI workflow with Github Actions #2192

Merged
merged 5 commits into from
Sep 6, 2024
Merged

CI workflow with Github Actions #2192

merged 5 commits into from
Sep 6, 2024

Conversation

mhratson
Copy link
Contributor

@mhratson mhratson commented Sep 2, 2024

Summary

Why

  1. GIthub Actions workflow are native GH workflows
  2. Github Actions do not require additional non-github accounts unlike CircleCI
  3. plenty of compute resources1 available for OSS projects
  4. unlike CircleCI resource limits (don't have details)

What

  1. creates CI workflow ci.yaml
  2. creates Artifactory workflow: artifactory.yaml

Workflow structure is documented in the spec2

Expected Behavior

CI is expected to

  1. execute unit tests
  2. execute integration tests
  3. execute hw platform unit tests
  4. publish artifacts to the artifactory when a tag is published
  5. provide ability to re-run tests on failures
  6. report results to corresponding PR/branch

which is to be used as quality gates for PR merging.

Actual Behavior

  1. current Circle CI integration provides 1 2 3 4 from the expected behavior
  2. but re-run-ing checks requires additional efforts like logging in into the Circle CI
  3. which slows PR feedback loop as users may not have CircleCI credentials and knowledge of the system

Steps to reproduce

  1. see failed PR checks, ie Add completed / remaining bytes rebalance metrics #2133

Known Workarounds

  1. asking PR authors to trigger build

Migration Plan

  1. add GH Actions integration along with CircleCI
  2. confirm GH Actions provide equivalent or better functionality
  3. remove CircleCI integration
  4. ensure publishing via GH actions works

Categorization

  • refactor

Example

This PR has both GH Action and CircleCI checks running:

image

Note how CircleCI doesn't report timing, and is actually slower in current configuration, making GH action complete workflows in 32m vs 40m
image

Footnotes

  1. https://docs.github.com/en/actions/administering-github-actions/usage-limits-billing-and-administration#availability

  2. https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions

## Summary
- initial PR for the series of the PRs
- to migrate circleci to github actions

## Testing Done
- TBD
@mhratson mhratson changed the title initial CI workflow with Github Actions CI workflow with Github Actions Sep 2, 2024
@mhratson mhratson marked this pull request as ready for review September 4, 2024 01:29
@CCisGG
Copy link
Contributor

CCisGG commented Sep 4, 2024

Hi @mhratson , thanks for the change! Let's have more details included in the PR description. E.g. the issue link, what will happen after this merged, what will be the follow up steps, etc. This is a change that impacts every developer, so it would be better to be more clear. Thanks!

@mhratson mhratson requested a review from CCisGG September 5, 2024 00:59
@CCisGG
Copy link
Contributor

CCisGG commented Sep 5, 2024

This looks amazing. Thanks Maryan! We can ship this and improve things along the way when we find anything are missing. We probably need a few other PR check runs to validate this actually works fine.

@CCisGG
Copy link
Contributor

CCisGG commented Sep 5, 2024

One more question: have we tested new tag publishing, or is that the plan when we merge this PR? I think we need to ensure the release publishing pipeline also works after this migration.

@mhratson
Copy link
Contributor Author

mhratson commented Sep 6, 2024

One more question: have we tested new tag publishing, or is that the plan when we merge this PR? I think we need to ensure the release publishing pipeline also works after this migration.

This is tricky, as to test tag pushing we have to disable the circleCI. So won't be validated until cirlceCI workflow is removed.
But then enabling it back should as easy as reverting the removal commit.

@CCisGG
Copy link
Contributor

CCisGG commented Sep 6, 2024

This is tricky, as to test tag pushing we have to disable the circleCI. So won't be validated until cirlceCI workflow is removed.
But then enabling it back should as easy as reverting the removal commit.

Got it. So it means that merging this PR itself won't trigger the switch from circleCI to github actions. We probably need to have another PR to disable it?

@mhratson
Copy link
Contributor Author

mhratson commented Sep 6, 2024

Got it. So it means that merging this PR itself won't trigger the switch from circleCI to github actions. We probably need to have another PR to disable it?

Yup. Yeah, for now both pipelines run in parallel. While running tests in parallel is harmless running publishing in parallel is a race. So maybe i'll disable automatic publishing via GH actions until CircleCI is disabled.

disable event handler until circleCI workflow is disabled to avoid race
@CCisGG
Copy link
Contributor

CCisGG commented Sep 6, 2024

Yup. Yeah, for now both pipelines run in parallel. While running tests in parallel is harmless running publishing in parallel is a race. So maybe i'll disable automatic publishing via GH actions until CircleCI is disabled.

This makes sense to me. Let's do it.

@mhratson mhratson merged commit 8e0b2a2 into main Sep 6, 2024
7 checks passed
@mhratson
Copy link
Contributor Author

mhratson commented Sep 7, 2024

Ran publishing1 for the latest tag, and looks like

  1. CircleCI publishing works2 as expected
  2. looks like we'll have to configure artifactory secrets in GH for it to work:
> Task :artifactoryDeploy FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':artifactoryDeploy'.
> java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.io.IOException: JFrog service failed. Received 401: {
    "errors" : [ {
      "status" : 401,
      "message" : "Unauthorized"
    } ]
  }

CircleCI secrets[^3]

Using environment variables from project settings and/or contexts:
  ARTIFACTORY_KEY=**REDACTED**
  ARTIFACTORY_USER=**REDACTED**

Footnotes

  1. https://github.com/linkedin/cruise-control/actions/runs/10748084760/job/29811352729

  2. https://app.circleci.com/pipelines/github/linkedin/cruise-control/2449/workflows/9f0f0a0c-cdf7-4db4-9b81-753ab197004c/jobs/6708

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.

2 participants