\documentclass[aspectratio=169]{beamer}

\usetheme{default}

\usefonttheme{structurebold}
\usepackage{helvet}
\usepackage{multimedia}         % movie
\usecolortheme{seagull}         % white on black

\usepackage[utf8]{inputenc}
\PassOptionsToPackage{hyphens}{url}\usepackage{hyperref,xspace,multicol}
\usepackage[absolute,overlay]{textpos}
\usepackage{tikz}
\usetikzlibrary{arrows,shapes,trees,shadows,positioning, decorations.pathreplacing}
\usepackage{fancyvrb}           % for \Verb

\usepackage[french]{babel}

% Remember the position of every picture.
\tikzstyle{every picture}+=[remember picture]

\tikzset{onslide/.code args={<#1>#2}{%
  \only<#1>{\pgfkeysalso{#2}} % \pgfkeysalso doesn't change the path
}}

% Colors.
\definecolor{guixred1}{RGB}{226,0,38}  % red P
\definecolor{guixorange1}{RGB}{243,154,38}  % guixorange P
\definecolor{guixyellow}{RGB}{254,205,27}  % guixyellow P
\definecolor{guixred2}{RGB}{230,68,57}  % red S
\definecolor{guixred3}{RGB}{115,34,27}  % dark red
\definecolor{guixorange2}{RGB}{236,117,40}  % guixorange S
\definecolor{guixtaupe}{RGB}{134,113,127} % guixtaupe S
\definecolor{guixgrey}{RGB}{91,94,111} % guixgrey S
\definecolor{guixdarkgrey}{RGB}{46,47,55} % guixdarkgrey S
\definecolor{guixblue1}{RGB}{38,109,131} % guixblue S
\definecolor{guixblue2}{RGB}{10,50,80} % guixblue S
\definecolor{guixgreen1}{RGB}{133,146,66} % guixgreen S
\definecolor{guixgreen2}{RGB}{157,193,7} % guixgreen S

\setbeamerfont{title}{size=\huge}
\setbeamerfont{frametitle}{size=\huge}
\setbeamerfont{normal text}{size=\Large}

% White-on-black color theme.
\setbeamercolor{structure}{fg=guixorange1,bg=black}
\setbeamercolor{title}{fg=white,bg=black}
\setbeamercolor{date}{fg=guixorange1,bg=black}
\setbeamercolor{frametitle}{fg=white,bg=black}
\setbeamercolor{titlelike}{fg=white,bg=black}
\setbeamercolor{normal text}{fg=white,bg=black}
\setbeamercolor{alerted text}{fg=guixyellow,bg=black}
\setbeamercolor{section in toc}{fg=white,bg=black}
\setbeamercolor{section in toc shaded}{fg=white,bg=black}
\setbeamercolor{subsection in toc}{fg=guixorange1,bg=black}
\setbeamercolor{subsection in toc shaded}{fg=white,bg=black}
\setbeamercolor{subsubsection in toc}{fg=guixorange1,bg=black}
\setbeamercolor{subsubsection in toc shaded}{fg=white,bg=black}
\setbeamercolor{frametitle in toc}{fg=white,bg=black}
\setbeamercolor{local structure}{fg=guixorange1,bg=black}

