From: Stephen Scheck <singularsyntax@gmail.com>
To: jeremy@korwin-zmijowski.fr
Cc: help-guix@gnu.org
Subject: Re: Gitlab CI
Date: Tue, 14 Jul 2020 12:12:21 -0400 [thread overview]
Message-ID: <9E7E0759-1087-4D90-A049-A9769976A713@gmail.com> (raw)
Jérémy Korwin-Zmijowski <jeremy@korwin-zmijowski.fr> writes:
> 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.
>
> Does anyone has done that before ?
> Is there a way to get a Guix docker image instead of the Debian one ?
Hello Jérémy,
I have been trying to accomplish a similar goal - using Guix in GitLab CI for a Guile project. To that end, I’ve built some Docker images you might find interesting:
Guix in Alpine Linux
https://hub.docker.com/r/singularsyntax/guix-bootstrap/tags
https://gitlab.com/singularsyntax-docker-hub/guix-bootstrap (the Dockerfile and pipeline for deployment to Docker Hub)
My goal is to enable typical Docker workflows with Guix, for example something like this Dockerfile:
FROM gnu/guix:1.1.0
RUN guix package —install <some-build-and-test-package-dependencies>
Then use the resulting Docker image in the build, test, etc. stages of a GitLab CI/CD pipeline.
Unfortunately, Guix does not have a natural fit with Docker containerization since `guix-daemon` must be running for any Guix commands to work. I haven’t been able to get any Dockerfile workflows like above working, since `docker build` seems to skip execution of the regular image entry point command which starts `guix-daemon`. I think to make it work, you’d need to provide some kind of shell wrapper around the `guix` command which first starts `guix-daemon`, waits for it to be ready, then runs Guix commands. But you can use the Alpine image for Docker-in-Docker workflows where you first start a container with `docker run`, then issue successive `docker exec` commands to perform work inside the container, then extract the results from the container for use in other stages of a CI/CD pipeline.
I also attempted to build a “pure” Guix container not requiring installation on top of another Linux distribution by using `guix system docker-image <…>`. I even had a GitLab pipeline making daily builds which you might find interesting (but I recently disabled it as I’ll explain below):
https://hub.docker.com/r/singularsyntax/guix/tags
https://gitlab.com/singularsyntax-docker-hub/guix (GitLab CI/CD pipeline for deployment to Docker Hub)
It works fine for obtaining a sandbox for which to experiment interactively with Guix, but has the same problems as the Alpine image, and is even a little worse because there are no “anchor” binaries inside the container, not even `/bin/sh`, until the container init process establishes symlinks into the `/gnu/store` tree. If you try to use it in scripts or CI/CD pipelines, they often fail due to race conditions with the init script, and without `/bin/sh` it’s difficult to reliably assert any pre-conditions inside the container. So it’s a real pain to work with, and I think of little utility for scripting as it currently stands.
Anyway, hopefully this provides some more insight, and good luck!
next reply other threads:[~2020-07-14 16:12 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-14 16:12 Stephen Scheck [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-07-29 15:35 Gitlab CI Stephen Scheck
2020-06-20 8:42 Jérémy Korwin-Zmijowski
2020-06-20 13:40 ` Ricardo Wurmus
2020-06-23 8:54 ` Jérémy Korwin-Zmijowski
2020-06-20 15:05 ` divoplade
2020-06-23 10:15 ` Jérémy Korwin-Zmijowski
2020-06-23 15:24 ` Jérémy Korwin-Zmijowski
2020-06-25 12:32 ` zimoun
2020-06-25 14:10 ` Jérémy Korwin-Zmijowski
2020-06-25 21:32 ` divoplade
2020-07-06 12:25 ` Jérémy Korwin-Zmijowski
2020-07-08 9:41 ` Pierre Neidhardt
2020-07-24 14:30 ` Ludovic Courtès
2020-07-24 22:28 ` divoplade
2020-07-27 7:46 ` Ludovic Courtès
2020-07-27 16:31 ` divoplade
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9E7E0759-1087-4D90-A049-A9769976A713@gmail.com \
--to=singularsyntax@gmail.com \
--cc=help-guix@gnu.org \
--cc=jeremy@korwin-zmijowski.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).