CI tools testing lab: Adding Gerrit

indexIn this post I’m going to describe how I quickly brought up Gerrit using Docker in a lab setup, and integrated it with Jenkins.

This post is the second in a series of posts describing how I’ve used Docker to build a lab setup on my laptop to try out Zuul and check out its various features.

Please see the previous post for an explanation of my goals, choice of tools and work done previously.

Since I’m focused on testing Zuul, I did not want to spend too much time setting up Gerrit. Instead I looked for a ready made container image that I could quickly bring up.

Continue reading

CI tools testing lab: Initial setup with Jenkins

226px-jenkins_logo-svg Gerrit, Jenkins and the Jenkins Gerrit Trigger Plugin make for a relatively easy way to setup an automated code review system. Using these components, you can have Jenkins run automates tests on code while it is being reviewed in Gerrit.

But as projects grow in complexity and amount of developers, some shortcomings of of this system become apparent as the reviewed code being tested in Jenkins stops reflecting the way it will actually look when merged into the main development branch. This is an issue we came across on oVirt’s CI system.

Looking for a solution, we found Zuul – a tool developed by the OpenStack community when they faced similar issues.

This post is a first in a series of posts describing how I’ve used Docker to build a lab setup on my laptop to try out Zuul and check out its various features.

Continue reading

D: A native-compiled programming language that has every conceivable feature

Didi programmingThe release of Google’s ‘Go’ language seems to have shaken the world of computer languages in general and native-compiled languages in particular. That world was exclusively dominated by C and C++, but now we’re seeing more and more new languages appear and gain programmer mind-share.

In recent years, it seems the progress of programming languages was happening mainly in the realms of interpreted languages and byte-code-compiled languages. Native-compiled languages looking to attract developers accustomed to the convenience of those languages must provide similarly convenient features. The D language is no exception for this rule, hence it provides the following features:

  • Type inference – So programmers don’t need to manually specify the type of each variable.
  • Automatic memory and resource management. D includes a garbage collector as well as a ‘scope’ statement that allows setting up code to always run when exiting the current scope (Looks and feels similar to the ‘trap’ statement of shell languages).
  • Built-in high-level data structures such as hashes and dynamic arrays.

Continue reading

My pet peeve with YAML

YAMLYAML is a popular data encoding language. Its data model is similar to JSON‘s data model where data is described in terms of strings, numbers, arrays and hash-maps. In fact, YAML is a super-set of JSON that includes indention-based syntax to make it easier for humans to read and write it.

YAML is very popular. Libraries for reading and writing it had been written for most, if not all, programming languages. It is used as the basis for the configuration DSL of many tools including Ansible, Puppet’s Hiera, and Jenkins Job Builder.

The use YAML as the basis for DSLs in which complex and extensive configuration is written by hand, eventually exposes one to the language’s shortcomings.

Continue reading

Cap’n Proto – An interesting data exchange format and RPC scheme

Cap'n ProtoCap’n proto is a Remote Procedure Call (RPC) library designed by the author of Google’s Protocol Buffers.

The author set upon improving Protocol Buffers by defining the data exchange format used by Cap’n Proto in such a way that the same format can be used to store the data in memory or disk. This enables software to be written in such a way that it avoids the costly step of encoding the data before sending it over the network. This capability had been successfully used to optimize Debian’s code search.

Cap’n proto has another interesting feature where it can transparently use information about the remote API being invoked, to collect successive calls together in a single network packet, thereby reducing network round-trip times.

Rust: a compiled programming language with an interesting memory model

The Rust logoRust is a programming language that compiles into native machine code. Despite being a static-typed, compiled language, Rust contains many features typically found in interpreted, dynamic-typed languages such as:

  • Closures
  • Type inference (E.g. no need to specify type for everything)
  • Multi-variable assignment syntax
  • For loops that run over collections (typically called ‘for-each’ in other lnaguages)
  • ‘If’ treated as an expression rather then a statement
  • A classless object system that allows one to use object-oriented syntax without having to maintain complex class hierarchies (Ruby`s ‘open classes’ without classes)
  • A build tool that can resolve module hierarchies without resorting to things like C`s ‘#include’
  • Generics and Traits that would let you do most things you would otherwise use ‘duck typing’ or class inheritance based polymorphism to do
  • Macros that let you create mini-DSLs

Continue reading