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

Short-term CI infra plans (discussion) #19

Closed
1 of 8 tasks
rvagg opened this issue Dec 3, 2014 · 21 comments
Closed
1 of 8 tasks

Short-term CI infra plans (discussion) #19

rvagg opened this issue Dec 3, 2014 · 21 comments

Comments

@rvagg
Copy link
Member

rvagg commented Dec 3, 2014

The current state of the build infrastructure can be seen here: http://jenkins.node-forward.nodesource.com/

Summary:

  • We have automatic builds for both io.js and libuv
  • "multi" builds target the initial cluster we have been building:
    • Ubuntu 10.04, 12.04, 14.04 (and 14.04 32-bit)
    • CentOS 6, CentOS 7 (RHEL 6 & 7 by proxy)
    • Windows Server 2012 with Visual Studio 2013
    • Ubuntu 14.04-based ARMv7
  • "containers" is a cluster of the 3 LTS Ubuntu version run in Docker containers, see build-containers for how they work, these are intended to be run against all new incoming pull requests from untrusted sources (mostly everyone except TC)

Currently we also have the ability to trigger builds on either the full "multi" or "containers" from any repo on GitHub but they must be triggered manually by someone who has access to Jenkins. So far that's only myself, @ryanstevens and @indutny but I can expand that list to the full TC and other trusted helpers.

