<<

Reproducible Deployment with GNU Guix

Ludovic Courtes`

Inria Rennes Bretagne Atlantique, November 2015 The difficulty of keeping software environments under control. #1. Upgrades are hard.

#2. Stateful system management is intractable. $DISTRO $DISTRO $DISTRO $DISTRO

apt-get update apt-get update

state 1a state 1b $DISTRO $DISTRO

apt-get update apt-get update

state 1a state 1b

apt-get install foo apt-get remove bar

state 2a state 2b $DISTRO $DISTRO

apt-get update apt-get update

state 1a state 1b

apt-get install foo apt-get remove bar

state 2a state 2b

apt-get remove bar apt-get install foo

state 3a state 3b $DISTRO $DISTRO

apt-get update apt-get update

state 1a state 1b

apt-get install foo apt-get remove bar = ? state 2a state 2b

apt-get remove bar apt-get install foo

state 3a state 3b #3. It’s worse than this.

It’s worse, really. “Let’s Package jQuery: A Javascript Packaging Dystopian Novella” by Chris Webber

http://dustycloud.org/blog/ javascript-packaging-dystopia/ → “app bundles” (Docker images)

Giving up? Giving up?

→ “app bundles” (Docker images)

Functional package management. hwloc = g(pciaccess, gcc, , coreutils)

gcc = h(make, coreutils, gcc0) ...

openmpi = f (hwloc, gcc, make, coreutils)

where f = ./configure && make && make install gcc = h(make, coreutils, gcc0) ... where f = ./configure && make && make install

openmpi = f (hwloc, gcc, make, coreutils) hwloc = g(pciaccess, gcc, make, coreutils) where f = ./configure && make && make install

openmpi = f (hwloc, gcc, make, coreutils) hwloc = g(pciaccess, gcc, make, coreutils) gcc = h(make, coreutils, gcc0) ... where f = ./configure && make && make install

openmpi = f (hwloc, gcc, make, coreutils) hwloc = g(pciaccess, gcc, make, coreutils) gcc = h(make, coreutils, gcc0) ... the complete DAG is captured I A Safe and Policy-Free System for Software Deployment, Dolstra et al., 2003 Nix, http://nixos.org/nix/

I Functional Package Management with Guix, Courtes,` 2013 (define hello (package (name "hello") (version "2.10") (source (origin (method url-fetch) (uri (string-append "mirror:///.../hello-" version "..gz")) (sha256 ( "0wqd...dz6")))) (build-system gnu-build-system) (synopsis "Hello, world!") (description "Produce a friendly greeting.") (home-page "http://www.gnu.org/software/hello/") (license gpl3+))) build processes chroot, separate UIDs Guile Scheme

(guix packages)

(guix store) Guile , make, etc. Guile , make, etc. Guile , make, etc.

build build processes chroot, separate UIDs Guile Scheme

(guix packages)

(guix store) Guile , make, etc. Guile , make, etc. Guile , make, etc.

build daemon RPCs build processes chroot, separate UIDs Guile Scheme

(guix packages)

, make, etc. , make, etc. , make, etc. (guix store) Guile Guile Guile

build daemon RPCs /gnu/store/ h2g4sf72... -hello-2.10

$ guix gc --references /gnu/store/...-hello-2.10 /gnu/store/...-glibc-2.22 /gnu/store/...-gcc-4.9.3-lib /gnu/store/...-hello-2.10

$ guix build hello

isolated build: chroot, separate name spaces, etc. $ guix gc --references /gnu/store/...-hello-2.10 /gnu/store/...-glibc-2.22 /gnu/store/...-gcc-4.9.3-lib /gnu/store/...-hello-2.10

$ guix build hello /gnu/store/ h2g4sf72... -hello-2.10

hash of all the dependencies $ guix build hello /gnu/store/ h2g4sf72... -hello-2.10

