Jenkins X

September 19th, 2018

Having started to get some rhythm back in to the publishing of my personal blog posts, I thought it was about time that I started posting some technical content again too. I’m having to do lots of new learning at the moment and, if nothing else, writing about it makes sure that I’ve understood it and helps me remember at least some of what I’ve learnt. As before, these posts in no way indicate the position of my employer nor, in general, should you read in to them anything about technical direction. On the whole, they are just about topics that I’ve found sufficiently interesting to write a little about. There is, I have found, no knowing what will be of interest to other people (my all-time top post relates to Remote Desktop!). From an entirely selfish perspective, I don’t care if anyone reads what I write as it’s largely the writing that gives me value!

Having said all the above, the subject of this post is Jenkins X which is very much in the domain of my new employer! When it was announced back in March, I have to admit that I was somewhat sceptical. It was clearly aiming at much the same space that we were with the dev-ops part of Microclimate. My view wasn’t helped by the fact that I couldn’t actually get it to run. It did (and still does) run best out on public cloud but I used up my free quotas on AWS and GCP a long time ago. I tried to run it on minikube and failed. It was also developed by the team behind Fabric8 which, although it showed lots of promise, was never incorporated in to any of RedHat’s commercial offerings. The same was not set to be true of Jenkins X and, six months later, my new employer has just announced that it now forms part of the CloudBees Core offering under the name of Kube CD. I’ll save details of that commercial offering for another post and restrict myself to talking about the open source Jenkins X project here.

So what exactly is Jenkins X? It enables Continuous Integration and Continuous Deployment, of applications on Kubernetes. It happens to use Jenkins as the engine to perform those actions but, at least at a first pass, that is immaterial. Around that Jenkins is wrapped lots of Kubernetes-native goodness and, most importantly, a CLI by the name of jx. Thankfully this time around the minikube experience worked for me just fine and getting up and running was as simple as:

I have to say that I’m not a big fan of ‘verb followed by noun’ when it comes to CLI arguments as, although perhaps more readable, it makes end-user discovery harder (jx create tells me about a whole long list of largely unrelated things) but thankfully just typing jx gives a reasonable overview of the main options. Beware though that the CLI is heavily overloaded: it’s not only used for initialisation, but also subsequent actions performed by the developer, and those performed by the pipeline.

Perhaps the quickest way to demonstrate the capabilities is to then use a quick start:

This allows you to select a technology stack (everything from Android to Vert.X via Rust, Rails and React!) which lays down a skeleton application on disk. It then uses Draft to add a Dockerfile and Helm chart(s). It doesn’t stop there though. It will then help you create a repo on GitHub, check your code in, set up a multi-branch pipeline on the Jenkins instance it provisioned, and set up the web hook to trigger Jenkins on subsequent updates. (Webhooks don’t tend to work too well unless your minikube is internet facing but, given a bit more time, polling does the job eventually.) The default pipeline (defined by a Jenkinsfile in your application repository) uses Skaffold to build the application Docker image and push to a registry. The Helm chart is published to the provided instance of ChartMuseum.

Jenkins X follows the GitOps model promulgated by Alexis Richardson and the team at Weaveworks. By default, it sets up two GitHub repositories that map to staging and production namespaces in the Kubernetes cluster. Additional environments can easily be defined via, you guessed it, jx create environment. These repositories make good use of ‘umbrella’ Helm charts to deploy specific versions of each of the application charts. By default, the master branch is automatically deployed to the staging environment but promotion to production is performed manually, for example:

There is also the concept of a preview environment. Typically created for reviewing a pull request, they can also be created manually via the CLI. These allow a specific version of the application to be accessed in a temporary namespace created just for that purpose. All of the Jenkins X configuration (environments, releases, …) are represented in the Kubernetes way: as Custom Resource Definitions.

There’s plenty more to say about Jenkins X but I’ll save that for another post on another day. Hopefully this has given you enough of a flavour to encourage you to download the CLI and give it a try for yourself.

Heathcote Mausoleum

September 16th, 2018

Despite having blogged about it here a week ago, I still failed miserably to sign up for any of the Heritage Open Day activities this weekend. We returned to Hursley this afternoon though for one that didn’t require booking. It’s a building that I’ve passed numerous times, generally en-route from work to the Dolphin pub in the village! It stands in the grounds of the church and is the mausoleum constructed by the Heathcote family (who built the main body of the current Hursley House) over 200 years ago.

The details indicated that it had space for 35 coffins on either side. Somehow, I had assumed that this meant it descended underground. It hadn’t occurred to me that they’d just be stacked five stories high! The plaque on the outside shown here indicates that Samuel Heathcote is buried instead in the churchyard, going to the lengths of being buried 12ft deep to ensure that no-one tried to exhume him to move him to the family mausoleum! He wasn’t the only one to prefer the ‘open air’ with eleven other members of the family being buried outside. The last ‘deposit’ in the mausoleum was in 1925 but there’s still plenty of space for more…