Short-term goals

  • Hook up to the GitHub status API so we can run "containers" builds for every PR and report the status back to the repo inline
  • Hook up "multi" builds for a "trusted" list, initially comprised of the TC
  • Make it easier for TC (et. al.) to request arbitrary pull requests be run against "multi" prior to merge (I'm actually thinking that a bot putting a message in a PR with a link that works for TC members would be good enough here for now).

Pre-first-release goals

Mid-term goals

Miscellaneous goals

  • Bootstrap a performance-focused team by setting up a basic platform for a nightly (or other regular) run of a performance suite (to be developed) so report back gut-feel numbers at a minimum, arewefastyet-style. I don't see this as a long term responsibility of the build team and it should be a separate team focused on performance and obsessed with how best to measure and report performance over time; we just need to bootstrap it because we're the infra team and the hardware and tooling connects logically with what we're doing. I'm proposing @brycebaril as initial lead for this team. Needs further discussion from TC but I know they need something better than the ad-hoc micro-benchmarking efforts that go on now.

Beyond that, we want to fully make our own CI tooling and deprecate Jenkins, but that's a lower priority than just moving io.js forward.

@rmg
Copy link

rmg commented Dec 3, 2014

+1 on using a bot if the goal is to replace Jenkins rather than get attached to it.

What's the plan for the GH status updates? Jenkins doesn't seem to expose enough parameters to get multiple statuses to work in a useful way, and all the github modules on npmjs.org are missing useful things like using numeric repo ids (who renames or moves repos these days anyway, right?), so I've found Ruby to generally be the most productive way to use GitHub's API.

@rvagg
Copy link
Member Author

rvagg commented Dec 3, 2014

@rmg I have a collection of packages in npm already for doing stuff with github, I'm not so concerned with that part, it's Jenkins that's the headache because it's API is kind of sloppy. Already I have a webhook to a test server collecting data with github-webhook and I've been playing with some of the Jenkins libraries in npm but they all inherit Jenkin's crappy API problems but since it's fairly simple JSON it might be more productive to roll our own focused on just what we need.

The flow looks will look like this, and this is purely for iojs/io.js at the moment:

  1. Node.js webhook server receiving pull request events and deciding how to handle them ("containers" for everyone, "multi" for trusted group, or perhaps no action because ...?)
  2. Webhook server tells GitHub that the status of the PR is "pending"
  3. Webhook server tells Jenkins to start a build for the appropriate job. The tricky bit here is capturing the build ID and attaching that to the PR ID, some awkward polling of Jenkins will have to play in to this.
  4. Webhook server polls Jenkins for the job/build until there is a success or failure
  5. Webhook server posts a status update to GitHub of either "success" or "failure" and links to the Jenkins build.

Additional step in there is to post a comment to the PR with a link that the TC can use (authenticated against GitHub) to trigger a "multi" build when only a "containers" build has been done. For joyent/node there is a Chrome plugin that gives them the ability to do this I believe but I'd rather not have to go that route.

Currently I have these libs for working with GitHub:

And I'm always looking for an excuse to expand the functionality and add more libs!

@rvagg
Copy link
Member Author

rvagg commented Dec 3, 2014

btw, the webhook server is very early at the moment but I'll open a repo here with the code as soon as I can so others can contribute!

@rmg
Copy link

rmg commented Dec 3, 2014

The github/janky docs mention a notifications plugin for Jenkins. I imagine it could post to the webhook server. Or worst case, add a curl one liner to the Jenkins jobs themselves to post their $BUILD_NUMBER to a PR specific URL given as a build parameter by the webhook server when it triggers the job.

@rvagg
Copy link
Member Author

rvagg commented Dec 3, 2014

Check this out: https://jenkins-node-forward.nodesource.com/job/iojs+any-pr+containers/3/api/json
Given a job id "iojs+any-pr+containers" and a build number 3 I can get that info, which thankfully contains the parameters I submitted when I triggered the build:

  "parameters": [
    {
      "name": "user",
      "value": "rvagg"
    },
    {
      "name": "project",
      "value": "io.js"
    },
    {
      "name": "branch",
      "value": "v0.12"
    }
  ]

Additionally I could add a "pr" parameter that's just informational for this purpose so it's even easier to cross reference. The frustrating bit is that when you ask to create a build you don't get an ID straight back (as far as I can tell so far), without that piece of the puzzle we need to do some polling and cataloging of what Jenkins is doing so we can link everything together.

@rmg
Copy link

rmg commented Dec 3, 2014

What I meant is create some id (UUID? git sha1?) before the build is submitted and include it as a build parameter. Then have Jenkins call you back, using that provided id (possibly something as lame as curl -X POST -d bid=$REQID http://iojs-webhook-server/ as the first build step), to tell you what build number Jenkins has assigned to that request.

@rvagg
Copy link
Member Author

rvagg commented Dec 3, 2014

@rmg yes, except the list of hosts is quite diverse, the UUID would be public via the Jenkins API and web site and therefore filtering post-backs from build slaves would be a major security hassle, I think I'd rather poll than have to deal with this!

@rmg
Copy link

rmg commented Dec 4, 2014

@rvagg understood. I hadn't considered which parts would be public and which parts would not.

@JohnMorales
Copy link

@rvagg I'm interested in contributing to this, when do you think you'll be ready for contributors/help? I tried the gitter room, but it seems to be dead/in-accessible.

@ghostbar
Copy link

ghostbar commented Dec 7, 2014

For PR and builds on Jenkins this plugin should do the trick AFAIK.

@rvagg
Copy link
Member Author

rvagg commented Dec 8, 2014

I'm aiming on not investing too much in Jenkins and opt for building our own tooling. Within the next week or so I should be able to make a new repo here with the beginnings of a tool that does what we need and we can all contribute to awesomeifying it.

@ghostbar
Copy link

ghostbar commented Dec 8, 2014

Awesome, because I would hate to install java on my machine only for testing jenkins stuff out. :D

@retrohacker
Copy link

So I'm thinking we might want to do docker webhooks as well, so we keep the docker containers on the Jenkins server in sync with the docker registry (and in turn with the build-containers repo).

Thoughts? If worth while, I can take a stab at this.

@rvagg
Copy link
Member Author

rvagg commented Dec 10, 2014

@wblankenship intriguing, how would this work? Can we just ping the local webhook to make sure it has the latest image from hub?

@retrohacker
Copy link

Simply point https://registry.hub.docker.com/u/iojs/build/settings/webhooks/ to the server and trigger a docker pull iojs/build when the endpoint is hit. (note: url only works if you have admin on iojs/build)

@rvagg
Copy link
Member Author

rvagg commented Dec 10, 2014

neat, we'll need to do this from >1 server

@retrohacker
Copy link

Certainly doable. Want me to open a ticket for this and self assign?

@rvagg
Copy link
Member Author

rvagg commented Dec 10, 2014

yes pls

@bnoordhuis
Copy link
Member

@rvagg Are there still actionable items left?

@rvagg
Copy link
Member Author

rvagg commented Mar 18, 2015

yeah, plenty of actionable items that are not properly documented elsewhere, should probably leave this open for now

@jbergstroem
Copy link
Member

Almost a year! I think we've covered most things on this list, with a gap in containers/auto-testing. At the same time I think our strategy in that department has changed. Inclined to close.

@rvagg rvagg closed this as completed Nov 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants