From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id wNGvLMMl7l4TDQAA0tVLHw (envelope-from ) for ; Sat, 20 Jun 2020 15:05:39 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 4JOLKMMl7l7WIgAA1q6Kng (envelope-from ) for ; Sat, 20 Jun 2020 15:05:39 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 27026940DC7 for ; Sat, 20 Jun 2020 15:05:38 +0000 (UTC) Received: from localhost ([::1]:60296 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jmf3p-0007dd-8n for larch@yhetil.org; Sat, 20 Jun 2020 11:05:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60266) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jmf3h-0007Yp-6i for help-guix@gnu.org; Sat, 20 Jun 2020 11:05:29 -0400 Received: from relay11.mail.gandi.net ([217.70.178.231]:37313) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jmf3e-0000S6-Gq for help-guix@gnu.org; Sat, 20 Jun 2020 11:05:28 -0400 Received: from pc19.home (atoulouse-157-1-130-200.w86-221.abo.wanadoo.fr [86.221.41.200]) (Authenticated sender: d@divoplade.fr) by relay11.mail.gandi.net (Postfix) with ESMTPSA id DAE1E100006; Sat, 20 Jun 2020 15:05:20 +0000 (UTC) Message-ID: <7bf11bf90a12e719f505d6f5b9b6b527c7acba7f.camel@divoplade.fr> Subject: Re: Gitlab CI From: divoplade To: =?ISO-8859-1?Q?J=E9r=E9my?= Korwin-Zmijowski , Guix Help Date: Sat, 20 Jun 2020 17:05:13 +0200 In-Reply-To: <6aa363c1fac60b165e222ecb0b18bf9b1f019231.camel@korwin-zmijowski.fr> References: <6aa363c1fac60b165e222ecb0b18bf9b1f019231.camel@korwin-zmijowski.fr> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5-1.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=217.70.178.231; envelope-from=d@divoplade.fr; helo=relay11.mail.gandi.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/20 11:05:22 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Spam-Score: -1.01 X-TUID: 75ms7ljAGbzV Hello Jérémy, The problem is that guix-install.sh asks you whether you want to authorize the substitutes, but it can't because it is not used interactively, so it fails. There are other traps to avoid (do not forget to install ntp, call guix-daemon with --disable-chroot because you are in an unprivileged container, cache things to avoid pulling the world at each commit). I have a solution based on caching a guix pack containing all your packages: https://framagit.org/divoplade/guix-project variables: GUIX_REF: "--branch=master" PACKAGES: "guile-hall hello" before_script: - test -f cache.tar.gz || apt -qq update - test -f cache.tar.gz || apt -qq install -y wget gpg xz-utils ntp - test -f cache.tar.gz || wget https://sv.gnu.org/people/viewgpg.php?user_id=15145 -qO - | gpg -- import - - test -f cache.tar.gz || wget https://git.savannah.gnu.org/cgit/guix.git/plain/etc/guix-install.sh - test -f cache.tar.gz || chmod ugo+x guix-install.sh - test -f cache.tar.gz || (echo "" ; echo "y") | ./guix-install.sh || echo "Assume OK" - test -f cache.tar.gz || source /root/.config/guix/current/etc/profile - test -f cache.tar.gz || guix-daemon --build-users-group=guixbuild --disable-chroot & - test -f cache.tar.gz || guix pull $GUIX_REF - test -f cache.tar.gz || cp $(guix pack -C gzip $PACKAGES -S/opt/bin=bin) cache.tar.gz - cp cache.tar.gz / - (cd / && tar xf cache.tar.gz) - export PATH=/opt/bin:$PATH cache: key: "$GUIX_REF $PACKAGES" paths: - cache.tar.gz job: script: - hello - hall --help After a very long set up (1/2 hour with a somewhat fast runner), you will leverage the cached guix pack to run the jobs instantly, with the default gitlab runner (unprivileged, debian-based). If you want to update, clear the runner caches, or change the GUIX_REF variable. You can pin a specific commit (better for reproducibility, not so great for releases) with --commit=COMMIT. I could not get guix to run within the job, even with "guix" added to PACKAGES: it would need this in the script: - apt -qq update - apt -qq install -y ntp - (groupadd --system guixbuild && for i in $(seq 1 10) ; do useradd -g guixbuild -G guixbuild -d /var/empty -s $(which nologin) -c "Guix build user $i" --system guixbuilder$i; done) || true - guix-daemon --build-users-group=guixbuild --disable-chroot & - guix archive --authorize < $(dirname $(readlink /usr/local/bin/guix))/../share/guix/ci.guix.info.pub However, if you try it, you will notice a crash. I am looking forward to having guix shipped as a debian package, it will be way easier. divoplade Le samedi 20 juin 2020 à 10:42 +0200, Jérémy Korwin-Zmijowski a écrit : > Hey Guixters ! > > I am experimenting with Gitlab CI for a Guile project I am working > on. > It is managed with Hall and I would like to benefit the Guix > features. > > Currently, I struggle to run Guix inside the default Debian stable > docker image (framagit.org). > > Here is my .gitlab-ci.yml : > > before_script: > - apt -qq update > - apt -qq install -y wget gpg xz-utils > - wget > > https://git.savannah.gnu.org/cgit/guix.git/plain/etc/guix-install.sh > - chmod +x guix-install.sh > - wget https://sv.gnu.org/people/viewgpg.php?user_id=15145 -qO - | > gpg --import - > - printf '\n' | ./guix-install.sh > - /root/.config/guix/current/bin/guix-daemon --build-users- > group=guixbuild > - guix pull > > stages: > - bootstrap > - configure > - build > - test > > job:bootstrap: > stage: bootstrap > script: autoreconf -vfi > > What I get : > > [1592641832.155]: [ FAIL ] unsupported init system; run the daemon > manually: > /root/.config/guix/current/bin/guix-daemon --build-users- > group=guixbuild > [1592641832.155]: [ INFO ] making the guix command available to > other users > > Does anyone has done that before ? > Is there a way to get a Guix docker image instead of the Debian one ? > > Have a nice weekend ! > > Jérémy > >