-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Migrate CircleCI workflows to GitHub Actions (2/3) #2298
Migrate CircleCI workflows to GitHub Actions (2/3) #2298
Conversation
.github/workflows/build-and-test.yml
Outdated
loadtestpre: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.splitloadtest.outputs.matrix }} | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
loadtestpre
does some pre-processing so we can simulate CircleCI testsharding on GitHub Actions. This cuts down the runtime of loadtests from 15mins to ~5mins
This job does the following:
- Get a list of all loadtest tests using
make testbed-list-loadtest
- Split tests into groups of two (
TestIdleMode|TestBallastMemory
,TestLog10kDPS|TestMetric10kDPS
etc) - Create a JSON containing each test grouping. This JSON will be consumed by the strategy.matrix of the loadtest job using
fromJSON()
. The strategy.matrix is how we get to run the loadtests in parallel
- name: Create test result archive # some test results have invalid characters | ||
if: ${{ failure() || success() }} | ||
continue-on-error: true | ||
run: tar -cvf test_results.tar testbed/tests/results | ||
- name: Upload test results | ||
if: ${{ failure() || success() }} | ||
continue-on-error: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
making a tarball of the test results because some tests have filenames with invalid characters (namely the
0*0bytes
test) which causes the upload action to fail. -
if: ${{ failure() || success() }}
this ensures that test results are uploaded even if the loadtest fails which can be useful for debugging -
continue-on-error: true
Sometimes (rarely, but still) the upload action fails due to a network error on github's side. This makes sure the entire job doesnt fail if the test results fail to upload
@@ -60,7 +60,7 @@ type DataReceiverBase struct { | |||
Port int | |||
} | |||
|
|||
const DefaultHost = "localhost" | |||
const DefaultHost = "127.0.0.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line was causing an error with the fluentbit log test since localhost
could not be resolved on the github actions runners.
@@ -42,7 +42,7 @@ func TestIdleMode(t *testing.T) { | |||
) | |||
defer tc.Stop() | |||
|
|||
tc.SetResourceLimits(testbed.ResourceSpec{ExpectedMaxCPU: 4, ExpectedMaxRAM: 50}) | |||
tc.SetResourceLimits(testbed.ResourceSpec{ExpectedMaxCPU: 4, ExpectedMaxRAM: 55}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the GitHub Action runners the RAM utilization is consistently higher (probably due to some other background processes on the GitHub machine). Loadtests don't pass unless these values are adjusted a little 😞
Codecov Report
@@ Coverage Diff @@
## master #2298 +/- ##
=======================================
Coverage 92.04% 92.04%
=======================================
Files 272 272
Lines 15345 15345
=======================================
Hits 14124 14124
Misses 840 840
Partials 381 381 Continue to review full report at Codecov.
|
7b043ee
to
82e0cdf
Compare
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v2 | ||
- name: Setup Go | ||
uses: actions/[email protected] | ||
with: | ||
go-version: 1.15 | ||
- name: Download tool binaries | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: tool-binaries | ||
path: /home/runner/go/bin | ||
- name: Add execute permissions to tool binaries | ||
run: chmod -R +x /home/runner/go/bin | ||
- name: Setup env | ||
run: | | ||
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV | ||
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | ||
- name: Restore module cache | ||
uses: actions/cache@v2 | ||
env: | ||
cache-name: cache-go-modules | ||
with: | ||
path: /home/runner/go/pkg/mod | ||
key: go-pkg-mod-${{ runner.os }}-${{ hashFiles('./go.mod') }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code seem to be duplicated a lot between jobs, is there a way to avoid this and have a common step that all jobs will run?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately I dont think there is a way to reuse steps across jobs as we can't use YAML anchors. It seems like the GitHub team is aware this is a pain point though and working on an alternative feature soon :/
5de614f
to
46e2ce8
Compare
@AzfaarQureshi there is an error in the action
|
17341f2
to
3e044f4
Compare
@AzfaarQureshi @shovnik I have couple more feedback about this, how can I give that to you? Is it ok for me to file issues and assign to you? |
024f180
to
408073b
Compare
@bogdandrutu yup! that works 😄 or you can hit us up on gitter if thats easier |
@bogdandrutu the workflow actually ran faster (~10 mins) when loadtest didnt depend on the binaries from cross-compile as opposed to now when its running in ~20 mins. Should we revert the change to what it was before? |
408073b
to
03e6ccb
Compare
@AzfaarQureshi yes please revert :D |
removing sleep from common.sh removing windows-msi updating expectd ram usage removing caching moving loadtestpre into setup environment using underscore for setup-environment instead adding collector binaries and fixing setup-pre job
03e6ccb
to
7d3665c
Compare
Which problem is this solving?
As part of issue, this pull request migrates the loadtest, correctness and build-package jobs to GitHub Actions.
windows-msi
and the publish jobs will be migrated in PR 3/3Migration Plan
We suggest having CircleCI and GitHub Action jobs run in parallel for a few weeks. After the GitHub Actions jobs are running fine for a week or so and then remove the CircleCI workflows from config.yml
cc- @alolita, @shovnik