DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
Objective
Facilitate tracking of unit-tests on CloudWatch CI/CD dashboard
Current State
Currently, there's no dashboard that tracks `nosetests` or similar runs. As of now, everytime the CI pipeline is triggered and wherever the artifacts are generated (nosetest_unittest.xml, nosetest_train,xml, etc). However, that's that.
Proposal
Unit test tracking can be achieved in 2 stages:
- Upload unittest artifacts on S3
- Pulling S3 artifacts into Cloudwatch via Lambda
- Creating dashboard in Cloudwatch
Stage 1:
Unittest-specfiic timing information is stored in job-name-xml files using the `archiveArtifact` utility (provided by Jenkins Job DSL plugin https://jenkinsci.github.io/job-dsl-plugin/)
Uploading artifacts to S3 is provided by Pipeline:AWS Steps plugin (https://github.com/jenkinsci/pipeline-aws-plugin)
Steps followed:
- Add Pipeline:AWS Steps plugin to Jenkins CI prod account
- Create bucket on S3 CI prod account
- Handling permissions
- Create a write policy specific for this bucket
Currently, we only want to write to this specific bucket. To make it secure, only "PutObject" permission is given to this specific bucket (via ARN) - Attach the policy to bucket
- Attach the policy to IAM Role (jenkins-slave)
- Create a write policy specific for this bucket
- Set Global property on Jenkins console
Jenkins → Manage Jenkins → Configure System → Global Properties (helps setup global environment variables visible in every job)
ENV Variable : Bucket name
MXNET_CI_UNITTEST_ARTIFACT_BUCKET : <bucket-name>
- Call S3 upload with required parameters
- Functions:
- ci/Jenkinsfile_utils.groovy → collect_test_results_unix()
- ci/Jenkinsfile_utils.groovy → collect_test_results_windows()
- PR : https://github.com/apache/incubator-mxnet/pull/16336
- Functions:
Q. Why upload to S3 instead of directly putting in CloudWatch?
A. Jenkins Master/Slave are already burdened by the load of running CI pipelines for branches & PRs. Moreover, data storage of unit-tests on S3 allows permanence. Offloading data to S3 resolves both storage and load problems.
Q. What happens to S3 upload if jobs fails?
A. Way CI handles job failures is - jenkins master retriggers the job on Jenkins slave