Hursley 10k

September 16th, 2018

It was Christine’s turn to run the Hursley 10k this year so the rest of us went along to spectate (Emma is always keen when there’s prospect of a cake stall!). There was lots of Eastleigh Running Club orange out for us to cheer on. As you’d expect given the location, there were also a few IBMers although, looking at the results, I also failed to spot many I should have seen.

On Christine’s return, I raced off for a quick run (a chance to knock out the September Challenge). It took longer than I anticipated but I made it back just in time to see Duncan cross the line in the KS2 race. He seemed pleased with his run. It’s just a shame that it’s another four years before Emma is allowed to take part in any of the races again.

More photos on Flickr.

Bursledon Bricks and Mill

September 9th, 2018

As part of this year’s Heritage Open Days we went along to Bursledon Brickworks (actually on the Swanwick side of the river for the pedants). We started with a ride on the narrow gauge railway although the particular specimen on show today wasn’t anything to write home about. We then went in search of one of the ‘heritage’ buses that was meant to be running to the windmill. There were several buses parked up in the courtyard but none moving and when I was asked whether I was ‘interested in buses’ we retreated to the brickworks itself.

The museum itself is quite well done, at least in parts (it has had significant lottery money spent on it). The site was still operational until the early seventies when it was cleaved in two by the M27. The steam workings are still operational although not making bricks (and the steam was being generated by a very modern looking boiler). Following on from my earlier rant, the children were given a quiz that required them to actually read the signs AND we didn’t have to pay for a pencil (I’m looking at you English Heritage!). The prize was a few old pennies to spend in the arcade which they enjoye. There was also an interesting display on the brickworks’ predecessor in Chandler’s Ford.

We tried to get on the one o’clock bus to Bursledon Windmill but it was already full. This gave the children a chance to make clay bricks by hand though. They brought them home although they’ll take 2-3 weeks to fully dry out. After a spot of lunch we made it on the two o’clock bus (just) but when we arrived at the windmill we were told that the tours were full for the rest of the day. We took a quick look round outside and then got another bus back to the car. We’ll have to decide whether to return another weekend to (pay and) see inside.

All in all, it was a reasonable way to spend a few hours and, given both sites are staffed by volunteers, one shouldn’t grumble too much about the lack of organisation. If you’re at a loose end next weekend then there are lots more attractions open across the UK and, if you’re local, particularly in the Winchester area.

Double Celebration Weekend

September 2nd, 2018

This weekend we were signed up for a double-header of orienteering. On Saturday it was the British Sprint Champs at Bath University. We were there early as Christine’s parents were running the local parkrun and returning the children to us beforehand. The first-class sports facilities at the University made an excellent assembly area for the event. We had mixed fortunes in the heats. Christine and I made it through to the A finals but both the children were disqualified for wrong controls (it was a tricky area to plan easy courses on). Christine was fourth in her final and Duncan managed a first in his B final. I faired less well making one bad route choice through the multi-level section and losing my head completely on a later leg.

We spent the night in Glastonbury and had a nice dinner out at Tamburino’s in Street. On Sunday it was the Middle Distance Champs at Stock Hill near Wells. Despite a panic whilst we tried to find where Duncan’s SI card had ended up (down the back of his car seat!) we arrived in plenty of time for Christine’s start. Duncan had a good run on M10, finishing 7th. Emma was 8th on W12 although in a smaller field. She made a 10 minute error on one control though on what looked like a tricky orange course. I also managed 8th place despite making several blunders – not surprising given that I wasn’t really reading any of the contour detail on the map!

Christine had the start performance: a place on the podium and a silver medal. And the double celebration? It was also our wedding anniversary!

(Sprint photos courtesy of Gerry Ashton.)

Not so sunny Severn Half

August 29th, 2018

On Sunday both Christine and I lined up at the start of the Severn Bridge Half Marathon in the pouring rain. We had free entries as a consequence of Christine’s parents helping and neither of us had done anything in the way of preparation. In my case, I’d also had some stomach bug for the proceeding three days. As a consequence, I really had no idea how I’d do, or even whether I’d finish.

The race starts at the Welsh end of the bridge, heads over to England where it does a loop in the country lanes before returning back over the bridge. I felt okay at the start and my pace was forced a little by a feeling that I should be ahead of the guy pushing the running buggy (although he was aiming for under 90 mins). I fell in behind a runner from the local club who, it seemed, was aiming for negative splits as the pace picked up when we passed through the halfway point.

