From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id YD4sNYyuQmEakAAAgWs5BA (envelope-from ) for ; Thu, 16 Sep 2021 04:40:12 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id wD/ZMIyuQmFwHgAAB5/wlQ (envelope-from ) for ; Thu, 16 Sep 2021 02:40:12 +0000 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 DB0A115040 for ; Thu, 16 Sep 2021 04:40:11 +0200 (CEST) Received: from localhost ([::1]:58888 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mQhJq-0005Dd-KI for larch@yhetil.org; Wed, 15 Sep 2021 22:40:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53086) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQhJi-0005DU-JZ for guix-patches@gnu.org; Wed, 15 Sep 2021 22:40:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:41995) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mQhJi-0000kS-CX for guix-patches@gnu.org; Wed, 15 Sep 2021 22:40:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mQhJi-0001nD-2b for guix-patches@gnu.org; Wed, 15 Sep 2021 22:40:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50326] [PATCH cuirass v2] Add systemd unit file for remote worker service. Resent-From: Thiago Jung Bauermann Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Sep 2021 02:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50326 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 50326@debbugs.gnu.org, Thiago Jung Bauermann Received: via spool by 50326-submit@debbugs.gnu.org id=B50326.16317599626842 (code B ref 50326); Thu, 16 Sep 2021 02:40:02 +0000 Received: (at 50326) by debbugs.gnu.org; 16 Sep 2021 02:39:22 +0000 Received: from localhost ([127.0.0.1]:53541 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mQhJ0-0001mD-70 for submit@debbugs.gnu.org; Wed, 15 Sep 2021 22:39:22 -0400 Received: from mx.kolabnow.com ([95.128.36.41]:45098 helo=ext-mx-out001.mykolab.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mQhIu-0001lw-Uf for 50326@debbugs.gnu.org; Wed, 15 Sep 2021 22:39:16 -0400 Received: from localhost (unknown [127.0.0.1]) by ext-mx-out001.mykolab.com (Postfix) with ESMTP id C295AE5D; Thu, 16 Sep 2021 04:39:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-transfer-encoding:content-type:content-type:mime-version :references:in-reply-to:message-id:date:date:subject:subject :from:from:received:received:received; s=dkim20160331; t= 1631759944; x=1633574345; bh=c55vfKFfUa9+Di3Fjr6++/szHqfulJUVdiF CQRzB+GQ=; b=JMBy7XqwLz9Md9L6h//HRX1cwisQ6jMeEpHvD4Q1tp/eoay0wZk j0Y/vX1Gs5U0GQBzFQvWwt9vhrAPqlZ9dRe84/7Xykzdau9Zf1pRDZO9/81LK9xG 9KyeEDLaMiTmENJkNT+j33V3hTGeHtzAZKgJz83/0ZKnw8DRF1W8ht2TMoF2MJZ1 M+5iJ7OlUlCyIU9wZlvOQfCoegx4NesXbR81gzm00rkXAUkJQjt7ffixupbqTen1 yuc2YYCwSd+1q+dszdKedy1tctxjLdL39ZIQXW2kqKSiz/gXRguv/fCHDchSW9x6 ja9op0IF+pv5i07YZccM/OyPEAV90u9eyQq3iy2qJ92/p7edRu7Lh4mrtd2vYC0f eXWerXZ/k738OhyCpmLd06oGh+LoEPUo3Gox2TYMTPcuZhEzdKaTerKRzvInUe5/ TbURWcgUVAbV6uq+UNF4s+Fp/sQK62UwTgXe0uIfg2pWABc0I90KKssONp+Xb3qR wnNuycjSDda2mSRgboVLHDPEOKRLGgmcQvtzjjFZbJ+SK7bDa03WAO7XAJv6BUHL NgdKIxm6hj8bxGp5d8s0B5O1LnvPMRreJ3AzLyX7POf15mC6hZ9+5FSXSZ0DnG+T BH+8FngiSApJhHQO7P0H8xm46HAbdm4DQYa415mglhbRslE1OKiUGOQo= X-Virus-Scanned: amavisd-new at mykolab.com Received: from ext-mx-out001.mykolab.com ([127.0.0.1]) by localhost (ext-mx-out001.mykolab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jU4v2befB8vy; Thu, 16 Sep 2021 04:39:04 +0200 (CEST) Received: from int-mx001.mykolab.com (unknown [10.9.13.1]) by ext-mx-out001.mykolab.com (Postfix) with ESMTPS id 6DD5C364; Thu, 16 Sep 2021 04:39:04 +0200 (CEST) Received: from ext-subm001.mykolab.com (unknown [10.9.6.1]) by int-mx001.mykolab.com (Postfix) with ESMTPS id 0AE2764D; Thu, 16 Sep 2021 04:39:03 +0200 (CEST) Date: Wed, 15 Sep 2021 23:38:44 -0300 Message-Id: <20210916023844.77190-1-bauermann@kolabnow.com> In-Reply-To: <87czpj2ml9.fsf@gnu.org> References: <87czpj2ml9.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: Thiago Jung Bauermann X-ACL-Warn: , Thiago Jung Bauermann via Guix-patches From: Thiago Jung Bauermann via Guix-patches via X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1631760012; 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-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=c55vfKFfUa9+Di3Fjr6++/szHqfulJUVdiFCQRzB+GQ=; b=OjBvQI0UC9OOLyBrFE+rDJqlEWgqErbtDd9vRQMWqc5DbbNyN1A/ezCAnRbD8ZhuFPZWuj 5Bi9TeZIbAFzxo45tYWyRYvcWMXFwwdbfkFE4CJApli4jnyJjJrXBg/a1IUrBZ189p3w8q HO8RZ+5m3uHu9Vnefw2hrLfTE7v9SfyMO8q14RWxP/DEMAX6+vn6SSTav/+Y1OlmBLBx0N nwn+MfEYBtV6tzR7vJUhOiwbcbCMLRtd+z32E/rtEJVuyBByupF1IpPLNkVC3tCPMPOcrR +foyFjHWhsVC474omsxEIKsQq6M69oiJpxCaeBoAShmrjiHyJGAdAjIdZNqEdQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1631760012; a=rsa-sha256; cv=none; b=HI0EiFz6tyABxRbTTgFH/kgVCLYc39yd3igaY1mQbtrEo9iyH64uJtD84FOZ8QnOzit1kf j5/aMKhnC/+z49gPY+KB0hdAmDdkrtfxHavkOrjEWiKMuDzmR2YcIcsks5WphluNy/KR9P /B1ITuhiqNUnCOPEhdvyjxoKs6ecwoyfWzGZSRjiLsieBv5jo/v0LjX2ajxEHTQVdY7RcH qf/2qpPmtPVH1wybHPP92lakrPgc95N5uIe23srXiFdmUZ/OTbAkdt8pGW4squ8g8q6vkJ swFY2SPnSSjwiiBXEk5Tpl9kIIkO2/Q4uMpcXH7vdMib4xYdWbyKmEuRV2waaA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=kolabnow.com header.s=dkim20160331 header.b=JMBy7Xqw; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -2.90 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=kolabnow.com header.s=dkim20160331 header.b=JMBy7Xqw; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: DB0A115040 X-Spam-Score: -2.90 X-Migadu-Scanner: scn0.migadu.com X-TUID: KsO+f9W4E7/R * etc/cuirass-remote-worker.service.in: New file. * doc/cuirass.texi (Build modes): Mention it. * .gitignore: Ignore it. * Makefile.am (systemdservicedir): New variable. (dist_systemdservice_DATA): Likewise. (EXTRA_DIST): Add ‘etc/cuirass-remote-worker.service’. (etc/cuirass-remote-worker.service): New target. * configure.ac: Check for ‘(guix config)’ module. Set and substitute ‘guix_localstatedir’ variable. --- Hello Ludo, I wanted to send the other patch with the new systemd files for ‘guix gc’ (issue 50610), so I took the opportunity to also work on this one. Em quarta-feira, 8 de setembro de 2021, às 11:01:06 -03, Ludovic Courtès escreveu: > I’d prefer installing it to $sysconfdir, similar to how we do it in > Guix. That makes it easier for interested users to locate the right > .service and to install it, right after they’ve done ‘guix install > cuirass’. Guix actually installs its systemd files in $libdir, so I did the same for Cuirass. Feel free to change the patch to install to another place if you prefer. Thanks, Thiago .gitignore | 1 + Makefile.am | 8 ++++++++ configure.ac | 4 ++++ doc/cuirass.texi | 13 +++++++++++++ etc/cuirass-remote-worker.service.in | 15 +++++++++++++++ 5 files changed, 41 insertions(+) create mode 100644 etc/cuirass-remote-worker.service.in diff --git a/.gitignore b/.gitignore index 95ed6cb3982c..0807874e9513 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,7 @@ /config.cache /configure /doc/version.texi +/etc/cuirass-remote-worker.service /src/cuirass/config.scm /tests/cache Makefile diff --git a/Makefile.am b/Makefile.am index 1d754673f450..6cfa3d70e612 100644 --- a/Makefile.am +++ b/Makefile.am @@ -45,6 +45,7 @@ cssdir = $(staticdir)/css fontsdir = $(staticdir)/fonts imagesdir = $(staticdir)/images jsdir = $(staticdir)/js +systemdservicedir = $(libdir)/systemd/system dist_pkgmodule_DATA = \ src/cuirass/base.scm \ @@ -129,6 +130,9 @@ dist_js_DATA = \ src/static/js/jquery-3.3.1.min.js \ src/static/js/popper.min.js +dist_systemdservice_DATA = \ + etc/cuirass-remote-worker.service + TEST_EXTENSIONS = .scm .sh AM_TESTS_ENVIRONMENT = \ env GUILE_AUTO_COMPILE='0' \ @@ -188,6 +192,7 @@ EXTRA_DIST = \ bootstrap \ build-aux/guix.scm \ src/cuirass/config.scm.in \ + etc/cuirass-remote-worker.service.in \ $(TESTS) dist-hook: gen-ChangeLog @@ -247,6 +252,9 @@ $(bin_SCRIPTS): Makefile $(generate_file); chmod +x $@ src/cuirass/config.scm: $(srcdir)/src/cuirass/config.scm.in Makefile $(generate_file) +etc/cuirass-remote-worker.service: $(srcdir)/etc/cuirass-remote-worker.service.in \ + Makefile + $(generate_file) # Guile modules require 'src/cuirass/config.scm' to exist before their # compilation. diff --git a/configure.ac b/configure.ac index 479e93a1cb8e..af294c16d025 100644 --- a/configure.ac +++ b/configure.ac @@ -47,6 +47,7 @@ GUILE_MODULE_REQUIRED([avahi]) GUILE_MODULE_REQUIRED([fibers]) GUILE_MODULE_REQUIRED([guix]) GUILE_MODULE_REQUIRED([guix git]) +GUILE_MODULE_REQUIRED([guix config]) GUILE_MODULE_REQUIRED([git]) GUILE_MODULE_REQUIRED([json]) GUILE_MODULE_REQUIRED([mailutils mailutils]) @@ -58,6 +59,9 @@ GUILE_MODULE_REQUIRED([zlib]) # We depend on new Guile-Git errors. GUILE_MODULE_REQUIRED_EXPORT([(git)], git-error-message) +guix_localstatedir="$($GUILE -c '(import (guix config)) (display %localstatedir)')" +AC_SUBST(guix_localstatedir) + AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([pre-inst-env:build-aux/pre-inst-env.in], [chmod +x pre-inst-env]) diff --git a/doc/cuirass.texi b/doc/cuirass.texi index 72b0b5b0913a..21d25569339a 100644 --- a/doc/cuirass.texi +++ b/doc/cuirass.texi @@ -463,6 +463,19 @@ The easiest way to setup such an infrastructure is to rely on the GNU Guix Cuirass services definitions (@pxref{Continuous Integration, Continuous Integration,, guix, Guix}). +Alternatively, there is a systemd service unit file installed at +@code{$CUIRASS_PREFIX/lib/systemd/system/cuirass-remote-worker.service} +to launch the @code{cuirass remote-worker} on systems which use +systemd. It can be installed and enabled as follows: + +@example +sudo install -o root -g root -m 644 \ + $CUIRASS_PREFIX/lib/systemd/system/cuirass-remote-worker.service \ + /etc/systemd/system +sudo systemctl enable cuirass-remote-worker.service +sudo systemctl start cuirass-remote-worker.service +@end example + @c ********************************************************************* @node Invocation @chapter Invocation diff --git a/etc/cuirass-remote-worker.service.in b/etc/cuirass-remote-worker.service.in new file mode 100644 index 000000000000..2c334d74804f --- /dev/null +++ b/etc/cuirass-remote-worker.service.in @@ -0,0 +1,15 @@ +# This is a "service unit file" for the systemd init system to launch +# 'cuirass remote-worker'. Drop it in /etc/systemd/system or similar +# to have 'cuirass remote-worker' automatically started. + +[Unit] +Description=Continuous integration remmote worker for GNU Guix + +[Service] +ExecStart=@guix_localstatedir@/guix/profiles/per-user/root/guix-profile/bin/cuirass \ + remote-worker --workers=2 --server=10.0.0.1:5555 +Environment= LC_ALL=en_US.UTF-8 \ + 'GUIX_LOCPATH=@guix_localstatedir@/guix/profiles/per-user/root/guix-profile/lib/locale' + +[Install] +WantedBy=multi-user.target