unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: 02/02: services: docker: Depend on elogind.
       [not found] ` <20190110041549.3E254204E8@vcs0.savannah.gnu.org>
@ 2019-01-10  8:59   ` Ludovic Courtès
  2019-01-10 12:58     ` Danny Milosavljevic
  0 siblings, 1 reply; 4+ messages in thread
From: Ludovic Courtès @ 2019-01-10  8:59 UTC (permalink / raw)
  To: guix-devel, Danny Milosavljevic

guix-commits@gnu.org skribis:

> commit f946a370edbf65baab41e8373e25157da5029a88
> Author: Danny Milosavljevic <dannym@scratchpost.org>
> Date:   Thu Jan 10 05:14:43 2019 +0100
>
>     services: docker: Depend on elogind.
>     
>     * gnu/services/docker.scm (docker-shepherd-service)[requirement]: Add elogind.
> ---
>  gnu/services/docker.scm | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/services/docker.scm b/gnu/services/docker.scm
> index c88fc34..9e24bcd 100644
> --- a/gnu/services/docker.scm
> +++ b/gnu/services/docker.scm
> @@ -70,7 +70,8 @@
>      (shepherd-service
>             (documentation "Docker daemon.")
>             (provision '(dockerd))
> -           (requirement '(containerd))
> +           ;; Note: elogind is required because it's mounting the cgroups.
> +           (requirement '(containerd elogind))

Cgroup file systems are mounted by the corresponding file system
services:

--8<---------------cut here---------------start------------->8---
$ sudo herd status | grep cgroup
 + file-system-/sys/fs/cgroup
 + file-system-/sys/fs/cgroup/blkio
 + file-system-/sys/fs/cgroup/cpu
 + file-system-/sys/fs/cgroup/cpuacct
 + file-system-/sys/fs/cgroup/cpuset
 + file-system-/sys/fs/cgroup/devices
 + file-system-/sys/fs/cgroup/elogind
 + file-system-/sys/fs/cgroup/freezer
 + file-system-/sys/fs/cgroup/memory
 + file-system-/sys/fs/cgroup/perf_event
--8<---------------cut here---------------end--------------->8---

Should it depend on ‘file-system-/sys/fs/cgroup/elogind’, or maybe both
‘elogind’ and ‘file-system-/sys/fs/cgroup/elogind’?  Depends on what it
expects from elogind I guess…

Ludo’.

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

* Re: 02/02: services: docker: Depend on elogind.
  2019-01-10  8:59   ` 02/02: services: docker: Depend on elogind Ludovic Courtès
@ 2019-01-10 12:58     ` Danny Milosavljevic
  2019-01-10 13:57       ` Danny Milosavljevic
  2019-01-10 22:13       ` Ludovic Courtès
  0 siblings, 2 replies; 4+ messages in thread
From: Danny Milosavljevic @ 2019-01-10 12:58 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

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

Hi Ludo,

On Thu, 10 Jan 2019 09:59:02 +0100
Ludovic Courtès <ludo@gnu.org> wrote:

> Cgroup file systems are mounted by the corresponding file system
> services:
> 
> --8<---------------cut here---------------start------------->8---
> $ sudo herd status | grep cgroup
>  + file-system-/sys/fs/cgroup
>  + file-system-/sys/fs/cgroup/blkio
>  + file-system-/sys/fs/cgroup/cpu
>  + file-system-/sys/fs/cgroup/cpuacct
>  + file-system-/sys/fs/cgroup/cpuset
>  + file-system-/sys/fs/cgroup/devices
>  + file-system-/sys/fs/cgroup/elogind
>  + file-system-/sys/fs/cgroup/freezer
>  + file-system-/sys/fs/cgroup/memory
>  + file-system-/sys/fs/cgroup/perf_event
> --8<---------------cut here---------------end--------------->8---
> 
> Should it depend on ‘file-system-/sys/fs/cgroup/elogind’, or maybe both
> ‘elogind’ and ‘file-system-/sys/fs/cgroup/elogind’?  Depends on what it
> expects from elogind I guess…

Oh!

I think Docker doesn't expect anything from elogind.

Docker uses these cgroups and these capabilities:

* "memory": memory limit
* "memory": swap limit
* "memory": memory swappiness
* "memory": memory soft limit
* "memory": kernel memory limit
* "pids": pids limit
* "cpu": cpu cfs period/quota
* "cpu": CPU shares
* "cpu": CPU cfs
* "cpuset": cpus, mems
* "blkio": Block I/O weight
* "blkio": BPS Block I/O read limit
* "blkio": BPS Block I/O write limit
* "blkio": IOPS Block I/O read limit
* "blkio": IOPS Block I/O write limit
* "devices": List devices

Can I just repeat

 (service-extension file-system-service-type (const %elogind-file-systems))

[or a subset thereof]

in the docker service type and not have to have elogind in the config
at all?  Is that safe?  (i.e. will it mount the file systems just once?)

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: 02/02: services: docker: Depend on elogind.
  2019-01-10 12:58     ` Danny Milosavljevic
