unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* OCI-backed Guix System Services
@ 2023-09-20 14:47 paul
  2023-09-20 22:12 ` Ricardo Wurmus
  0 siblings, 1 reply; 6+ messages in thread
From: paul @ 2023-09-20 14:47 UTC (permalink / raw)
  To: guix-devel

[-- 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 --]

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

end of thread, other threads:[~2023-10-02 16:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-20 14:47 OCI-backed Guix System Services paul
2023-09-20 22:12 ` 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

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