reproducible and customizable deployments with gnu guix · reproducible and customizable...

69
Reproducible and Customizable Deployments with GNU Guix Ludovic Court ` es FOSDEM 2016

Upload: ngobao

Post on 04-Nov-2018

234 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

Reproducible andCustomizable Deployments

with GNU Guix

Ludovic Courtes

FOSDEM 2016

Page 2: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

The difficulty of keepingsoftware environmentsunder control.

Page 3: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

#1. Upgrades are hard.

Page 4: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016
Page 5: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016
Page 6: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

#2. Stateful systemmanagement is intractable.

Page 7: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

$DISTRO $DISTRO

Page 8: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

$DISTRO $DISTRO

state 1a state 1b

apt-get update apt-get update

Page 9: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

$DISTRO $DISTRO

state 1a state 1b

state 2a state 2b

apt-get update

apt-get install foo

apt-get update

apt-get remove bar

Page 10: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

$DISTRO $DISTRO

state 1a state 1b

state 2a state 2b

state 3a state 3b

apt-get update

apt-get install foo

apt-get remove bar

apt-get update

apt-get remove bar

apt-get install foo

Page 11: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

$DISTRO $DISTRO

state 1a state 1b

state 2a state 2b

state 3a state 3b

apt-get update

apt-get install foo

apt-get remove bar

apt-get update

apt-get remove bar

apt-get install foo

= ?

Page 12: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

#3. It’s worse than this.

Page 13: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016
Page 14: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016
Page 15: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

Giving up?

→ “app bundles” (Docker images)

Page 16: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

Giving up?

→ “app bundles” (Docker images)

Page 17: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

“Debian and other distributionsare going to be that thing yourun docker on, little more.”

— Jos Poortvliet, ownCloud developer

http://lwn.net/Articles/670566/

Page 18: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

It’s also that thingyou run insideDocker!

Page 19: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

https://imagelayers.io/

Page 20: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016
Page 21: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016
Page 22: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016
Page 23: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

Functional packagemanagement.

Page 24: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

gimp = f (gtk+, gcc, make, coreutils)

gtk+ = g(glib, gcc, make, coreutils)gcc = h(make, coreutils, gcc0)...

where f = ./configure && make && make install

Page 25: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

gimp = f (gtk+, gcc, make, coreutils)gtk+ = g(glib, gcc, make, coreutils)

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

Page 26: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

gimp = f (gtk+, gcc, make, coreutils)gtk+ = g(glib, gcc, make, coreutils)gcc = h(make, coreutils, gcc0)...

where f = ./configure && make && make install

Page 27: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

gimp = f (gtk+, gcc, make, coreutils)gtk+ = g(glib, gcc, make, coreutils)gcc = h(make, coreutils, gcc0)...

where f = ./configure && make && make install

the complete DAG is captured

Page 28: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

$ 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

isolated build: chroot, separate name spaces, etc.

Page 29: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

$ 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

hash of all the dependencies

Page 30: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

$ 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

Page 31: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

$ 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

Page 32: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

$ guix package -i gcc-toolchain coreutils sed grep

...

$ eval ‘guix package --search-paths‘

...

$ guix package --manifest=my-software.scm

...

demo

Page 33: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

Want to get started hackingon GIMP?

A simple matter of installing the deps, right?

Page 34: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

Want to get started hackingon GIMP?

A simple matter of installing the deps, right?

Page 35: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

gimp-2.8.14

pkg-config-0.29

intltool-0.51.0

babl-0.1.10

glib-2.46.1

libtiff-4.0.6 libjpeg-8d

atk-2.18.0

gtk+-2.24.28

libexif-0.6.21

lcms-2.6

librsvg-2.40.13

python-2.7.10

python2-pygtk-2.24.0

gegl-0.2.0

file-5.25

gettext-0.19.7

perl-xml-parser-2.44

perl-5.22.1

dbus-1.10.0

python-wrapper-3.4.3

bash-4.3.42

coreutils-8.24

libffi-3.2.1

zlib-1.2.8

tzdata-2015g

libjpeg-9a

gobject-introspection-1.46.0 cups-2.1.0

libxcomposite-0.4.4libxcursor-1.1.14 libxdamage-1.1.4libxi-1.7.4libxinerama-1.1.3 libxrandr-1.4.2

gdk-pixbuf-2.32.3

pango-1.38.1

libxml2-2.9.3

bzip2-1.0.6

cairo-1.14.2

libcroco-0.6.8

libgsf-1.14.34

openssl-1.0.2e

gdbm-1.11 sqlite-3.10.0

readline-6.3tcl-8.6.4

tk-8.6.4

python2-pycairo-1.10.0

python2-pygobject-2.28.6

libpng-1.5.26

expat-2.1.0 libx11-1.6.2

python-3.4.3

ncurses-6.0

bison-3.0.4

acl-2.2.52 gmp-6.1.0libcap-2.24

inputproto-2.3.1xextproto-7.3.0

xtrans-1.3.5

kbproto-1.0.6libxcb-1.11

python-minimal-wrapper-3.4.3

xcb-proto-1.11libxslt-1.1.28

libpthread-stubs-0.3

libxau-1.0.8 libxdmcp-1.1.1

python-minimal-3.4.3

libgcrypt-1.6.4 xproto-7.0.26

libgpg-error-1.21 util-macros-1.19.0

libxft-2.3.2

fontconfig-2.11.94 libxext-1.3.3libxrender-0.9.8

freetype-2.6 gs-fonts-8.11

renderproto-0.11.1

m4-1.4.17

flex-2.6.0

bison-2.7.1indent-2.2.10

attr-2.4.47

ghostscript-9.14.0

libspectre-0.2.7

poppler-0.37.0

pixman-0.32.8

libpaper-1.1.24

openjpeg-1.5.2

cairo-1.14.2 avahi-0.6.31

gnutls-3.4.7

cups-filters-1.4.0

libxfixes-5.0.1 compositeproto-0.4.2

damageproto-1.2.1xineramaproto-1.2.1

randrproto-1.4.0

harfbuzz-1.0.5

libdaemon-0.14

which-2.21 guile-2.0.11

libtasn1-4.7

libidn-1.32nettle-3.1.1

font-dejavu-2.34

ijs-9.14.0

qpdf-5.1.3

cups-minimal-2.1.0

libunistring-0.9.6libltdl-2.4.6libgc-7.4.2

libatomic-ops-7.4.2

tar-1.28

libtool-2.4.6

automake-1.15

autoconf-2.69pcre-8.38

autoconf-wrapper-2.69 autoconf-wrapper-2.69

fixesproto-5.0

graphite2-1.3.3

icu4c-55.1

python2-fonttools-2.5

python2-setuptools-18.3.1

python-waf-1.8.8

Page 36: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

$ guix environment --container gimp

...

$ guix environment --container gimp \

--ad-hoc git autoconf automake gdb

...

Page 37: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

Whole-systemdeployment.

Page 38: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

GuixSD: declarative OS config

Page 39: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

Linux-libre

Page 40: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

Linux-libre

initial RAM disk

Page 41: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

Linux-libre

initial RAM disk Guile

Page 42: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

Linux-libre

initial RAM disk

PID 1: GNU Shepherdservices...

Guile

Page 43: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

Linux-libre

initial RAM disk

PID 1: GNU Shepherdservices...

Guile

Guile

Page 44: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

Linux-libre

initial RAM disk

PID 1: GNU Shepherdservices...

applications

Guile

Guile

Page 45: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

Trustworthiness.

Page 46: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

Debian’s dirtiest secret:Binary packages built by developersare used in the archive

— Lucas Nussbaum, FOSDEM 2015

Page 47: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

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/...-emacs-24.5

/gnu/store/...-libxpm-3.5.10

/gnu/store/...-libxext-1.3.1

/gnu/store/...-libxaw-1.0.11

Page 48: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

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

Page 49: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

(define foo (package ...)) user

Page 50: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

(define foo (package ...)) user

guix build foo

/gnu/store/...-foo-1.0

test

Page 51: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

(define foo (package ...)) user

guix build foo

/gnu/store/...-foo-1.0

git push git.sv.gnu.org

test

Page 52: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

(define foo (package ...)) user

guix build foo

/gnu/store/...-foo-1.0hydra.gnu.org

build farm

git push git.sv.gnu.org

test

pull

pull

Page 53: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

(define foo (package ...)) user

guix build foo

/gnu/store/...-foo-1.0hydra.gnu.org

build farm

git push git.sv.gnu.org

test

pull

pull

get binary

Page 54: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

(define foo (package ...)) user

guix build foo

/gnu/store/...-foo-1.0

git push git.sv.gnu.org

test

pull

Page 55: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

(define foo (package ...)) user

guix build foo

/gnu/store/...-foo-1.0

git push git.sv.gnu.org

test

no “maintainer

uploads”

no singlepoint of trust

Page 56: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

sourcepackage recipes

binaryhydra.gnu.org

(define emacs (package . . . )) /gnu/store/. . . -emacs-24.5

?

Page 57: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

towards greater user control

1. Bit-reproducible builds

I we have isolated build environments!I ... but we need builds to be deterministicI http://reproducible-builds.org

2. No single binary provider

I guix publishI P2P publishing over GNUnet? (GSoC 2015)

3. Tools for users to challenge binaries

Page 58: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

towards greater user control

1. Bit-reproducible buildsI we have isolated build environments!I ... but we need builds to be deterministicI http://reproducible-builds.org

2. No single binary provider

I guix publishI P2P publishing over GNUnet? (GSoC 2015)

3. Tools for users to challenge binaries

Page 59: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

towards greater user control

1. Bit-reproducible buildsI we have isolated build environments!I ... but we need builds to be deterministicI http://reproducible-builds.org

2. No single binary providerI guix publishI P2P publishing over GNUnet? (GSoC 2015)

3. Tools for users to challenge binaries

Page 60: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

towards greater user control

1. Bit-reproducible buildsI we have isolated build environments!I ... but we need builds to be deterministicI http://reproducible-builds.org

2. No single binary providerI guix publishI P2P publishing over GNUnet? (GSoC 2015)

3. Tools for users to challenge binaries

Page 61: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

$ 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...

Page 62: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

Status.

Page 63: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

timeline

I Nov. 2012 — dubbed GNUI Jan. 2013 — 0.1I ...I Apr. 2014 — 0.6, signed binaries, guix system

I July 2014 — 0.7, installable operating systemI ...I 29 Jan. 2015 — 0.8.1, ARMv7 portI ...I 5 Nov. 2015 — 0.9.0, new service framework, etc.I Jan. 2016 — successful fundraiser for new build farm

Page 64: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016
Page 65: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

status

I full-featured package managerI 3,000+ packages, 4 platformsI Guix System Distributionβ

I binaries at http://hydra.gnu.orgI tooling: auto-update, “linting”, etc.

Page 66: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

I ≈25 contributors per monthI ... and lots of friendly people!I ≈400 commits per monthI 200–500 new packages per release

Page 67: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

I install the distributionI use it, report bugs, add packagesI help with the infrastructure + adminI donate hardware/moneyI share your ideas!

your help needed!

Page 68: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

[email protected] http://gnu.org/software/guix/

Page 69: Reproducible and Customizable Deployments with GNU Guix · Reproducible and Customizable Deployments with GNU Guix Ludovic Courtes` FOSDEM 2016

Copyright c© 2010, 2012–2016 Ludovic Courtes [email protected].

GNU GuixSD logo, CC-BY-SA 4.0, http://gnu.org/s/guix/graphicsCopyright 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 acopy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a letter toCreative 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 theGNU Free Documentation License, Version 1.3 or any later version published by the Free SoftwareFoundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of thelicense 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.