From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 6E4AMqeih2aARQEAe85BDQ:P1 (envelope-from ) for ; Fri, 05 Jul 2024 07:37:12 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id 6E4AMqeih2aARQEAe85BDQ (envelope-from ) for ; Fri, 05 Jul 2024 09:37:11 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1720165031; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: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; bh=eB2W8g+yq+/+lD3PXGMSbPVk5lky5K6gH1Bc4MluWz0=; b=pIkRbHinq4A1VjW7+gvKB03LG2lbhKgzumb51K7sEnRRtr/+Hnxbe9Nut22QzrBNDzIkHU eSA6As/ufDYFXilcAT8MRsOfqXk/essBKqVfPlSuDXriEw3zjwmzNW34sq+GcIJmq4GjYj BkfsNWe2t/l4WRX6cunQ+68uWbr+2ebxq5XAZQTIP5bzDlUms+K0h/Tl9bkPrfxr0dZfmf kZAjTyClDImtgE1ZAzpz0Z4Radkql9/HndUULjnqKJogau3MkNTfcL7O7X62RPI5BbTIjz mKGJKSK9dJFer+Z2qrUgXZIrYajAIYdcTJtpnmQS4FvrEIjk2KzqWOY+MZpOdg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1720165031; a=rsa-sha256; cv=none; b=acLpdvFc7L4LQ47nse5wnZTU0l8MDT/meZUkUdixGFAkmzMQNoirmtyI/zhwi4QybEDZKl dm9fihHl3fkE/V7dvtaWydS8+8Eqrk4e9yXBb2mn/k+LjpuGZNoJQw+kg4rPo89yVGcVfj W5YT3vefphCw41PwKSIddsKTyu7k8DtyyF7lUX08gubJRIWBaZD6e0O3cEnCRHl1klA6oy 7Ssc7m/wbtVOgLN5iO4/C/ExBFbpS5ewI+eUbyWFwpg/Pa7QIhvZTyas3NOnci6BSwmmij DH4qidZ0Y0uacsi/cDmlDjdfZjvf2hSxnaC4QV+7W2gnz6+Zcnao28nInpXV4g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; 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" 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 6748E7B36A for ; Fri, 05 Jul 2024 09:37:11 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPdV8-00047D-Dn; Fri, 05 Jul 2024 03:37:02 -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 1sPdV5-0003u9-7S for guix-patches@gnu.org; Fri, 05 Jul 2024 03:36:59 -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 1sPdV4-00058U-V2 for guix-patches@gnu.org; Fri, 05 Jul 2024 03:36:58 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sPdV7-0000Nh-Oj for guix-patches@gnu.org; Fri, 05 Jul 2024 03:37:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#71263] [PATCH v2 2/5] gnu: docker: Allow setting Shepherd log-file in oci-container-configuration. Resent-From: Zheng Junjie Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 05 Jul 2024 07:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71263 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 71263@debbugs.gnu.org Cc: goodoldpaul@autistici.org, maxim.cournoyer@gmail.com, ludo@gnu.org, pelzflorian@pelzflorian.de, matt@excalamus.com X-Debbugs-Original-To: Giacomo Leidi via Guix-patches via X-Debbugs-Original-Cc: Giacomo Leidi , Maxim Cournoyer , 71263@debbugs.gnu.org, Ludovic =?UTF-8?Q?Court=C3=A8s?= , Florian Pelz , Matthew Trzcinski Received: via spool by submit@debbugs.gnu.org id=B.17201649931420 (code B ref -1); Fri, 05 Jul 2024 07:37:01 +0000 Received: (at submit) by debbugs.gnu.org; 5 Jul 2024 07:36:33 +0000 Received: from localhost ([127.0.0.1]:43473 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sPdUe-0000Mq-FJ for submit@debbugs.gnu.org; Fri, 05 Jul 2024 03:36:32 -0400 Received: from lists.gnu.org ([209.51.188.17]:47266) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sPdUc-0000Mg-4X for submit@debbugs.gnu.org; Fri, 05 Jul 2024 03:36:30 -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 1sPdUZ-0003gq-0m for guix-patches@gnu.org; Fri, 05 Jul 2024 03:36:27 -0400 Received: from smtp81.cstnet.cn ([159.226.251.81] helo=cstnet.cn) by eggs.gnu.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1sPdUW-0004ws-Bb; Fri, 05 Jul 2024 03:36:26 -0400 Received: from m (unknown [107.174.64.25]) by APP-03 (Coremail) with SMTP id rQCowACnrHxboodmrgcgFA--.58783S2; Fri, 05 Jul 2024 15:36:02 +0800 (CST) From: Zheng Junjie In-Reply-To: (Giacomo Leidi via Guix-patches via's message of "Tue, 11 Jun 2024 22:04:57 +0200") References: Date: Fri, 05 Jul 2024 15:35:49 +0800 Message-ID: <878qygi94a.fsf@iscas.ac.cn> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-CM-TRANSID: rQCowACnrHxboodmrgcgFA--.58783S2 X-Coremail-Antispam: 1UD129KBjvJXoWxJw18Cr4kJry8KFW8WFW3ZFb_yoWrWryrpa s7u3WFg347trn8AwsYvwnY9FW3Zrn7Kry5Cw4kXa4xAF1DuFyqkr12kFnIvw4xWrs7Jr15 XryFgF15Wr4kJaDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUvmb7Iv0xC_Kw4lb4IE77IF4wAFF20E14v26r4j6ryUM7CY07I2 0VC2zVCF04k26cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rw A2F7IY1VAKz4vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Xr0_Ar1l84ACjcxK6xII jxv20xvEc7CjxVAFwI0_Cr0_Gr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I 8E87Iv6xkF7I0E14v26rxl6s0DM2vj62AExVA0xI801c8C04v26x02cVCv0xWle2I262IY c4CY6c8Ij28IcVAaY2xG8wASzI0EjI02j7AqF2xKxwAqx4xG64xvF2IEw4CE5I8CrVC2j2 WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkE bVWUJVW8JwACjcxG0xvEwIxGrwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJV W8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF 1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6x IIjxv20xvEc7CjxVAFwI0_Jr0_Gr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvE x4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Jr0_GrUvcSsGvfC2KfnxnU UI43ZEXa7IUeqXd5UUUUU== X-Originating-IP: [107.174.64.25] X-CM-SenderInfo: x2kh0wxmxqyx3h6l2u1dvotugofq/ Received-SPF: pass client-ip=159.226.251.81; envelope-from=zhengjunjie@iscas.ac.cn; helo=cstnet.cn X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: , 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: -4.19 X-Spam-Score: -4.19 X-Migadu-Queue-Id: 6748E7B36A X-Migadu-Scanner: mx11.migadu.com X-TUID: yyIUTnbCYscC --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Giacomo Leidi via Guix-patches via writes: > * gnu/services/docker.scm (oci-container-configuration) > [log-file]: New field; > (oci-container-shepherd-service): use it. > > * doc/guix.texi: Document it. > > Change-Id: Icad29ac6342b6f5bafc0d9be13a93cee99674185 > --- > doc/guix.texi | 5 +++++ > gnu/services/docker.scm | 19 +++++++++++++++---- > 2 files changed, 20 insertions(+), 4 deletions(-) > > diff --git a/doc/guix.texi b/doc/guix.texi > index 5a06d7cdc5..40296fcd5f 100644 > --- a/doc/guix.texi > +++ b/doc/guix.texi > @@ -40698,6 +40698,11 @@ Miscellaneous Services > Set additional Shepherd services dependencies to the provisioned > Shepherd service. >=20=20 > +@item @code{log-file} (default: @code{""}) (type: string) ^^^^^^^^^^^^^^^^^^^^ i remove it, because it is not "". > +@item @code{log-file} (default: @code{""}) (type: string) ^^^^^^ maybe-string > +When @code{log-file} is set, it names the file to which the service's > +standard output and standard error are redirected. @code{log-file} is c= reated > +if it does not exist, otherwise it is appended to. > + > @item @code{network} (default: @code{""}) (type: string) > Set a Docker network for the spawned container. >=20=20 > diff --git a/gnu/services/docker.scm b/gnu/services/docker.scm > index cc1201508c..678e8b1139 100644 > --- a/gnu/services/docker.scm > +++ b/gnu/services/docker.scm > @@ -74,6 +74,7 @@ (define-module (gnu services docker) > oci-container-configuration-image > oci-container-configuration-provision > oci-container-configuration-requirement > + oci-container-configuration-log-file > oci-container-configuration-network > oci-container-configuration-ports > oci-container-configuration-volumes > @@ -461,6 +462,11 @@ (define-configuration/no-serialization oci-container= -configuration > (list-of-symbols '()) > "Set additional Shepherd services dependencies to the provisioned She= pherd > service.") > + (log-file > + (maybe-string) > + "When @code{log-file} is set, it names the file to which the service= =E2=80=99s > +standard output and standard error are redirected. @code{log-file} is c= reated > +if it does not exist, otherwise it is appended to.") > (network > (maybe-string) > "Set a Docker network for the spawned container.") > @@ -669,12 +675,16 @@ (define (oci-container-shepherd-service config) > (host-environment > (oci-container-configuration-host-environment config)) > (command (oci-container-configuration-command config)) > + (log-file (oci-container-configuration-log-file config)) > (provision (oci-container-configuration-provision config)) > (requirement (oci-container-configuration-requirement config)) > (image (oci-container-configuration-image config)) > (image-reference (oci-image-reference image)) > (options (oci-container-configuration->options config)) > (name (guess-name provision image)) > + (loader (if (oci-image? image) > + (%oci-image-loader name image image-reference) > + #f)) > (extra-arguments > (oci-container-configuration-extra-arguments config))) >=20=20 > @@ -687,10 +697,8 @@ (define (oci-container-shepherd-service config) > (if (oci-image? image) name image) ".")) > (start > #~(lambda () > - #$@(if (oci-image? image) > - #~((invoke #$(%oci-image-loader > - name image image-referen= ce))) > - #~()) > + (when #$(oci-image? image) > + (invoke #$loader)) if (oci-image? image) return #f ``` (when #f (invoke #f)) ``` This is noise in the file. > (fork+exec-command > ;; docker run [OPTIONS] IMAGE [COMMAND] [ARG= ...] > (list #$docker "run" "--rm" "--name" #$name > @@ -698,6 +706,9 @@ (define (oci-container-shepherd-service config) > #$image-reference #$@command) > #:user #$user > #:group #$group > + #$@(if (maybe-value-set? log-file) > + (list #:log-file log-file) > + '()) > #:environment-variables > (list #$@host-environment)))) > (stop --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEfr6klGDOXiwIdX/bO1qpk+Gi3/AFAmaHolUACgkQO1qpk+Gi 3/CtOw//Wg8loOqdgw+Q+fS3iH01hnLSaiiKS3eWIJkqgAl1P5F2xUBgKxYTQGvF iNYrpNYcGgSKij50gjpnuyXFjU7KM+Lk0XU6fFPtSa1jisgdszRRUQTOpBgZWRu9 pgcGwe6wulldNYRlZ8cH7EwIE5VlzUlrmV+tNehbrIAtZJxHb0tD4sUC7bzlQcMb IEFtvLmumQsakIWPBE/43DT+WFK6CZqr7NUTk+quRgBa8hujKmiZUOVAJWSo0gOU FtJBHpSGtBJJLAgUXWreQjAShpRvVZtEZWn/diluRVZ/0Aql3wlFs87jX7qSxzMu rZtmgXEHZV54uKDZ1bdJfBPfLnONUis68KQTIIFlUaXIo0G+rxhwS8OpJn8NWYPj 1a/wt85AoDdTSl4fr3+phxhZddtFj3MSWnpVSQfgnYdSuNfLQ91Mnh5+RZ6fiR5i chagrimJ+/gLuQx52doKerLlIa8YSc84IIoU9GVm8sLIXN2hqQMbvDSNxfV5q4NY a9bY2QuVHZYa2mQCuv/2GREcRUmUQd6Md18CavtzdRyOB73+aWL7oKeEPZwbKE0s BQaGUNWlQhDo5dC9sR1T272c7gIx+6VoY/VsPSW1EVsWDn6XCOJuLQmeCXOE09ID 01tQMO/xsW9ddC13n4XjjraxMG2UcJkstY3piNQIyJiBIy7S7X0= =g6XR -----END PGP SIGNATURE----- --=-=-=--