* 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
* Re: OCI-backed Guix System Services
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
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Ricardo Wurmus @ 2023-09-20 22:12 UTC (permalink / raw)
To: paul; +Cc: guix-devel
Hi,
> 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 .
Neat!
> 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?
I think this could still be a valuable addition to Guix, because it
integrates with Shepherd and thus unifies management of system services
independent of whether they came from Guix or from elsewhere.
Because integration with Shepherd is nice I wrote the Swineherd which
serves a related need: https://github.com/BIMSBbioinfo/swineherd
--
Ricardo
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: OCI-backed Guix System Services
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
2 siblings, 0 replies; 6+ messages in thread
From: Katherine Cox-Buday @ 2023-09-20 23:10 UTC (permalink / raw)
To: guix-devel; +Cc: guix-devel
On 9/20/23 4:12 PM, Ricardo Wurmus wrote:
>> 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?
>
> I think this could still be a valuable addition to Guix, because it
> integrates with Shepherd and thus unifies management of system services
> independent of whether they came from Guix or from elsewhere.
I completely agree. It would be so nice to have a unified interface to
manage everything!
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: OCI-backed Guix System Services
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
2 siblings, 0 replies; 6+ messages in thread
From: paul @ 2023-09-22 15:23 UTC (permalink / raw)
To: Ricardo Wurmus; +Cc: guix-devel
Hi Ricardo,
On 9/21/23 00:12, Ricardo Wurmus wrote:
> Because integration with Shepherd is nice I wrote the Swineherd which
> serves a related need: https://github.com/BIMSBbioinfo/swineherd
I saw that but I still haven't managed to find the time to play with it,
it looks quite cool :) I'd love to be able to drop docker compose for
local development environment in favor of something like the Swineherd.
giacomo
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: OCI-backed Guix System Services
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
2 siblings, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2023-10-02 14:52 UTC (permalink / raw)
To: Ricardo Wurmus; +Cc: paul, guix-devel
Hi,
Ricardo Wurmus <rekado@elephly.net> skribis:
>> 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 .
>
> Neat!
>
>> 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?
>
> I think this could still be a valuable addition to Guix, because it
> integrates with Shepherd and thus unifies management of system services
> independent of whether they came from Guix or from elsewhere.
I agree, this would be useful to many people I’m sure, in particular to
anyone who doesn’t dare switch to Guix System out of fear of not finding
a specific service.
If there’s a way this could be generalized so others can use it for
daemons other than Grafana, that’d be great.
Ludo’.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: OCI-backed Guix System Services
2023-10-02 14:52 ` Ludovic Courtès
@ 2023-10-02 16:54 ` Alexey Abramov
0 siblings, 0 replies; 6+ messages in thread
From: Alexey Abramov @ 2023-10-02 16:54 UTC (permalink / raw)
To: Ludovic Courtès, Ricardo Wurmus; +Cc: guix-devel, goodoldpaul
I am playing with Talos right now, which is a Kubernetes Linux
distribution. It doesn't provide any ssh access. You can configure it using
api only.
I am wondering if anyone wants to work (or working) on similar thing using
Guix, Shepherd and Goblins.
It would be great to just boot guix with shepherd and program the system
using scheme.
I haven't tested swineherd yet though.
On October 2, 2023 4:52:57 PM Ludovic Courtès <ludo@gnu.org> wrote:
> Hi,
>
> Ricardo Wurmus <rekado@elephly.net> skribis:
>
>>> 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 .
>>
>> Neat!
>>
>>> 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?
>>
>> I think this could still be a valuable addition to Guix, because it
>> integrates with Shepherd and thus unifies management of system services
>> independent of whether they came from Guix or from elsewhere.
>
> I agree, this would be useful to many people I’m sure, in particular to
> anyone who doesn’t dare switch to Guix System out of fear of not finding
> a specific service.
>
> If there’s a way this could be generalized so others can use it for
> daemons other than Grafana, that’d be great.
>
> Ludo’.
^ 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).