@ 2019-01-10 13:57       ` Danny Milosavljevic
  2019-01-10 22:13       ` Ludovic Courtès
  1 sibling, 0 replies; 4+ messages in thread
From: Danny Milosavljevic @ 2019-01-10 13:57 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

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

Replying to myself:

> Can I just repeat
> 
>  (service-extension file-system-service-type (const %elogind-file-systems))
> 
> [or a subset thereof]
> 
> in the docker service type and not have to have elogind in the config
> at all?  Is that safe?  (i.e. will it mount the file systems just once?)

Nope.

Throw to key `srfi-34' with args `(#<condition &message [message: "service 'file-system-/sys/fs/cgroup' provided more than once"] 25ddca0>)'.

That's too bad...

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: 02/02: services: docker: Depend on elogind.
  2019-01-10 12:58     ` Danny Milosavljevic
  2019-01-10 13:57       ` Danny Milosavljevic
@ 2019-01-10 22:13       ` Ludovic Courtès
  1 sibling, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2019-01-10 22:13 UTC (permalink / raw)
  To: Danny Milosavljevic; +Cc: guix-devel

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

Hi,

Danny Milosavljevic <dannym@scratchpost.org> skribis:

>> Should it depend on ‘file-system-/sys/fs/cgroup/elogind’, or maybe both
>> ‘elogind’ and ‘file-system-/sys/fs/cgroup/elogind’?  Depends on what it
>> expects from elogind I guess…
>
> Oh!
>
> I think Docker doesn't expect anything from elogind.
>
> Docker uses these cgroups and these capabilities:
>
> * "memory": memory limit
> * "memory": swap limit
> * "memory": memory swappiness
> * "memory": memory soft limit
> * "memory": kernel memory limit
> * "pids": pids limit
> * "cpu": cpu cfs period/quota
> * "cpu": CPU shares
> * "cpu": CPU cfs
> * "cpuset": cpus, mems
> * "blkio": Block I/O weight
> * "blkio": BPS Block I/O read limit
> * "blkio": BPS Block I/O write limit
> * "blkio": IOPS Block I/O read limit
> * "blkio": IOPS Block I/O write limit
> * "devices": List devices
>
> Can I just repeat
>
>  (service-extension file-system-service-type (const %elogind-file-systems))
>
> [or a subset thereof]
>
> in the docker service type and not have to have elogind in the config
> at all?  Is that safe?  (i.e. will it mount the file systems just once?)

I was just suggesting to change the ‘requirements’ field of the Shepherd
service itself.

Now, you could also do what you say, but to avoid the “provided more
than once” error, we probably need this:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 566 bytes --]

diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 6e99cbfec4..9fe0710717 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -465,7 +465,8 @@ FILE-SYSTEM."
 
 (define (file-system-shepherd-services file-systems)
   "Return the list of Shepherd services for FILE-SYSTEMS."
-  (let* ((file-systems (filter file-system-mount? file-systems)))
+  (let* ((file-systems (filter file-system-mount?
+                               (delete-duplicates file-systems))))
     (define sink
       (shepherd-service
        (provision '(file-systems))

[-- Attachment #3: Type: text/plain, Size: 95 bytes --]


The duplicate entries would still appear in /etc/fstab, but maybe that’s
OK.

Ludo’.

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

end of thread, other threads:[~2019-01-10 22:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20190110041548.28584.50889@vcs0.savannah.gnu.org>
     [not found] ` <20190110041549.3E254204E8@vcs0.savannah.gnu.org>
2019-01-10  8:59   ` 02/02: services: docker: Depend on elogind Ludovic Courtès
2019-01-10 12:58     ` Danny Milosavljevic
2019-01-10 13:57       ` Danny Milosavljevic
2019-01-10 22:13       ` Ludovic Courtès

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