unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: paul <goodoldpaul@autistici.org>
To: guix-devel@gnu.org
Subject: OCI-backed Guix System Services
Date: Wed, 20 Sep 2023 16:47:32 +0200	[thread overview]
Message-ID: <07894441-fd4b-a299-d138-5da88c2c42ab@autistici.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 1822 bytes --]

Dear Guixers,

I was recently inspired from Nix's oci-container feature and wrote a 
thin wrapper around the docker CLI to enable the management of docker 
containers through Shepherd [0]. This enables handling of non packaged 
services through guix system reconfigure and herd start/stop/status .


|(define(grafana-configuration config) | (oci-container-configuration
(image"|grafana/grafana:10.0.1"|)
(network"host")
(ports
`((,port."3000")))
(volumes
`(("/var/lib/grafana"."/var/lib/grafana")
;; Neededbecausegrafana.iniisasymlinktoaniteminthestore.
("/gnu/store"."/gnu/store")
("/etc/grafana/grafana.ini"."/etc/grafana/grafana.ini")))))

(definegrafana-service-type
(service-type(name'grafana)
(extensions(list(service-extensionoci-container-service-type
grafana-configuration)
(service-extensionaccount-service-type
(const%grafana-accounts))
(service-extensionnginx-service-type
grafana-nginx-locations)
(service-extensionactivation-service-type
%grafana-activation)))))


This is somewhat made up code, for a real world example you can have a 
look here [1].

In the future it probably makes sense to be able to switch the "OCI 
backend" to podman, for now I just wanted to figure out if it's 
something that would be useful to the Guix community and if the 
implementation looks right.

To conclude, I'm not advocating for adding OCI-backed services to Guix 
mainstream: in my opinion they should be bootstrapped and built from 
source, but I believe the actual "backend" implementation for such 
services could be useful to have in Guix. What do you think?


Thank you for the wonderful community that Guix still proves to be,

giacomo


[0]: 
https://gitlab.com/orang3/small-guix/-/blob/master/small-guix/services/docker.scm

[1]: 
https://gitlab.com/orang3/guix-nas/-/blob/main/modules/nas/services/grafana.scm

[-- Attachment #2: Type: text/html, Size: 8389 bytes --]

             reply	other threads:[~2023-09-20 14:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-20 14:47 paul [this message]
2023-09-20 22:12 ` OCI-backed Guix System Services Ricardo Wurmus
2023-09-20 23:10   ` Katherine Cox-Buday
2023-09-22 15:23   ` paul
2023-10-02 14:52   ` Ludovic Courtès
2023-10-02 16:54     ` Alexey Abramov

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=07894441-fd4b-a299-d138-5da88c2c42ab@autistici.org \
    --to=goodoldpaul@autistici.org \
    --cc=guix-devel@gnu.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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