Compare commits

...

11 Commits

Author SHA1 Message Date
Collin J. Doering a90118aebe
CI: Initial (incomplete) implementation 2023-12-31 14:45:57 -05:00
Collin J. Doering ae21f99ddb
Makefile: move required steps prior to docker build to separate target 2023-12-31 14:44:55 -05:00
Collin J. Doering 73cc450f6f
channels.scm: Update guix channel 2023-12-31 14:34:06 -05:00
Collin J. Doering a82b4c2efa
Makefile: Add size PHONY target 2023-12-31 14:34:03 -05:00
Collin J. Doering 692577c025
Dockerfile: Set the env var GUIX_LOCALES to the now installed locales
* Makefile: Provide a symlink for the profiles lib/locale
2023-12-31 14:33:12 -05:00
Collin J. Doering c32f86bc79
manifest.scm: Add utf8 glibc-locals for US and CA 2023-12-31 14:15:34 -05:00
Collin J. Doering a53e0fd61b
manifest.scm: Reorder package listing (noop change) 2023-12-31 14:15:15 -05:00
Collin J. Doering 86f051167b
Correct hidden dependency on host /gnu/store
Unbeknownst to me, the docker image produced by previous versions of guix-builder actually
had a hidden dependency on the hosts /gnu/store. I have not been able to fully characterize
it, but the following proves it to be true.

This fails with an error 139, segfault:
  docker run -it guix-builder:latest

However it succeeds when provided the hosts guix store:
  docker run -it -v /gnu/store:/gnu/store:ro guix-builder:latest

By using GUIX_EXECUTION_ENGINE=proot (which is implied by the '-RR' option to 'guix pack'),
we avoid the segfaults and hidden dependency on the hosts /gnu/store. Sadly using proot will
have performance impacts, but I'm not sure yet to what extent this will impact my usecase.
2023-12-29 21:32:46 -05:00
Collin J. Doering f2786e17ae
Place /etc/passwd file inside the container for root user
This is needed because ssh requires the user that runs it to exist in /etc/passwd.
2023-12-29 12:03:48 -05:00
Collin J. Doering 6c8faca7a4
manifest.scm: Add openssh 2023-12-29 11:30:42 -05:00
Collin J. Doering ba31548ad5
CI: Cleanup Dockerfile and Makefile (following 5764deb) 2023-12-29 11:30:17 -05:00
6 changed files with 53 additions and 30 deletions

View File

@ -1,21 +1,14 @@
name: Gitea Actions Demo
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
name: Guix Builder
run-name: ${{ gitea.actor }} - ${{ gitea.event.head_commit.message }}
on: [push]
jobs:
Explore-Gitea-Actions:
Build:
runs-on: guix
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!"
- run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
- name: Guix version
run: guix --version
- name: Check out repository code
uses: https://github.com/actions/checkout@v3
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: List files in the repository
run: |
ls ${{ gitea.workspace }}
- run: echo "🍏 This job's status is ${{ job.status }}."
- name: Build preparation
run: guix time-machine -C channels.scm -- shell -m manifest-dev.scm -- make pre-build
# - name: Build docker image
# run: guix time-machine -C channels.scm -- shell -m manifest-dev.scm -- make

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
*~
*.tar.gz
passwd

View File

@ -1,6 +1,12 @@
FROM scratch as builder
FROM scratch
ADD guix-tarball-pack.tar.gz /guix-builder
ADD links.tar.gz /
ADD passwd /etc/passwd
ADD passwd /tmp/proot/delete-me
ENV GUIX_LOCPATH=/guix-builder/lib/locale
ENV PROOT_TMP_DIR=/tmp/proot
RUN rm /tmp/proot/delete-me
VOLUME /var/guix/daemon-socket/socket /gnu/store /etc/ssl
ENTRYPOINT ["/guix-builder/bin/bash"]

View File

@ -5,19 +5,30 @@ GUIX_MANIFEST_DEV := manifest-dev.scm
TARBALL ?= guix-tarball-pack.tar.gz
LINKS_TARBALL ?= links.tar.gz
PASSWD_FILE ?= passwd
IMAGE_TAG ?= guix-builder
$(PASSWD_FILE):
echo 'root:x:0:0:root:/root:/bin/sh' > passwd
$(LINKS_TARBALL):
ln -s /guix-builder/bin bin
tar -czvf links.tar.gz bin
tar -czvf $@ bin
rm bin
$(TARBALL):
@cp $$(guix pack -R -S /bin=bin -S /etc/ssl=etc/ssl -m $(GUIX_MANIFEST)) $@
@cp $$(guix pack -RR -S /bin=bin -S /etc/ssl=etc/ssl -S /lib/locale=lib/locale -m $(GUIX_MANIFEST)) $@
@chmod +w $@
.PHONY: size
size: $(TARBALL)
guix size $$(guix pack -RR -S /bin=bin -S /etc/ssl=etc/ssl -m $(GUIX_MANIFEST))
.PHONY: pre-build
pre-build: $(TARBALL) $(LINKS_TARBALL) $(PASSWD_FILE)
.PHONY: build
build: $(TARBALL) $(LINKS_TARBALL)
build: pre-build
@docker build -t $(IMAGE_TAG) .
.PHONY: run
@ -36,4 +47,4 @@ shell:
.PHONY:
clean:
rm -r $(TARBALL) $(LINKS_TARBALL)
rm -r $(TARBALL) $(LINKS_TARBALL) $(PASSWD_FILE)

View File

@ -3,7 +3,7 @@
(url "https://git.savannah.gnu.org/git/guix.git")
(branch "master")
(commit
"1b07f397dc17e31ad55b80a4efd34fdcb5b3c690")
"25b83bd9e4ceb77f08c0caee3ecdc48263b53a46")
(introduction
(make-channel-introduction
"9edb3f66fd807b096b48283debdcddccfea34bad"

View File

@ -1,10 +1,22 @@
(specifications->manifest
(list "bash"
"coreutils"
"gawk"
"git"
"grep"
"guix"
"node"
"nss-certs"
"sed"))
(define minimum-glibc-locales
(make-glibc-utf8-locales
glibc
#:locales (list "en_US" "en_CA")
#:name "glibc-english-canadian-and-us-utf8-locales"))
(concatenate-manifests
(list
(packages->manifest
(list minimum-glibc-locales))
(specifications->manifest
(list
"bash"
"coreutils"
"gawk"
"git"
"grep"
"guix"
"node"
"nss-certs"
"openssh"
"sed"))))