help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Gitlab CI


From: Stephen Scheck
Subject: Re: Gitlab CI
Date: Tue, 14 Jul 2020 12:12:21 -0400

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!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]