That said, when we arrived at the bridge again, I was still feeling pretty good and left him behind as I realised that I might just be able to make it back in under 1:25. As the results show, clock time was 1:24:54 with three seconds less on the chip. Not a PB by any means but still much better than I was expecting when I set off. Christine was also pleased with her time having come in well under 1:45. Comparing with her medal from last year, someone appears to have added a sun above the bridge this year – something we certainly didn’t see all day! The children seemed to have enjoyed their time on banana duty though despite getting soaked through their waterproofs!

Back to Blighty

August 22nd, 2018

Despite our elongated stay in the Alps, we still had one more night in France, allowing us to break up the drive back. I’d randomly picked some place off Booking.com for its proximity to the A6. The quoted distance must have been as the crow flies though because it was quite some trek along scenic rural lanes before we arrived in L’Isle sur Serein. I’m not convinced that the hotel had seen our booking before we tried to check-in but we were shown to a very nice two-floor apartment across the road. The restaurant was not serving so, rather than go in search of civilization, we utilized the pizza van parked in the town square, watched by the proprietors of the hotel, sat outside drinking with their friends. All a bit surreal but there was a nice breakfast provided the next morning.

The final leg of the journey we broke with a stop in Versaille. Christine and I had been before but many years ago. I have to say that I was somewhat disappointed by the palace grounds. Only three of the fountains were in operation leaving not much but some tall hedges and dubious sculptures. Perhaps this was due to the dry summer but no explanation was offered. As it was a Friday, we had to pay an extra €7 each for the privilege of the ‘musical gardens’. This appeared to consist solely of classical music being piped out of speakers hidden in the occasional bush.

The ticket price does cover a lot more though and, in the end, it was a bit of a race back to Le Havre (followed by a long queue at passport control). The return overnight channel crossing was equally uneventful and we arrived back in Blighty tired but in plenty of time for Emma to make her Saturday morning swimming lesson!

A week in the Alps

August 21st, 2018

We arrived at our final destination, Camping des Dômes de Miage on the outskirts of Saint-Gervais-les-Bains, just in time to put up the tent before the rain arrived. Conveniently, we were very close to where Christine’s cousin and her family had their campervan (perhaps not a complete coincidence as we appeared to be in something of a British aisle).

The forecast wasn’t great for our first day. We set off up the hillside behind the campsite all the same but retreated after having lunch sheltered under a pine tree from the rain watched by a bull! After a night of heavy rain, things were looking up the next day and we all took the cable car up to Mont d’Arbois. From there, we ascended Mont Joly (2525m). The cloud even parted briefly at the summit so that we could catch a glimpse of Mont Blanc across the valley. It was a long trudge back down the hill to the campsite and we vowed to buy a return next time!

The next day we headed to La Gruvaz on the other side of the valley and walked up to Refuge de Miage. The refuge itself was packed inside and out with people enjoying their Saturday lunchtime. Christine went for a walk further up what is a lovely Alpine valley while I watched the children fail to divert the course of the river! Duncan and Christine took a detour on the return leg to take in Mont Truc (1811m). We had a dip in the swimming lake at Les Contamines before returning to the tent.

We attacked the plateau from the other side on Sunday by driving round to Les Houches and getting the cable car up to Le Prarion from where it was a short walk to the summit (1969m). This offered a stunning 360° panorama of the Mont Blanc Massif (which I singularly failed to capture on camera despite multiple attempts).

We took a slightly circuitous route down to Col de Voza where the Tramway du Mont Blanc passes through as does the Tour du Mont Blanc.  The latter was of particular interest as it is only a couple of weeks until the UTMB kicks off. The valley was full of advertising and there were even a few fit looking types starting to appear on the campsite. As promised earlier in the week, this time we took the cable car back down from Bellevue.

The rain had returned on Monday and we just hung around the valley. Christine took the children to St Gervais’ shiny new swimming pool whilst I went for a long run. It was meant to be wet again the following day but actually turned out fine. We drove up to Notre Dame de la Gorge and then went for a short walk to see some of the falls.

That evening’s entertainment was provided by me locking the keys in the car whilst trying to improvise a washing line at the campsite. Thankfully their retrieval was covered by our European breakdown cover and we only had to wait an hour or so for someone to come out. The key was sat on the parcel shelf so, having air-bagged the door ajar, he set about fishing for it with a long piece of wire – no mean feat given the key didn’t even have a ring on it. Have successfully retrieved it, that just left the rather brutal task of bending the car door back into shape!

We made a last-minute decision to extend our stay by one more night. We took the cable car again, this time from La Gorge and on up to Signal. From there it is a short walk to Col du Joly. Whatever sense of remoteness you may have still been left with after leaving all the ski/MTB paraphernalia behind was entirely wiped away by the car park at the top (there is a tarmac road up from the other side of the ridge). The children got a chance to spend some money in the tat shops on our way back through Les Contamines and it meant we could put off packing up the tent for one more day…