\newcommand{\highlight}[1]{\alert{\textbf{#1}}}
\newcommand{\orange}[1]{\textcolor{guixorange1}{\textbf{#1}}}
\newcommand{\comment}[1]{\textcolor{guixgreen2}{#1}}
\newcommand{\red}[1]{\textcolor{guixred2}{#1}}


\title{GNU Guix: vers la reproductibilité computationnelle}

\author{Simon Tournier}
\date{BlueHats, Paris, 11 Décembre 2019}
\institute{\texttt{simon.tournier@univ-paris-diderot.fr}}

\setbeamertemplate{navigation symbols}{} % remove the navigation bar

\AtBeginSection[]{
  \begin{frame}
    \frametitle{}
    \tableofcontents[currentsection]
  \end{frame}
}


\newcommand{\screenshot}[1]{
  \begin{frame}[plain]
    \begin{tikzpicture}[remember picture, overlay]
      \node [at=(current page.center), inner sep=0pt]
        {\includegraphics[width=\paperwidth]{#1}};
    \end{tikzpicture}
  \end{frame}
}


\begin{document}

\begin{frame}[plain, fragile]
  \vspace{10mm}
  \titlepage

  \vfill{}
  Ing. Rech. Calcul Sci. \scriptsize{(+un peu adminsys)}

  \normalsize

  Analyses avec biologistes/médecins

  \tiny{(avant)} \scriptsize{Simul. num. (fem, bem, sys. lin.)}
  \normalsize
  \hfill{%
    \begin{minipage}{0.2\paperwidth}
      \begin{tabular}{c|c}
        \includegraphics[width=0.1\paperwidth]{images/diderot_u-paris}
        &
          \includegraphics[width=0.04\paperwidth]{images/diderot_u-paris_bis}
      \end{tabular}
    \end{minipage}
  }
\end{frame}


\begin{frame}[plain]
  \begin{center}
    \textcolor{guixgreen1}{Résultat scientifique = expérience + traitement numérique}
  \end{center}
  \begin{tabular}{cclll}
    \orange{$\rhd$} & expérience &:& comment produire la donnée & $\approx$décrit
    \\
    \orange{$\rhd$} & trait. num. &:& quels logiciels, paramètres, versions, etc. & \alert{?}
  \end{tabular}

  \vfill{}

  \begin{center}
    \highlight{Reproductibilité scientifique à l'ére numérique :}
  \end{center}

  \begin{tabular}{cll}
    \orange{1.} & Articles accessibles & HAL, ReScience
    \\
    \orange{2.} & Données ouvertes & Zenodo
    \\
    \orange{3.} & Code source ouvert & Forges, Software Heritage
    \\
    \orange{4.} & Environnement d'exécution & \alert{?}
  \end{tabular}

  \begin{center}
    {et comment lier tout ca ?}
  \end{center}

  \vfill{}

    $\left(
    \begin{tabular}{lcl}
      reproductibilité &=& vérification\\
  réplicabilité &=& validation
    \end{tabular}
    \right)$

    \vspace{-0.75cm}

  \begin{flushright}
    \href{https://scibian.org/up/201609/Software_Heritage.pdf}%
    {\small{R. Di Cosmo@Scibian2016 (lien)}}\\
    \href{https://aramis.resinfo.org/wiki/lib/exe/fetch.php?media=pleniaires:aramis_keynote_enjeux-et-defis-recherche-reproductible_konrad_hinsen.pdf}%
    {\small{K. Hinsen@Aramis2019 (lien)}}
  \end{flushright}
\end{frame}

\begin{frame}{Scenarii concrets}
  \begin{itemize}
  \item Alice a utilisé les outils numériques \emph{foo-1.2}, \emph{bar-3.4} et \emph{baz-5.6}.
  \item Carole travaille avec Alice \dots \\
    \hfill{mais utilise aussi les versions \emph{foo-7.8}, \emph{bar-9.0}.}
  \item Charlie a mis à jour son système et plus rien ne fonctionne.
  \item Bob utilise les mêmes versions qu'Alice \dots \\
    \hfill{mais n'obtient pas les mêmes résultats.}
  \item Dan veut refaire l'analyse des mois (années?) plus tard \dots\\
    \hfill{mais rencontre le \emph{dependencies hell}\footnote{au mieux}.}
  \end{itemize}
  \begin{center}
    \highlight{Solution(s)}
  \end{center}

  \vspace{-0.6cm}

  \begin{tikzpicture}[decoration=brace]
    \node[text width=0.6\paperwidth] (box)
    {
      \begin{enumerate}
      \item \textbf{gestionnaire de paquets}: \texttt{apt}, \texttt{yum}, etc.
      \item \textbf{environnement virtuel}: \texttt{conda}, \texttt{modulefiles}, etc.
      \item \textbf{conteneur}: Docker, Singularity, etc.
      \end{enumerate}
    };
    \draw [decorate] (box.north east) --node[right=10pt]{\alert{Guix}} (box.south east);
  \end{tikzpicture}



\end{frame}


\begin{frame}{Guix en résumé}
  \begin{enumerate}
  \item outil de gestion de paquets: paradigme fonctionnel et transactionnel
  \item gestionnaire d'environnements
  \item permet générer des conteneurs
  \item fournit des outils (biblio. Scheme) pour adapter à ses propres spécificités
  \end{enumerate}

  \vfill{}
  \begin{center}
    \highlight{Contrôle (fin) sur la chaîne de dépendances}
  \end{center}

  \vfill{}

  \begin{tabular}{cll}
  \alert{$\star\star$} & Reproductibilité binaire &
    \scriptsize{(du moins permet de la tracer)}\normalsize \\
    \alert{$\star\star$} & \emph{Bootstrap} &
    \scriptsize{(binaire${}_{n}$ $\leftarrow$ source + binaire${}_{n-1}$)}\normalsize
  \end{tabular}
\end{frame}

\begin{frame}[fragile]
  \begin{semiverbatim}
    \small{
      \comment{\# Alice}
      guix \alert{install} foo@1.2 bar@3.4 baz@5.6       \comment{\# -m manifest.scm}
      guix \alert{describe} -f channels > \red{alice-conf.scm}

      \comment{\# Carole}
      guix install \alert{--profile}=./avec-alice foo@1.2 bar@3.4 baz@5.6
      guix install foo@7.8 bar@9.0

      \comment{\# Charlie}
      guix package \alert{--roll-back}                   \comment{\# generations}

      \comment{\# Bob}
      guix \alert{pull --channels}=\red{alice-conf.scm}
      guix \alert{pack} -f docker ...                    \comment{# -f squashfs}

      \comment{\# Dan}
      guix \alert{time-machine} -C \red{alice-conf.scm} -- install foo@1.2 bar@3.4 baz@5.6
    }
  \end{semiverbatim}
\end{frame}

\setbeamercolor{normal text}{fg=black,bg=white}
\begin{frame}[fragile]
  \vspace{2.5cm}
  \begin{tikzpicture}[remember picture, overlay]
    \node [at=(current page.center), inner sep=0pt, rotate=-90,
    drop shadow={opacity=0.5}, draw, color=guixgrey, line width=1pt]
    {\includegraphics[height=1.4\paperheight]{images/guix-refcard}};
  \end{tikzpicture}
\end{frame}
\setbeamercolor{normal text}{fg=white,bg=black}

\begin{frame}{Déploiement sur Clusters}
  \large{
    \begin{tabular}{lcrl}
      \highlight{Max Delbrück Center} &(DE):& 250-node &+ workstations \\
      \highlight{UMC Utrecht} &(NL):& 68-node  &(1,000+ cores)\\
      \highlight{University of Queensland} &(AU):& 20-node  &(900 cores)\\
      \highlight{PlaFRIM Inria Bordeaux} &(FR):& 120-node   &(3000+ cores)\\
      \highlight{GriCAD Grenoble} &(FR):& 72-node  &(1000+ cores)\\
      \highlight{CCIPL Nantes} &(FR):& 230-node  &(4000+ cores)\\
      \quad (le votre ?)\\
    \end{tabular}
  }
  \begin{center}
    \includegraphics[height=0.3\paperheight]{images/guixhpc-logo-transparent}

    \url{https://guix-hpc.bordeaux.inria.fr}
  \end{center}
\end{frame}

\setbeamercolor{normal text}{bg=black}
\begin{frame}[fragile]{Survol technique}

  \begin{semiverbatim}
    \Large{
guix build pastix \only<2>{\alert{--with-source=}./my-pastix.tar.gz} \only<3>{\alert{--with-input=}lapack=my-lapack}
\uncover<4->{/gnu/store/\tikz[baseline]{\node[anchor=base](nixhash){\alert<4>{h2g4sf72\textrm{...}}}}-pastix-6.0.2}

\uncover<5->{{guix \alert<5>{gc --references} /gnu/store/\textrm{...}-pastix-6.0.2}
/gnu/store/3fa68b5\textrm{...}-glibc-2.24
/gnu/store/bd9c330\textrm{...}-gcc-4.9.3-lib
/gnu/store/ca175fd\textrm{...}-pastix-6.0.2
}}
  \end{semiverbatim}

  \begin{tikzpicture}[overlay]
    \node<1-3>(labelnixhash) [fill=white, text=black, inner sep=0.5cm,
       rounded corners] at (current page.center) {%
      \Large{\textbf{isolated build}: chroot, separate name spaces, etc.}
    };

    \node<4>(labelnixhash) [fill=white, text=black] at (4cm, 2cm) {%
      hash de \textbf{toutes} les dépendances};
    \path[->]<4>(labelnixhash.north) edge [bend left, in=180, out=-45] (nixhash.south);

    \draw<6-> (-10pt, 105pt) [very thick, color=guixorange2, rounded corners=8pt]
      arc (10:-50:-50pt and 110pt);
    \node<6->[fill=white, text=black, text opacity=1, opacity=.7,
          rounded corners=2mm, inner sep=5mm]
      at (7, 2) {\textbf{\Large{(presque) bit-identique pour tout le monde}}};
  \end{tikzpicture}

  \begin{semiverbatim}
    \Large{
    }
  \end{semiverbatim}

\end{frame}


\setbeamercolor{normal text}{bg=guixgrey}
\begin{frame}[fragile]
  \begin{semiverbatim}
(define pastix
  (\alert{package}
    (name "pastix")
    (home-page "https://gitlab.inria.fr/solverstack/pastix")
    (\alert{source} (origin
              (method git-fetch)
              (uri (git-reference
                     (\alert{url} home-page)
                     (\alert{commit} "2f30ff07a")\tikz{\node(commit){};}
                     (recursive? #t)))
              (sha256
               (base32
                "106rf402cvfdhc2yf\textrm{...}"))))
    \textrm{...}))
  \end{semiverbatim}

  \begin{tikzpicture}[overlay]
    \node(swh) [inner sep=3mm, rounded corners, fill=black,
                    opacity=.3, text opacity=1] at (12,5) {
       % https://annex.softwareheritage.org/public/logo/
       \includegraphics[width=0.33\textwidth]{images/software-heritage-logo-title-white}
    };
    \node      [at=(current page.south), anchor=south,
                    inner sep=2mm, rounded corners, fill=black, text width=11.75cm,
                    opacity=.3, text opacity=1] {
                      \href{https://www.softwareheritage.org/2019/04/18/software-heritage-and-gnu-guix-join-forces-to-enable-long-term-reproducibility/}%
                      {SWH and Guix join forces to enable long term reproductibility (lien)}
    };

    \path[very thick, draw=guixorange1]
      (swh) edge [out=-90, in=0, ->] (commit);
  \end{tikzpicture}
\end{frame}
\setbeamercolor{normal text}{fg=white,bg=black}

\setbeamercolor{normal text}{fg=black,bg=white}
\begin{frame}[plain]{Dans un monde \emph{idéal}}
  \vspace{-0.9cm}
  \includegraphics[width=\textwidth]{images/big-picture-3}
\end{frame}
\setbeamercolor{normal text}{fg=white,bg=black}

\begin{frame}{(Venez (partager (les (parenthèses !))))}
  \Large{
    \begin{itemize}
    \item \textbf{installez}
      \begin{center}
        \href{https://git.savannah.gnu.org/cgit/guix.git/plain/etc/guix-install.sh}{\texttt{https://.../guix-install.sh}}
      \end{center}
      \vspace{0.5cm}
    \item \textbf{utilisez}, rapportez des problèmes, empaquetez
      \begin{center}
        \url{https://issues.guix.gnu.org/}
      \end{center}
      \vspace{0.5cm}
    \item \textbf{partagez} vos \highlight{idées} !
      \begin{center}
        \texttt{help-guix@gnu.org}

        \vspace{0.5cm}

        \texttt{\#guix} \small{(irc.freenode.net)}
      \end{center}
    \end{itemize}
  }
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[plain]
  \vfill{
    \vspace{1.5cm}
    \center{\includegraphics[width=0.3\textwidth]{images/Guix-white}}\\[1.0cm]
    \texttt{help-guix@gnu.org}\hfill{\alert{\url{https://guix.gnu.org}}}
  }
\end{frame}

\begin{frame}{}

  \begin{textblock}{12}(2, 8)
    \tiny{
      Copyright \copyright{} 2019 Simon Tournier \texttt{zimon.toutoune@gmail.com}.\\[3.0mm]
      GNU Guix logo, CC-BY-SA 4.0, \url{https://gnu.org/s/guix/graphics}

      GNU~Guix Reference Card under GFDL~1.3+.

      Copyright of other images included in this document is held by
      their respective owners; especially from Ludovic Courtès.
      \\[3.0mm]
      This work is licensed under the \alert{Creative Commons
        Attribution-Share Alike 3.0} License.  To view a copy of this
      license, visit
      \url{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.
      \\[2.0mm]
      At your option, you may instead copy, distribute and/or modify
      this document under the terms of the \alert{GNU Free Documentation
        License, Version 1.3 or any later version} published by the Free
      Software Foundation; with no Invariant Sections, no Front-Cover
      Texts, and no Back-Cover Texts.  A copy of the license is
      available at \url{https://www.gnu.org/licenses/gfdl.html}.
      \\[2.0mm]
      % Give a link to the 'Transparent Copy', as per Section 3 of the GFDL.
      The source of this document is available from
      \url{https://git.sv.gnu.org/cgit/guix/maintenance.git}.
    }
  \end{textblock}
\end{frame}

\end{document}

% Local Variables:
% coding: utf-8
% comment-start: "%"
% comment-end: ""
% ispell-local-dictionary: "french"
% End:
