From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id qCHUFmZhNWZE8gAAe85BDQ:P1 (envelope-from ) for ; Sat, 04 May 2024 00:12:54 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id qCHUFmZhNWZE8gAAe85BDQ (envelope-from ) for ; Sat, 04 May 2024 00:12:54 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=autistici.org header.s=stigmate header.b="pWxW8/7c"; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1714774374; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=IF73yfKJAY2tF8cE07yKmM09fnTiSTMU/R+ha729Atk=; b=i4GYvh9bW0x3v3KwmuUsLC1gX9CZ/Eg5oVFeEYd9wCnaS7lqg9U0067D/hQF2pFz+b94fD 4iuwF5mIFvH6tQMacSfCUlS1JByR67+cs78UbOWMnH9ay9gimIECjNL6pd3EqScI335j6X wwX8uaK8rWgRKWMXdyrH6Pnl9ntu06s89aq8/RVdAkltg2E4lSKfRqq/RnYXBaLcy+0YiY v7g5zcwdnG3ztaFKkeKDZXjwsiC95NhIuMITVCmXAVPq/It59A+Hbs2PXz729hKXNB2g/6 PvYPSFI2FhVrtn02iX1MagJYC8mM1ZctrKZKoZukZ1gbSQKOgZ/OORTETHDoBQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=autistici.org header.s=stigmate header.b="pWxW8/7c"; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1714774374; a=rsa-sha256; cv=none; b=XxlUdF8HvDAEhfiXgbfioq3I14UNHw7S5QVpz3lFWZjl2gW0ZijHG9jcUSZOxtmyupXJbC arbcEDcCrj7085RjmokChx1nnz+2778qFIQd47M6Mq66T7GyAaPh+AnHpbnOoAGlIVU0lz DVGWFEuYGOErF5rXssbfZR/fufPYgm1KiIYsr8NNioNEpU1L35af6jjpYbrnqy0fwXlH0J Yfq0ocpl0JIo6NJucy9LXwfjjEw8wChtwKkqDKbjDBvymEjg8fCmvsdGF+gcYmXieZeIMq PdDHoemZHjPpIcFYGHcnHd8yFo8ORyk1cASizjcTSpDXxWzYfLaKGT8TF0/O/g== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 3945F106F6 for ; Sat, 4 May 2024 00:12:54 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s318z-0007cG-Qt; Fri, 03 May 2024 18:12:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s318y-0007bH-AY for guix-patches@gnu.org; Fri, 03 May 2024 18:12:40 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s318y-0006gg-0a for guix-patches@gnu.org; Fri, 03 May 2024 18:12:40 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s319K-0005ae-JR for guix-patches@gnu.org; Fri, 03 May 2024 18:13:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#67613] [PATCH v3 3/5] gnu: docker: Allow setting Shepherd dependencies in oci-container-configuration. Resent-From: Giacomo Leidi Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 03 May 2024 22:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67613 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 67613@debbugs.gnu.org Cc: Giacomo Leidi Received: via spool by 67613-submit@debbugs.gnu.org id=B67613.171477432721440 (code B ref 67613); Fri, 03 May 2024 22:13:02 +0000 Received: (at 67613) by debbugs.gnu.org; 3 May 2024 22:12:07 +0000 Received: from localhost ([127.0.0.1]:49151 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s318Q-0005Zj-TW for submit@debbugs.gnu.org; Fri, 03 May 2024 18:12:07 -0400 Received: from confino.investici.org ([2a11:7980:1::2:0]:30459) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s318M-0005Yo-GF for 67613@debbugs.gnu.org; Fri, 03 May 2024 18:12:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1714774298; bh=IF73yfKJAY2tF8cE07yKmM09fnTiSTMU/R+ha729Atk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pWxW8/7cLw/wpJcNrVE/1WiL5WwP10QZMlN9ibtm1XCt4hoIT5xn0N1cyr2vDjxVu fTIcqwnlUYHX+xR7AXMt6hOedJMcJNBpYPR11Bcmh5gFlKWAddMnicF/HuwbhcMPHK PIwj1lm9MAnLSSWqEVI4u4Y0zd+uAZr0EBjEncBs= Received: from mx1.investici.org (unknown [127.0.0.1]) by confino.investici.org (Postfix) with ESMTP id 4VWQ4p2Pd1z11C2; Fri, 3 May 2024 22:11:38 +0000 (UTC) Received: from [93.190.126.19] (mx1.investici.org [93.190.126.19]) (Authenticated sender: goodoldpaul@autistici.org) by localhost (Postfix) with ESMTPSA id 4VWQ4p1wkYz11BS; Fri, 3 May 2024 22:11:38 +0000 (UTC) Date: Sat, 4 May 2024 00:11:15 +0200 Message-ID: <9506edfb6edd9d3f2a8b832caf39005883a04ac2.1714774277.git.goodoldpaul@autistici.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <306393d4c3b28f242fb735d793ef127427f3d072.1714774276.git.goodoldpaul@autistici.org> References: <306393d4c3b28f242fb735d793ef127427f3d072.1714774276.git.goodoldpaul@autistici.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Giacomo Leidi X-ACL-Warn: , Giacomo Leidi via Guix-patches From: Giacomo Leidi via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -6.59 X-Spam-Score: -6.59 X-Migadu-Queue-Id: 3945F106F6 X-Migadu-Scanner: mx13.migadu.com X-TUID: 1J0LvbnMekqF * gnu/services/docker.scm (oci-container-configuration) [requirement]: New field; (list-of-symbols): sanitize it; (oci-container-shepherd-service): use it. * doc/guix.texi: Document it. Change-Id: Ic0ba336a2257d6ef7c658cfc6cd630116661f581 --- doc/guix.texi | 4 ++++ gnu/services/docker.scm | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index fad0bf8c7c..2b9cc5602c 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -40474,6 +40474,10 @@ Miscellaneous Services @item @code{provision} (default: @code{""}) (type: string) Set the name of the provisioned Shepherd service. +@item @code{requirement} (default: @code{'()}) (type: list-of-symbols) +Set additional Shepherd services dependencies to the provisioned +Shepherd service. + @item @code{network} (default: @code{""}) (type: string) Set a Docker network for the spawned container. diff --git a/gnu/services/docker.scm b/gnu/services/docker.scm index df5884aca1..a5b1614fa9 100644 --- a/gnu/services/docker.scm +++ b/gnu/services/docker.scm @@ -320,6 +320,9 @@ (define (oci-sanitize-extra-arguments value) but ~a was found") el)))) value)) +(define list-of-symbols? + (list-of symbol?)) + (define-maybe/no-serialization string) (define-configuration/no-serialization oci-container-configuration @@ -376,6 +379,10 @@ (define-configuration/no-serialization oci-container-configuration (provision (maybe-string) "Set the name of the provisioned Shepherd service.") + (requirement + (list-of-symbols '()) + "Set additional Shepherd services dependencies to the provisioned Shepherd +service.") (network (maybe-string) "Set a Docker network for the spawned container.") @@ -477,6 +484,7 @@ (define (oci-container-shepherd-service config) (oci-container-configuration-host-environment config)) (command (oci-container-configuration-command config)) (provision (oci-container-configuration-provision config)) + (requirement (oci-container-configuration-requirement config)) (image (oci-container-configuration-image config)) (options (oci-container-configuration->options config)) (name (guess-name provision image)) @@ -484,7 +492,7 @@ (define (oci-container-shepherd-service config) (oci-container-configuration-extra-arguments config))) (shepherd-service (provision `(,(string->symbol name))) - (requirement '(dockerd user-processes)) + (requirement `(dockerd user-processes ,@requirement)) (respawn? #f) (documentation (string-append -- 2.41.0