Introducing bob

Guillaume Quintard guillaume at varnish-software.com
Thu Apr 1 01:13:58 UTC 2021


Hi everyone,

Sometime ago I built and started to use a little tool that I'd like to
share with you, in the hope that it'll make your life easier too. This tool
is named "bob", and is available here:
https://github.com/varnish/toolbox/tree/master/bob

The short of it is that on compatible repositories, if you have bob and
docker installed, you can start building without worrying about
dependencies. For varnish, you can just go:

bob ./autogen.des
bob make
bob make check


And things should just work, the files are created by the container in your
work directory, with the right owner and permissions, but without you
having to install anything extra. And that allows you to code from your
host machine with the IDE of your choice, and to rely on bob only for the
compilation steps.

Internally, bob just:
- grabs a a Dockerfile in the .circleci/ directory and builds the
corresponding image
- creates a container user with the same UID/GID that is running on the host
- mounts your home as the container's home
- run a command
- destroy the container

The goal here is to provide a frictionless start to new users so they can
get cracking faster, but also to allow testing on other platforms. For
example, you can set the BOB_DIST env variable to run other containers:

BOB_DIST=ubuntu bob ./autogen.des
BOB_DIST=ubuntu bob make
BOB_DIST=ubuntu bob make check


This can prove very useful to test different environments (cf. new compiler
version issues)

If you want to recreate the image (which includes a "docker pull"), just
run it without arguments:

bob

If you need to get into the container to run a couple of commands:

bob bash


I've just pushed the necessary Dockerfiles to enable it on:
- https://github.com/varnishcache/varnish-cache (centos by default, and
BOB_DIST support for ubuntu, archlinux and alpine)
- https://github.com/varnish/varnish-modules (centos only)
- https://github.com/varnish/hitch/ (centos by default, and BOB_DIST
support for ubuntu, archlinux and alpine)

So those are ready to go, but the tool is meant to be generic and should
work with pretty much any repo as long as you create a Dockerfile for it in
bob/, .bob/, .circleci/ or .github.

Of course, this is completely optional, and if you don't care about it,
this should be completely invisible to you. However, if you do find it
useful, or PRs and bug trackers are open, I'm eager to get more feedback
about it.

Cheers!

-- 
Guillaume Quintard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20210331/fed29d38/attachment-0001.html>


More information about the varnish-misc mailing list