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

Use CodeBuild-hosted runners for perf testing and automated publishing #801

Merged
merged 4 commits into from
Apr 23, 2024

Conversation

popematt
Copy link
Contributor

@popematt popematt commented Apr 22, 2024

Issue #, if available:

None

Description of changes:

  • Updates build.gradle.kts so that the publish tasks can be done in a CI environment without manual intervention
  • Updates perf tests to run on Graviton + Amazon Linux (when available) using Java 17
  • Updates the publish workflow to automatically upload the published jar to Sonatype/Maven

I must qualify this by saying that I have not tested the publish workflow because to do so I would have to create a new release. It is possible to fallback to the existing manual release process, and I will validate the automated process when we publish the next release.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link

codecov bot commented Apr 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.43%. Comparing base (3c1b6b1) to head (495e813).
Report is 35 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #801      +/-   ##
============================================
+ Coverage     67.23%   67.43%   +0.19%     
- Complexity     5484     5522      +38     
============================================
  Files           159      160       +1     
  Lines         23025    23077      +52     
  Branches       4126     4126              
============================================
+ Hits          15481    15562      +81     
+ Misses         6262     6243      -19     
+ Partials       1282     1272      -10     

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

# of the project you created.
name: Select Runner Type
runs-on: ubuntu-latest
# We want to run on external PRs, but not on internal ones as push automatically builds
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you help me understand this better? Where exactly do we not want to use CodeBuild, and why? And we fall back to ubuntu-latest when CodeBuild is disabled?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought that this would be enough to explain. Feel free to suggest additions.

If you want to use codebuild runners for your personal fork, follow the instructions to set
up a codebuild project. https://docs.aws.amazon.com/codebuild/latest/userguide/action-runner.html
Then, create a repository variable for your fork named CODEBUILD_PROJECT_NAME with the name
of the project you created.

Basically, if you want the perf workflow to run when you push to your fork of the repo, either you need to have codebuild runners setup (which will cost money), or we need to have a fallback option.

I suppose, though, that we might decide that any results on a different runner type are too different to be even the slightest bit valid. In that case, we might rewrite this workflow so that it is entirely skipped if there are no codebuild runners.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think part of my confusion is around the fact that I don't know the intended definition of "external" and "internal" PRs. Looking more closely, it looks like "internal" PRs are ones submitted directly against amazon-ion/ion-java, while "external" PRs covers everything else. And so this block is here just to help, e.g., users with forks still be able to run the perf workflow, falling back to Ubuntu if they don't have CodeBuild. Is that right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, the "internal"/"external" PRs is just to prevent duplicate workflows, and it's something that is already used in our other workflows. When you create a PR from a fork repo to a source repo and a workflow has both push and pull_request triggers, it kicks off the Github workflow for both the push (GitHub pushes PR commits to the target repo somehow) and the actual pull request. The workaround is actually on L58.

- uses: gradle/gradle-build-action@8baac4c8ef753599f92eeb509c246d09d6250fa6 # v3.3.0
with:
arguments: build cyclonedxBom
arguments: build cyclonedxBom publishToSonatype closeAndReleaseSonatypeStagingRepository
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the main difference, right? If I understand correctly it means we won't have to log into the web UI and manually click through to release the staged repo, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes—that's correct.

@popematt popematt merged commit 94caf27 into amazon-ion:master Apr 23, 2024
18 of 36 checks passed
tgregg added a commit that referenced this pull request Apr 24, 2024
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