$ guix gc --references /gnu/store/...-hello-2.10 /gnu/store/...-glibc-2.22 /gnu/store/...-gcc-4.9.3-lib /gnu/store/...-hello-2.10 $ guix build hello /gnu/store/ h2g4sf72... -hello-2.10

$ guix gc --references /gnu/store/...-hello-2.10 /gnu/store/...-glibc-2.22 /gnu/store/...-gcc-4.9.3-lib /gnu/store/...-hello-2.10(nearly) bit-identical for everyone $ guix package -i gcc-toolchain coreutils sed ... demo $ eval ‘guix package --search-paths‘ ...

$ guix package --manifest=my-software.scm ... A simple matter of installing the deps, right?

Want your PhD student to hack on GNUnet? Want your PhD student to hack on GNUnet?

A simple matter of installing the deps, right? -0.10.1

libextractor-1.3

glpk-4.56 -2.8

-1.1 libbluray-0.9.0 ladspa-1.13 -3.99.5 soxr-0.1.1

texlive-2015 -1.3.3

texlive-texmf-2015

doxygen-1.8.7 lua-5.2.3 texlive-bin-2015

mpfr-3.1.3 graphviz-2.38.0 fontforge-20120731-b gst-plugins-base-1.6.1

-1.4.0 libx264-20150706-2245 libspiro-20071029 -1.38.1 libass-0.12.1 cdparanoia-10.2 orc-0.4.24

yasm-1.2.0 -1.0.5 enca-1.16 -1.6.1 fribidi-0.19.6 libcaca-0.99.beta19 libtheora-1.1.1

libmicrohttpd-0.9.45 libquvi-0.4.1 potrace-1.11 -introspection-1.46.0 ftgl-2.1.3-rc5 freeglut-3.0.0

-7.45.0 libquvi-scripts-0.4.21 lua-5.1.5 -1.14.2 glu-9.0.0 -1.15.1

openldap-2.4.42 gnurl-7.45.0 -0.37.0 recode-3.7.0.201402 -11.0.3 pulseaudio-6.0

icu4c-55.1 bdb-5.3.21 -1.22.3 teckit-2.5.4 libuninameslist-0.4.20140731 s2tc-1.0 gts-0.7.6 cairo-1.14.2 presentproto-1.0 dri2proto-2.8 dri3proto-1.0 -0.6.31 json--0.12 check-0.9.14 alsa-lib-1.0.27.1 libsamplerate-0.1.8 twolame-0.3.13 -1.2rc1

gss-1.0.3 libtool-2.4.6 netpbm-10.61.01 mesa-headers-11.0.3 libspectre-0.2.7 -2.46.1 libdaemon-0.14 intltool-0.51.0 -1.0.25

shishi-1.0.2 -1.15 openjpeg-1.5.2 gd-2.1.1 pixman-0.32.8 ghostscript-9.14.0 tzdata-2015c -xml-parser-2.44 dbus-1.10.0 file-5.22 -1.3.1 libvorbis-1.3.5

-pam-1.2.1 -3.4.5 -wrapper-2.69 autoconf-wrapper-2.69 tcsh-6.18.01 libpng-1.5.21 lcms-2.6 libpaper-1.1.24 zziplib-0.13.62 graphite2-1.3.3 python-wrapper-3.4.3 libogg-1.3.2

libidn-1.32 cyrus-sasl-2.1.26 libtasn1-4.5 nettle-3.1.1 autoconf-2.69 guile-2.0.11 which-2.21 ruby-2.2.3 libtiff-4.0.5 libjpeg-8d coreutils-8.24 zip-3.0 python2-fonttools-2.5 python-2.7.10 python-3.4.3

mit-krb5-1.11.3 gmp-6.0.0a -6.0 bc-1.06 -4.3.39 libunistring-0.9.6 libjpeg-9a sqlite-3.8.11.1 libgc-7.4.2 libcap-2.24 python2-setuptools-18.3.1 -1.0.6 acl-2.2.52 libffi-3.1 gdbm-1.11 tk-8.6.4 libxaw-1.0.12 libxvmc-1.0.8 xinput-1.6.1 libltdl-2.4.6

