Coping with Big CI
Join the DZone community and get the full member experience.Join For Free
big ci and build monkeys
big ci means large-scale build and continuous integration systems. we’re talking about maybe 100+ bits of software being built, and doing c.i. properly. in big ci there’s usually a dedicated build team, which in itself raises a few issues which are covered a bit later. the general formula for getting to big ci, as far as build engineers (henceforth termed “build monkeys”) are concerned goes as follows:
build monkey + projects = build monkeys
build monkeys + projects + projects = build monkey society
build monkey society + projects = über build monkey
über build monkey + build monkey society + projects = big ci
what are the issues with big ci?
big ci isn’t without its problems, and tom presented a number of anti-patterns which he has witnessed in practice. i’ve listed most of them and added my own thoughts where necessary:
anti-pattern: slavish standardisation
as build monkeys we all strive for a decent degree of standardisation – it makes our working lives so much easier! the fewer systems, technologies and languages we have to support the easier, it’s like macro configuration management in a way – the less variation the better. however, tom highlighted that mass standardisation is the work of the devil, and by the devil of course, i mean mcdonald’s.
mcdonald’s vs jamie oliver
jamie oliver might me a smug mockney git who loves the sound of his own voice but he does know how to make tasty food, apparently (i don’t know, he’s never cooked for me before). mcdonald’s make incredibly tasty food if you’re a teenager or unemployed, but beyond that, they’re pretty lame. however, they do have consistency on their side. go into a mcdonald’s in london and have a cheeseburger – it’s likeley to taste exactly the same as a cheeseburger from a mcdonald’s in moscow (i.e. bland and rubbery, and nothing like in the pictures either). this is thanks to mass standardisation.
jamie oliver, or so tom duckering says (i’m staying well out of this) is less consistent. his meals may be of a higher standard, but they’re likely to be slightly different each time. let’s just say that jamie oliver’s dishes are more “unique”.
anyway, back to the continuous integration stuff! in big ci, you can be tempted by mass standardisation, but all you’ll achieve is mediocrity. with less flexibility you’re preventing project teams from achieving their potential, by stifling their creativity and individuality. so, as tom says, when we look at our c.i. system we have to ask ourselves “are we making burgers?”
are we making burgers?
- t. duckering, 2011
anti-pattern: the team who knew too much
there is a phenomenon in the natural world known as “build monkey affinity”, in which build engineers tend to congregate and work together, rather than integrate with the rest of society. fascinating stuff. the trouble is, this usually leads the build monkeys to assume all the responsibilities of the ci system, because their lack of integration with the rest of the known world makes them isolated, cold and bitter (ok, i’m going overboard here). anyway, the point is this, if the build team don’t work with the project team, and every build task has to go through the build team, there will be a disconnect, possibly bottlenecks and a general lack of agility. responsibility for build related activities should be devolved to the project teams as much as possible, so that bottlenecks and disconnects don’t arise. it also stops all the build knowledge from staying in one place.
anti-pattern: big ball of ci mud
this is where you have a load of complexity in your build system, loads of obscure build scripts, multitudes of properties files, and all sorts of nonsense, all just to get a build working. it tends to happen when you over engineer your build solution because you’re compensating for a project that’s not in a fit state. i’ve worked in places where there are projects that have no regard for configuration management, project structures in source control that don’t match what they need to look like to do a build, and projects where the team have no idea what the deployed artifact should look like – so they just check all their individual work into source control and leave it for the build system to sort the whole mess out. obviously, in these situations, you’re going to end up with some sort of crazy heath robinson build system which is bordering on artificial intelligence in its complexity. this is a big ball of ci mud.
anti-pattern: “they” broke my build…
this is a situation that often arises when you have upstream and downstream dependencies. let’s say your build depends on library x. someone in another team makes a change to library x and now your build fails. this seriously blows. it happens most often when you are forced to accept the latest changes from an upstream build. this is called a “push” method. an alternative is to use the “pull” method, which is where you choose whether or not you want to accept a new release from an upstream build – i.e. you can choose to stick with the existing version that you know works with your project.
the truth is, neither system is perfect, but what would be nice is if the build system had the flexibility to be either push or pull.
fear not, for tom has come up with some thoroughly decent solutions to some of these anti-patterns!
project teams should own their builds
don’t have a separated build team – devolve the build responsibilities to the project team, share the knowledge and share the problems! basically just buy into the whole agile idea of getting the expertise within the project team.
project teams should involve the infrastructure team as early as possible in the project, and again, infrastructure responsibilities should be devolved to the project team as much as possible.
have ci experts
have a small number of ci experts, then use them wisely! have a program of pairing or secondment. pair the experts with the developers, or have a rotational system of secondment where a developer or two are seconded into the build team for a couple of months. meanwhile, the ci experts should be encouraged to go out and get a thoroughly rounded idea of current ci practices by getting involved in the wider ci community and attending meetups… like this one!
personal best metrics
the trouble with targets, metrics and goals is that they can create an environment where it’s hard to take risks, for fear of missing your target. and without risks there’s less reward. innovations come from taking the odd risk and not being afraid to try something different.
it’s also almost impossible to come up with “proper” metrics for ci. there are no standard rules, builds can’t all be under 10 minutes, projects are simply too diverse and different. so if you need to have metrics and targets, make them pertinent, or personal for each project.
treat your build environments like they are production
don’t hand crank your build environments. sorry, i should have started with “you wouldn’t hand crank your production environments would you??” but of course, i know the answer to that isn’t always “no”. but let’s just take it as read that if you have a large production estate, to do anything other than automate the provision of new infrastructure would be very bad indeed. tom suggests using the likes of puppet and chef , and here at caplin we’re using vmware which works pretty well for us. the point is, extend this same degree of infrastructure automation to your build and ci environments as well, make it easy to create new ci servers. and automate the configuration management while you’re at it!
provide a toolbox, not a rigid framework
flexibility is the name of the game here. the project teams have far more flexibility if you, as a build team, are able to offer a selection of technologies, processes and tricks, to help them create their own build system, rather than force a rigid framework on them which may not be ideal for each project. wouldn’t it be nice, from a build team perspective, if you could allow the project teams to pick and choose whichever build language they wanted, without worrying that it’ll cause a nightmare for you? it would be great if you could support builds written in maven, ant, gradle and msbuild without any problems. this is where a toolkit comes in. if you can provide a certain level of flexibility and make your system build-language agnostic, and devolve the ownership of the scripts to the project team, then things will get done much quicker.
it would be nice if we could somehow give upstream builds a “contract”, like a test api layer or something. something that they must conform to, or make sure they don’t break, before they expose their build to your project. this is a sort of push/pull compromise.
and that pretty much covers it for the content of tom’s talk. it was really well delivered, with good audience participation and the content was thought-provoking. i may have paraphrased him on the whole jamie oliver thing, but never mind that.
it was really interesting to hear someone so experienced in build management actually promote flexibility rather than standardisation. it’s been my experience that until recently the general mantra has been “standardise and conform!”. but the truth is that standardisation can very easily lead to inflexibility, and the cost is that projects take longer to get out of the door because we spend so much time compromising and conforming to a rigid process or framework.
chatting to christian blunden a couple of
months back about developer anarchy was about the first time i really
thought that such a high degree of flexibility could actually be a good
thing. it’s really not easy to get to a place where you can support such
flexibility, it requires a lot of collaboration with the rest of the
dev team, and i really believe that secondment and pairing is a great
way to achieve that. fortunately, that’s something we do quite well at
caplin, which is pretty lucky because we’re up to 6 build languages and 4
different c.i. systems already!
Opinions expressed by DZone contributors are their own.