unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Gitlab CI
@ 2020-06-20  8:42 Jérémy Korwin-Zmijowski
  2020-06-20 13:40 ` Ricardo Wurmus
                   ` (4 more replies)
  0 siblings, 5 replies; 18+ messages in thread
From: Jérémy Korwin-Zmijowski @ 2020-06-20  8:42 UTC (permalink / raw)
  To: Guix Help

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



^ permalink raw reply	[flat|nested] 18+ messages in thread
* Re: Gitlab CI
@ 2020-07-14 16:12 Stephen Scheck
  0 siblings, 0 replies; 18+ messages in thread
From: Stephen Scheck @ 2020-07-14 16:12 UTC (permalink / raw)
  To: jeremy; +Cc: help-guix

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!



^ permalink raw reply	[flat|nested] 18+ messages in thread
* Re: Gitlab CI
@ 2020-07-29 15:35 Stephen Scheck
  0 siblings, 0 replies; 18+ messages in thread
From: Stephen Scheck @ 2020-07-29 15:35 UTC (permalink / raw)
  To: ludovic.courtes; +Cc: help-guix

Ludovic Courtès writes:

> Hello! I’m late to the party but I’m interested in this discussion… :-)

> GitLab CI can run jobs directly in a Docker image:
>   https://docs.gitlab.com/ce/ci/docker/using_docker_images.html

> So it would be interesting to have any easy way for people to create a Docker image for this purpose.

I’ve updated my Alpine-based Docker image, and I think it should work now for many common use cases,
but it would be great if it saw some more testing. Details here:

   https://hub.docker.com/r/singularsyntax/guix-bootstrap

Cheers -ss



^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2020-07-29 15:36 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-20  8:42 Gitlab CI 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-06 16:30     ` Debian package with " divoplade
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
  -- strict thread matches above, loose matches on Subject: below --
2020-07-14 16:12 Stephen Scheck
2020-07-29 15:35 Stephen Scheck

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).