Refactoring a function name across several patches with git rebase

git rebase is one of my favorite git commands. It allows to update a set of local patches against another git branch and also to rework, trough the -i flag some previous patches. The problem I had to deal with was quite simple, rename a function called notProperPythonCode to proper_python that was defined in the first patch and be sure that all other patches are using the correct name. The –exec flag allows to run a custom script after each patch is applied, so that I could run sed to process the Python files and replace the old function name with the new one. The process is quite simple, except that such changes would trigger a lot of merge conflicts, trivial to solve but quite annoying. Fortunately git rebase allows to choose what merge strategy must be adopted for solving conflicts, the theirs strategy in case of a conflict, will take the previous version of the patch and silently use it. That is fine for this simple substitution case, where we process each file ending by *.py in the repository. ...

22 April 2016 · Giuseppe Scrivano

System containers for Atomic

The main reason behind system containers was the inability to run Flannel in a Docker container as Flannel is required by Docker itself. CoreOS solved this chicken and egg problem by using another instance of Docker (called early-docker) that is used to setup only Etcd and Flannel. Differently, Atomic system containers will be managed by runc and systemd. The container images, even though being served through the Docker v2 registry, are slighty different than a regular Docker container in order to be used by Atomic. The installer expects that some files are present in the container rootfs under /exports, the OCI spec file for running the Runc container and the unit file for Systemd. Both these files are templates and some values are replaced by the installer. The communication with the Docker registry is done through Skopeo, that is used internally by the atomic cli tool. ...

24 March 2016 · Giuseppe Scrivano

ostree-docker-builder

rpm-ostree, used together with OStree, is a powerful tool to generate immutable images for .rpm based systems, why not to use it for generating Docker images as well? rpm-ostree already supports the generation of a Docker container tree, that can be feed to Docker almost as it is; ostree-docker-builder instead is a new tool to make this task simpler. The following JSON description is enough to create an Emacs container using rpm-ostree based on Fedora-22. ...

30 September 2015 · Giuseppe Scrivano

Summer of Code 2015 for wget

coming as a surprise, this year we have got 4 students to work full-time during the summer on wget. More than all the students who have ever worked for wget before during a Summer of Code! The accepted projects cover different areas: security, testing, new protocols and some speed-up optimizations. Our hope is that we will be able to use the new pieces as soon as possible, this is why we ask students to keep their code always rebased on top of the current wget development version. ...

30 April 2015 · Giuseppe Scrivano

Create a QCOW2 image for Fedora 22 Atomic

This tutorial shows how to create a QCOW2 image that can directly imported via virt-install to test out Fedora 22 Atomic starting from a custom OStree repo. To create the image, we are going to use both rpm-ostree and rpm-ostree-toolbox. Ensure they are installed as well as Docker, libvirtd and Vagrant-libvirt. The first phase consists in generating the OStree repo that is going to be used by the image. We can use directly the files from the fedora-atomic project as: ...

20 April 2015 · Giuseppe Scrivano

How to deploy a WordPress Docker container using docker-compose

These are the steps to setup the current website in a Docker container: 1 2 3 4 wget -O- https://github.com/docker/compose/releases/download/1.2.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose mkdir wordpress cd wordpress 1 2 3 4 5 6 7 8 9 10 db: image: mysql:5.5 environment: MYSQL_ROOT_PASSWORD: "A VERY STRONG PASSWORD" web: image: wordpress:latest ports: - "80:80" links: - db:mysql 1 /usr/local/bin/docker-compose up

19 April 2015 · Giuseppe Scrivano