This page is intended for all sorts of random topics that are worth being recorded to allow further troubleshooting.
Table of Contents | ||
---|---|---|
|
Jenkins
Everything related to Jenkins
GitHub webhooks
GitHub webhooks allow to be notified of GitHub events instead of polling. This allows us to operate without running into rate limiting. The configuration in Jenkins has a few catches that can save you quite some time:
Create a webhook at https://github.com/ACCOUNT/REPOSITORY/settings/hooks/. You can use this configuration for reference:
You will have to create a secret manually. Note it down as it is required to be entered into Jenkins.
In Jenkins, navigate to the general "Configure System" page (like http://jenkins.mxnet-ci-dev.amazon-ml.com/configure). You might be tempted to navigate to "GitHub Pull Request Builder" which looks like this, but this is not the one we are looking for! The shared secret here is something different and might cost you a few hours to figure out!
Expand | ||
---|---|---|
| ||
Instead, navigate to the tab called "GitHub". It looks like follows:
Click on "Advanced..." and you will see the following:
On "Shared Secret", press "Add". A new window will open up. In the "Kind" dropdown, select "Secret text". Then input something like the following and insert the previously noted down secret:
Now go back to the GitHub webhook and press "Redeliver":
GitHub commit/PR status does not get published
In case the commit status is not being properly published, go to the Jenkins log and look for the following line:
[Set GitHub commit status (universal)] PENDING on repos [] (sha:xxxxxxx) with context:test/mycontext
Note that the repos-array is empty. This is because the GitHubCommitStatusSetter is not able to resolve repositories if they have not been configured within Jenkins. In order to fix this, go to
Manage Jenkins > Configure System > GitHub > GitHub Servers
and add the following config:
For credentials, make sure to use credentials that have permissions to add the commit status. At Apache, this would be committer credentials.
What you will want to see in the logs is the following:
[Set GitHub commit status (universal)] PENDING on repos [GHRepository@362b786c[description=Lightweight, Portable, Flexible Distributed/Mobile Deep Learning with Dynamic, Mutation-aware Dataflow Dep Scheduler; for Python, R, Julia, Scala, Go, Javascript and more,homepage=http://mxnet.io,name=incubator-mxnet,fork=true,size=40782,milestones={},language=C++,commits={},responseHeaderFields={null=[HTTP/1.1 200 OK], Access-Control-Allow-Origin=[*], Access-Control-Expose-Headers=[ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type], Cache-Control=[private, max-age=60, s-maxage=60], Content-Encoding=[gzip], Content-Security-Policy=[default-src 'none'], Content-Type=[application/json; charset=utf-8], Date=[Tue, 20 Nov 2018 13:36:45 GMT], ETag=[W/"417522734a6356ef821736c139646b34"], Last-Modified=[Tue, 20 Nov 2018 13:03:10 GMT], OkHttp-Received-Millis=[1542721005396], OkHttp-Response-Source=[NETWORK 200], OkHttp-Selected-Protocol=[http/1.1], OkHttp-Sent-Millis=[1542721005230], Referrer-Policy=[origin-when-cross-origin, strict-origin-when-cross-origin], Server=[GitHub.com], Status=[200 OK], Strict-Transport-Security=[max-age=31536000; includeSubdomains; preload], Transfer-Encoding=[chunked], Vary=[Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding], X-Accepted-OAuth-Scopes=[repo], X-Content-Type-Options=[nosniff], X-Frame-Options=[deny], X-GitHub-Media-Type=[github.v3; format=json], X-GitHub-Request-Id=[E560:56B6:12219B6:147A932:5BF40DED], X-OAuth-Scopes=[admin:repo_hook, repo, repo:status], X-RateLimit-Limit=[5000], X-RateLimit-Remaining=[4480], X-RateLimit-Reset=[1542722488], X-XSS-Protection=[1; mode=block]},url=https://api.github.com/repos/MXNetEdge/incubator-mxnet,id=123927478]] (sha:d731aa6) with context:ci/jenkins/test-marco-mxnet-sanity Setting commit status on GitHub for https://github.com/MXNetEdge/incubator-mxnet/commit/d731aa63a6fdfd502fc7aa63df1fa437f7b8407c