* oci-container-service-type: Add support for creating networks
@ 2024-09-26 19:31 Nicolas Odermatt-Lemay
2024-09-27 19:29 ` paul
0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Odermatt-Lemay @ 2024-09-26 19:31 UTC (permalink / raw)
To: guix-devel
[-- Attachment #1: Type: text/plain, Size: 832 bytes --]
Hi !
While trying to port a multi-container application meant to be used with
docker-compose to Guix oci-container-service-type, I noticed that
docker-compose creates a single network for all its containers (by
default). Using oci-container-service-type, we can specify a network for
each container but the network needs to exist beforehand, otherwise the
service fails.
So I was wondering if this is something we would want in Guix, the ability
to create a network for a list of containers.
Personally, I ended up adding another shepherd service to create the
network before the containers were created.
If it is something of interest, I'm curious to hear about ideas to
implement this. Adding a field `create-network?' to
`oci-container-service-type' would be a possibility but maybe it is not the
right way to implement this.
[-- Attachment #2: Type: text/html, Size: 993 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: oci-container-service-type: Add support for creating networks
2024-09-26 19:31 oci-container-service-type: Add support for creating networks Nicolas Odermatt-Lemay
@ 2024-09-27 19:29 ` paul
0 siblings, 0 replies; 2+ messages in thread
From: paul @ 2024-09-27 19:29 UTC (permalink / raw)
To: Nicolas Odermatt-Lemay, guix-devel
[-- Attachment #1: Type: text/plain, Size: 1708 bytes --]
Hi Nicolas,
I'm working on a big refactor for the oci-container-service type at [0].
Basically users would be able to write something like the following in
their own configurations:
(simple-service 'oci-monitoring
oci-service-type
(oci-configuration
(volumes (oci-volume-configuration (name "my-volume")))
(networks (oci-network-configuration (name "monitoring")))
(containers
(oci-container-configuration
(image "grafana")
(network "monitoring"))
(oci-container-configuration
(image "prometheus")
(network "monitoring")))))
It is completely compatible and with time I believe would deprecate the
oci-container-service type. It will bring more features besides networks
and volumes, such as support for running on top of rootless podman. It
currently depends on [1] and [2] which bring respectively structured
subuids and subgids support and rootless-podman as a Guix System
service. Once they get in Guix I will upstream the new oci-service-type.
If you'd like to collaborate on the service the development is happening
on gocix [3] let's get in touch :)
I hope to work on [1] this weekend and to have it soon in Guix, if you
have further comments on the implementation let me know!
Cheers,
giacomo
[0]:
https://github.com/fishinthecalculator/guix-fork/compare/master...oci-service-type
[1]: https://issues.guix.gnu.org/72337
[2]: https://issues.guix.gnu.org/72740
[3]:
https://github.com/fishinthecalculator/gocix/blob/main/modules/oci/services/containers.scm
[-- Attachment #2: Type: text/html, Size: 2682 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-09-27 19:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-26 19:31 oci-container-service-type: Add support for creating networks Nicolas Odermatt-Lemay
2024-09-27 19:29 ` paul
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).