controlling software environments with gnu guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf ·...

56
Controlling Software Environments with GNU Guix Ludovic Court ` es Inria Bordeaux Sud-Ouest November 2016

Upload: others

Post on 12-Aug-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

Controlling Software Environmentswith GNU Guix

Ludovic Courtes

Inria Bordeaux Sud-OuestNovember 2016

Page 2: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

The difficulty of keeping softwareenvironments under control.

Page 3: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

#1. Upgrades are hard.

Page 4: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?
Page 5: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?
Page 6: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

#2. Stateful system management isintractable.

Page 7: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

$DISTRO $DISTRO

Page 8: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

$DISTRO $DISTRO

state 1a state 1b

apt-get update apt-get update

Page 9: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

$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: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

$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: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

$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: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

#3. Entropy keeps increasing.

Page 13: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?
Page 14: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?
Page 15: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?
Page 16: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

http://xkcd.com/1654/

Page 17: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

Giving up?

→ “app bundles” (Docker images & co.)

Page 18: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

Giving up?

→ “app bundles” (Docker images & co.)

Page 19: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

“Debian and other distributions are going to bethat thing you run docker on, little more.”

— Jos Poortvliet, ownCloud developer

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

Page 20: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

It’s also that thingyou run insideDocker!

Page 21: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

https://imagelayers.io/

Page 22: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?
Page 23: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

https://www.banyanops.com/blog/analyzing-docker-hub/May 2015

Page 24: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

https://www.hpcwire.com/2016/10/20/singularity-containers-easing-scientific-computing

Page 25: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?
Page 26: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?
Page 27: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

“app bundles” are headed wrong

I difficulty to compose software packagesI wrong abstraction level: image vs. packageI hardly reproducible: we have the bits, not the sourceI makes it hard to customize & experiment

Page 28: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?
Page 29: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

Make packaging great again!

Page 30: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?
Page 31: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

Guix

1. transactional package manager2. software environment manager3. APIs & tools to customize environments4. packaging tools

Page 32: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

$ guix package -i gcc-toolchain coreutils sed grep

...

$ eval ‘guix package --search-paths‘

...

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

...

Page 33: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

Want to get started hacking onhwloc?

A simple matter of installing the deps, right?

Page 34: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

Want to get started hacking onhwloc?

A simple matter of installing the deps, right?

Page 35: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

hwloc-1.11.2

pkg-config-0.29

libx11-1.6.3

cairo-1.14.6

ncurses-6.0

expat-2.1.1

numactl-2.0.11

libpciaccess-0.13.4

inputproto-2.3.1

xextproto-7.3.0 xtrans-1.3.5 kbproto-1.0.7 libxcb-1.11

zlib-1.2.8

python-wrapper-3.4.3

ghostscript-9.14.0

libspectre-0.2.7

poppler-0.43.0

fontconfig-2.11.94

freetype-2.6.3

glib-2.48.0

libpng-1.5.26

libxext-1.3.3libxrender-0.9.9

pixman-0.34.0

python-minimal-wrapper-3.4.3

xcb-proto-1.11 libxslt-1.1.29

libpthread-stubs-0.3

libxau-1.0.8libxdmcp-1.1.2

openssl-1.0.2h

python-minimal-3.4.3

libgcrypt-1.7.0

libxml2-2.9.4

xproto-7.0.28

perl-5.22.1

libgpg-error-1.22util-macros-1.19.0

bzip2-1.0.6gdbm-1.12libffi-3.2.1 sqlite-3.12.2

readline-6.3tcl-8.6.4

tk-8.6.4

python-3.4.3

lcms-2.6

libjpeg-8d

libpaper-1.1.24

libtiff-4.0.6

libjpeg-9a

gobject-introspection-1.48.0

openjpeg-1.5.2

cairo-1.14.6

gs-fonts-8.11

gettext-0.19.8dbus-1.10.8

bash-4.3.42

coreutils-8.25

tzdata-2015g

pcre-8.38

renderproto-0.11.1

libxft-2.3.2

bison-3.0.4

flex-2.6.0

python-2.7.11

acl-2.2.52

gmp-6.1.0

libcap-2.24

m4-1.4.17

bison-2.7.1 indent-2.2.10 attr-2.4.47

Page 36: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

$ guix environment --container hwloc

...

$ guix environment --container hwloc \

--ad-hoc git autoconf automake gdb

...

Page 37: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

$ guix build hello

/gnu/store/ h2g4sf72... -hwloc-1.11.2

$ guix gc --references /gnu/store/...-hwloc-1.11.2/gnu/store/...-glibc-2.24/gnu/store/...-gcc-4.9.3-lib/gnu/store/...-hwloc-1.11.2

isolated build: chroot, separate name spaces, etc.

Page 38: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

$ guix build hello

/gnu/store/ h2g4sf72... -hwloc-1.11.2

$ guix gc --references /gnu/store/...-hwloc-1.11.2/gnu/store/...-glibc-2.24/gnu/store/...-gcc-4.9.3-lib/gnu/store/...-hwloc-1.11.2

hash of all the dependencies

Page 39: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

$ guix build hello

/gnu/store/ h2g4sf72... -hwloc-1.11.2

$ guix gc --references /gnu/store/...-hwloc-1.11.2/gnu/store/...-glibc-2.24/gnu/store/...-gcc-4.9.3-lib/gnu/store/...-hwloc-1.11.2

Page 40: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

$ guix build hello

/gnu/store/ h2g4sf72... -hwloc-1.11.2

$ guix gc --references /gnu/store/...-hwloc-1.11.2/gnu/store/...-glibc-2.24/gnu/store/...-gcc-4.9.3-lib/gnu/store/...-hwloc-1.11.2(nearly) bit-identical for everyone

Page 41: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

Can we gobeyond mere reproducibilityand support experimentation?

Page 42: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

https://hal.inria.fr/hal-01161771/en

Page 43: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

Creating package variants at thecommand line

Page 44: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

$ guix build hwloc \

--with-source=./hwloc-42.0rc1.tar.gz

...

$ guix package -i mumps \

--with-input=scotch=pt-scotch

...

Page 45: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

$ guix build hwloc \

--with-source=./hwloc-42.0rc1.tar.gz

...

$ guix package -i mumps \

--with-input=scotch=pt-scotch

...

Page 46: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

Your personal packages or variantsin GUIX PACKAGE PATH!

Page 47: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

GuixSD: declarative OS config

Page 48: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

Status.

Page 49: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

I started in 2012I 4,400+ packages, all free softwareI 4 architectures:

x86 64, i686, ARMv7, mips64elI binaries at https://hydra.gnu.orgI 0.11.0 released in August 2016

Page 50: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

cluster deployments & usage

I Max Delbruck Center (DE): 250-node cluster +workstations

I Utrecht Bioinformatics Center (NL): 68-node cluster(1,000+ cores)

I GeneNetwork, “framework for web-based genetics”

Page 51: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?
Page 52: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?
Page 53: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

Wrap-up.

Page 54: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

Summary

I Guix supports reproducible software environmentsI ... can be extended with personal packagesI ... allows for experimentation through customizationI ... is entirely programmable

Page 55: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

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

Page 56: Controlling Software Environments with GNU Guixsed.bordeaux.inria.fr/seminars/guix_20161108.pdf · Want to get started hacking on hwloc? A simple matter of installing the deps, right?

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 a copy of this license, visithttp://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 DocumentationLicense, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, noFront-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.