From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id uFyhF7nlN2WdGQAAG6o9tA:P1 (envelope-from ) for ; Tue, 24 Oct 2023 17:41:45 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id uFyhF7nlN2WdGQAAG6o9tA (envelope-from ) for ; Tue, 24 Oct 2023 17:41:45 +0200 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 C5D096D026 for ; Tue, 24 Oct 2023 17:41:44 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b="Oh/FGKE0"; dmarc=pass (policy=none) header.from=gnu.org; 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-Seal: i=1; s=key1; d=yhetil.org; t=1698162105; a=rsa-sha256; cv=none; b=MtuMwueWEKKzxxJYHBB8DRiF6koPgdg/uH+uy2mpR4fLdWBJLL8di2SUULom8mpYP3I5BF ruuxzEQyM3IA1l9DZyHeRTyK7msa67D0QDN9wA3r+ci48obFjuorv3xn0PNNQSxzM9iXRP sh0VutYLs+Te/wLYiQMZfaZ1jlLiVqOLT6ETW7vGuTKRhq3kKcl2nm5EclWRfsdT48m1vq bogdCWEwB+Vrn8yv7yt9hiApe0OH0QDVkfiMCoa8T1yIO32TnLH4NVDW0CxIGMInxfQnVe N6q3UQKHFWIWP42xz+q3sRMkDKvIULDe7KQ6d2+SFIpjnIuhE/3YbLbfnpZ52g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b="Oh/FGKE0"; dmarc=pass (policy=none) header.from=gnu.org; 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=1698162105; 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: 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=sJu/r/+tK33PNUeMh8mHz7sVqJqMuiaOu1P0NUAJbtQ=; b=VoAzZSjXy7EnH0SRlDefuxRNel8QfQ9gJCfVavNZPjM7ZdI673Ht72sN+H/cWquCRditAC 1zjWxyC+D1YxGoEjflrMDEnWosegsNsYAdNWB2ExBnEDi5+P2INVJjUFaT1v2vbj2zsQaJ QW4SlDKUjkwx9Vz/00jV0QnyHHEFpaRCTojA+ZhHGeHSAamGrDgplS7kr3ZLw5fHR27Sh3 xFwiBx5wvQxMx20tYLfruk/hvHaRvjWnlKutDl9NLE3/jHg5vtGFnt3GOIYp/D88Ri3TiA KpHrMHfzDwW2UXl9Pt0NyGBLM+NAKYxaYJpGsAnJ70/5JkobCObje8Z92VndGA== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qvJXD-0003eq-59; Tue, 24 Oct 2023 11:41:35 -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 1qvJXB-0003cJ-32 for guix-patches@gnu.org; Tue, 24 Oct 2023 11:41:33 -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 1qvJXA-0007ii-Or for guix-patches@gnu.org; Tue, 24 Oct 2023 11:41:32 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qvJXe-00042t-2u for guix-patches@gnu.org; Tue, 24 Oct 2023 11:42:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#66160] [PATCH] gnu: Add oci-container-service-type. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 24 Oct 2023 15:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66160 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: paul Cc: 66160@debbugs.gnu.org Received: via spool by 66160-submit@debbugs.gnu.org id=B66160.169816211315536 (code B ref 66160); Tue, 24 Oct 2023 15:42:02 +0000 Received: (at 66160) by debbugs.gnu.org; 24 Oct 2023 15:41:53 +0000 Received: from localhost ([127.0.0.1]:56345 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qvJXU-00042W-Vy for submit@debbugs.gnu.org; Tue, 24 Oct 2023 11:41:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46280) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qvJXT-00042F-3G for 66160@debbugs.gnu.org; Tue, 24 Oct 2023 11:41:51 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qvJWs-0007ev-JZ; Tue, 24 Oct 2023 11:41:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=sJu/r/+tK33PNUeMh8mHz7sVqJqMuiaOu1P0NUAJbtQ=; b=Oh/FGKE0qMQDZUyk3Q8O zQ5Q7fThkjKwGTc4d/1kpUjVcCpaO1UeEMVup/MhdOdsrqL4oy/WN+Yhq0hgGKZXhc+MvSXgxsdFA gu3+YoOID+ej2t3YoykC86rPfigtrbxBQFWIvRew1bl7auaZnsQVOULqgm+IpkodyK2Fko7Mok7WI 0LoyH42W/YFw+6a4cK2XGLNoGa8QtHhZ0DPL8zFDtwtfN7lJWMaFRjcffwZpwfSsY2gLtKTR2Z3eS QnJpw8VITCCJqR2N3DiIDnH1e8QBade+7qGyXhCRmLoIcvbJOLKUthbZ9b76pTJh6+PoPZIn6oz/h U0cyPvn4BKQSIg==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= In-Reply-To: <16c3e931-09d2-9e85-97f1-c7f78d5ff2ec@autistici.org> (paul's message of "Thu, 19 Oct 2023 23:16:35 +0200") References: <650a02e2-9425-a7fd-2014-7cf6e17ee65b@autistici.org> <8b8a0eed3b02cfd2edb94859da83032c96ee5616.1696619356.git.goodoldpaul@autistici.org> <875y39fao8.fsf@gnu.org> <604138b9-a567-68eb-82fe-d205390636e7@autistici.org> <874jimz7y5.fsf@gnu.org> <16c3e931-09d2-9e85-97f1-c7f78d5ff2ec@autistici.org> Date: Tue, 24 Oct 2023 17:41:11 +0200 Message-ID: <874jig81uw.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx1.migadu.com X-Migadu-Spam-Score: -6.83 X-Spam-Score: -6.83 X-Migadu-Queue-Id: C5D096D026 X-TUID: W9EybXjiYuT0 Hi, paul skribis: [...] >> In that case, maybe create an =E2=80=9Coci-service=E2=80=9D account part= of the =E2=80=9Cdocker=E2=80=9D >> group, and run =E2=80=98docker run=E2=80=99 as that user instead of runn= ing it as root? >> Would that be OK or am I overlooking something? > I already added such user in the latest version of my patch. I > probably made a mess with patch subjects. Oh, my bad; perfect then. >> What I=E2=80=99m suggesting above is that one would build a list of >> =E2=80=98oci-container-service-type=E2=80=99 instances, like: >> >> (list (service oci-container-service-type >> (oci-container-configuration =E2=80=A6)) >> (service oci-container-service-type >> (oci-container-configuration =E2=80=A6)) >> =E2=80=A6) >> >> Each instance above would correspond to exactly one program in a Docker >> image. >> >> I feel it=E2=80=99s slightly more natural than having a service type that >> implements support for multiple OCI services at once. > I agree it's more natural but (list service-a service-b ...) it's the > same interface exposed by the shepherd-root-service-type, I believe > for the same reasons I need the oci-nextcloud-service-type to > instantiate 3 shepherd services but only create a single account, > activate a single data dir under /var/lib, something like this: > > (defineoci-nextcloud-service-type > (service-type(name'nextcloud) > (extensions(list(service-extensionoci-container-service-type > (lambda (config) (make-nextcloud-container config) > (make-nextcloud-cron-container config))) [...] > The only way where oci-container-service-type could support this use > case by accepting a single configuration is I guess if multiple > (service-extension oci-container-service-type ...) where allowed, am I > understanding correctly? Is it legal in Guix to write somthing like: > > (extensions(list(service-extensionoci-container-service-type > make-nextcloud-container) > (service-extensionoci-container-service-typemake-nextcloud-cron-container) > (service-extensionaccount-service-type > (const%nextcloud-accounts)) > (service-extensionactivation-service-type > %nextcloud-activation))) If you take the route of one =E2=80=98oci-container-service-type=E2=80=99 p= er daemon/server that you want to run, then should probably have a =E2=80=98user=E2=80=99 field to specify under which = user to run the container. =E2=80=98oci-container-service-type=E2=80=99 would create e= xactly one Shepherd service so, likewise, would need a =E2=80=98provision=E2=80=99 field to specify the Shepherd service name (t= he =E2=80=9Cprovisions=E2=80=9D). Likewise, perhaps a field to specify the da= ta directory is needed. Does that make sense? Thanks, Ludo=E2=80=99.