bison-3.0.4 readline-6.3 libatomic-ops-7.4.2 attr-2.4.46 tcl-8.6.4 libxft-2.3.2 libxmu-1.1.2 libxpm-3.5.11 libxdamage-1.1.4 libva-without-mesa-1.6.1 libxi-1.7.4 libxxf86vm-1.1.3 libxrandr-1.4.2 libxv-1.0.10 libxinerama-1.1.3

flex-2.5.37 exiv2-0.23 giflib-5.1.1 -2.11.94 libxrender-0.9.8 libxt-1.1.4 gettext-0.19.6 libxfixes-5.0.1 libxext-1.3.3 xf86vidmodeproto-2.3.1

xmlto-0.0.25 bison-2.7.1 -2.2.10 freetype-2.6 libsm-1.2.2 gs-fonts-8.11 expat-2.1.0 fixesproto-5.0 libx11-1.6.2 libcdio-paranoia-10.2+0.93+1

-1.4.17 procps-3.2.8 util-linux-2.27 libice-1.0.9 xextproto-7.3.0 libxcb-1.11 inputproto-2.3.1 eudev-3.1.5 libcdio-0.93

libssh2-1.4.3 -1.1.28 ncurses-6.0 net-base-5.3 xtrans-1.3.5 -proto-1.11 kmod-17 makedepend-1.0.5 libxshmfence-1.1 libxdmcp-1.1.1 libxau-1.0.8 gperf-3.0.4 libcddb-1.3.0

-1.6.3 libgcrypt-1.5.4 -2.9.2 tar-1.28 xz-5.0.4 python-wrapper-3.4.3 renderproto-0.11.1 xproto-7.0.26 damageproto-1.2.1 libdrm-2.4.65

libgpg-error-1.19 python-minimal-3.4.3 libpciaccess-0.13.4 util-macros-1.19.0 libpthread-stubs-0.3 kbproto-1.0.6 randrproto-1.4.0 xineramaproto-1.2.1 videoproto-2.3.2 glproto-1.4.17

psutils-17 -1.0.2d -1.2.7 pkg-config-0.28 help2man-1.47.2 fftw-3.3.4 fftwf-3.3.4

perl-5.16.1 $ guix environment --container gnunet ...

$ guix environment --ad-hoc python-ipython python-numpy \ -E ipython ...

Whole-system deployment. Linux-libre Linux-libre initial RAM disk Linux-libre initial RAM disk Guile Linux-libre initial RAM disk Guile

PID 1: GNU dmd services... Linux-libre initial RAM disk Guile

PID 1: GNU dmd services... Guile Linux-libre initial RAM disk Guile

PID 1: GNU dmd services... Guile

applications Trustworthiness. ’s dirtiest secret: Binary packages built by developers are used in the archive — Lucas Nussbaum, FOSDEM 2015 Transparent binary/source deployment

alice@foo$ guix package --install= The following package will be installed: emacs-24.5 /gnu/store/...-emacs-24.5

The following files will be downloaded: /gnu/store/...-emacs-24.5 /gnu/store/...-libxpm-3.5.10 /gnu/store/...-libxext-1.3.1 /gnu/store/...-libxaw-1.0.11 Transparent binary/source deployment

alice@foo$ guix package --install=emacs The following package will be installed: emacs-24.5 /gnu/store/...-emacs-24.5

The following files will be downloaded: /gnu/store/...-libxext-1.3.1 /gnu/store/...-libxaw-1.0.11 The following derivations will be built: /gnu/store/...-emacs-24.5.drv /gnu/store/...-libxpm-3.5.10.drv (define foo (package ...)) user (define foo (package ...)) user

test guix build foo /gnu/store/...-foo-1.0 (define foo (package ...)) user

test guix build foo /gnu/store/...-foo-1.0

git push git.sv.gnu.org (define foo (package ...)) user

test

pull guix build foo hydra.gnu.org /gnu/store/...-foo-1.0 build farm

pull

git push git.sv.gnu.org (define foo (package ...)) user

test get binary

pull guix build foo hydra.gnu.org /gnu/store/...-foo-1.0 build farm

pull

git push git.sv.gnu.org (define foo (package ...)) user

test

pull guix build foo /gnu/store/...-foo-1.0

git push git.sv.gnu.org (define foo (package ...)) user

test guix build foo no “maintainer /gnu/store/...-foo-1.0 uploads”

no single point of trust git push git.sv.gnu.org source ? binary package recipes hydra.gnu.org

(define emacs (package ... )) /gnu/store/... -emacs-24.5 I we have isolated build environments! I ... but we need builds to be deterministic I http://reproducible-builds.org

I guix publish I publish over GNUnet? (GSoC 2015)

The path to greater user control

1. Bit-reproducible builds

2. No single binary provider

3. Tools for users to challenge binaries I guix publish I publish over GNUnet? (GSoC 2015)

The path to greater user control

1. Bit-reproducible builds I we have isolated build environments! I ... but we need builds to be deterministic I http://reproducible-builds.org 2. No single binary provider

3. Tools for users to challenge binaries The path to greater user control

1. Bit-reproducible builds I we have isolated build environments! I ... but we need builds to be deterministic I http://reproducible-builds.org 2. No single binary provider I guix publish I publish over GNUnet? (GSoC 2015) 3. Tools for users to challenge binaries The path to greater user control

1. Bit-reproducible builds I we have isolated build environments! I ... but we need builds to be deterministic I http://reproducible-builds.org 2. No single binary provider I guix publish I publish over GNUnet? (GSoC 2015) 3. Tools for users to challenge binaries $ guix challenge --substitute-urls="http://hydra.gnu.org http://guix.example.org" /gnu/store/...-openssl-1.0.2d contents differ: local hash: 0725l22... http://hydra.gnu.org/...-openssl-1.0.2d: 0725l22... http://guix.example.org/...-openssl-1.0.2d: 1zy4fma... /gnu/store/...-git-2.5.0 contents differ: local hash: 00p3bmr... http://hydra.gnu.org/...-git-2.5.0: 069nb85... http://guix.example.org/...-git-2.5.0: 0mdqa9w... /gnu/store/...-pius-2.1.1 contents differ: local hash: 0k4v3m9... http://hydra.gnu.org/...-pius-2.1.1: 0k4v3m9... http://guix.example.org/...-pius-2.1.1: 1cy25x1... Status. Timeline

I Nov. 2012 — dubbed GNU I Jan. 2013 — 0.1 I ... I Apr. 2014 — 0.6, signed binaries, guix system I July 2014 — 0.7, installable I ... I 29 Jan. 2015 — 0.8.1, ARMv7 port I ... I Aug. 2015 — Reproducibility in Parallel Computing Workshop (RepPar) I 5 Nov. 2015 — 0.9.0, new service framework, etc.

Status

I full-featured package manager

I 2,600+ packages, 4 platforms β I Guix System Distribution

I binaries at http://hydra.gnu.org

I tooling: auto-update, “linting”, etc.

I l10n: 8 languages! I ≈25 contributors each month

I ... and lots of friendly people!

I ≈400 commits per month

I ≈200–500 new packages per release your help needed!

I install the distribution

I use it, report bugs, add packages

I help with the infrastructure + admin

I donate hardware/money

I your ideas! [email protected] http://gnu.org/software/guix/ Copyright c 2010, 2012, 2013, 2014, 2015 Ludovic Courtes` [email protected].

GNU Guix logo, GFDL, http://gnu.org/s/guix/graphics Copyright of other images included in this document is held by their respective owners.

This work is licensed under the Creative Commons Attribution-Share Alike 3.0 License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.

At your option, you may instead copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is available at http://www.gnu.org/licenses/gfdl.html.

The source of this document is available from http://git.sv.gnu.org/cgit/guix/maintenance.git.