From debbugs-submit-bounces@debbugs.gnu.org Mon May 28 09:25:26 2018 Received: (at submit) by debbugs.gnu.org; 28 May 2018 13:25:27 +0000 Received: from localhost ([127.0.0.1]:51855 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fNI9K-0007Nz-4e for submit@debbugs.gnu.org; Mon, 28 May 2018 09:25:26 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34184) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fNI9H-0007Nl-FK for submit@debbugs.gnu.org; Mon, 28 May 2018 09:25:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fNI9B-0002Bg-25 for submit@debbugs.gnu.org; Mon, 28 May 2018 09:25:14 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:36971) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fNI9A-0002Bc-UH for submit@debbugs.gnu.org; Mon, 28 May 2018 09:25:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53384) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNI99-00012S-I0 for guix-patches@gnu.org; Mon, 28 May 2018 09:25:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fNI96-0002Am-BG for guix-patches@gnu.org; Mon, 28 May 2018 09:25:11 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:38894) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fNI96-00029y-01 for guix-patches@gnu.org; Mon, 28 May 2018 09:25:08 -0400 X-IronPort-AV: E=Sophos;i="5.49,452,1520895600"; d="scan'208";a="266733317" Received: from unknown (HELO Bordeciel.bordeaux.inria.fr) ([193.50.110.173]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-GCM-SHA256; 28 May 2018 15:25:04 +0200 From: Rouby Pierre-Antoine To: guix-patches@gnu.org Subject: [PATCH 1/3] gnu: Add hpcguix-web. Date: Mon, 28 May 2018 15:24:50 +0200 Message-Id: <20180528132450.12442-1-pierre-antoine.rouby@inria.fr> X-Mailer: git-send-email 2.17.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit Cc: Rouby Pierre-Antoine X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) * gnu/package/web.scm (hpcguix-web): New variable. --- gnu/packages/web.scm | 80 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm index 9f1609591..2c69490f8 100644 --- a/gnu/packages/web.scm +++ b/gnu/packages/web.scm @@ -25,6 +25,7 @@ ;;; Copyright © 2017 Pierre Langlois ;;; Copyright © 2017 Rutger Helling ;;; Copyright © 2018 Julien Lepiller +;;; Copyright © 2018 Pierre-Antoine Rouby ;;; ;;; This file is part of GNU Guix. ;;; @@ -82,6 +83,7 @@ #:use-module (gnu packages gnuzilla) #:use-module (gnu packages gperf) #:use-module (gnu packages gtk) + #:use-module (gnu packages guile) #:use-module (gnu packages java) #:use-module (gnu packages javascript) #:use-module (gnu packages jemalloc) @@ -96,6 +98,7 @@ #:use-module (gnu packages ncurses) #:use-module (gnu packages openstack) #:use-module (gnu packages base) + #:use-module (gnu packages package-management) #:use-module (gnu packages perl) #:use-module (gnu packages perl-check) #:use-module (gnu packages python) @@ -6428,3 +6431,80 @@ compressed JSON header blocks. @item @command{inflatehd} converts such compressed headers back to JSON pairs. @end itemize\n") (license l:expat))) + +(define-public hpcguix-web + (package + (name "hpcguix-web") + (version "0.0.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/UMCUGenetics/hpcguix-web.git") + (commit "3e3b9a3a406ee2dcd10c96cbedcc16ea378e8e8f"))) + (sha256 + (base32 + "01888byi9mh7d3adcmwhmg44kg98g92r44ilc4wd7an66mjnxpry")))) + (build-system gnu-build-system) + (arguments + `(#:modules ((guix build gnu-build-system) + (guix build utils) + (srfi srfi-26) + (ice-9 popen) + (ice-9 rdelim)) + + #:phases + (modify-phases %standard-phases + (add-before 'configure 'autoconf + (lambda _ + (setenv "GUILE_AUTO_COMPILE" "0") + (setenv "XDG_CACHE_HOME" (getcwd)) + (invoke "autoreconf" "-vif"))) + (add-after 'install 'wrap-program + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (guix (assoc-ref inputs "guix")) + (guile (assoc-ref inputs "guile")) + (json (assoc-ref inputs "guile-json")) + (guile-cm (assoc-ref inputs + "guile-commonmark")) + (deps (list guile guile-cm guix json)) + (effective + (read-line + (open-pipe* OPEN_READ + (string-append guile "/bin/guile") + "-c" "(display (effective-version))"))) + (path (string-join + (map (cut string-append <> + "/share/guile/site/" + effective) + deps) + ":")) + (gopath (string-join + (map (cut string-append <> + "/lib/guile/" effective + "/site-ccache") + deps) + ":"))) + (wrap-program (string-append out "/bin/run") + `("GUILE_LOAD_PATH" ":" prefix (,path)) + `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,gopath))) + + #t)))))) + (native-inputs + `(("autoconf" ,autoconf) + ("automake" ,automake) + ("uglify-js" ,uglify-js) + ("pkg-config" ,pkg-config))) + (inputs + `(("guix" ,guix))) + (propagated-inputs + `(("guile" ,guile-2.2) + ("guile-commonmark" ,guile-commonmark) + ("guile-json" ,guile-json))) + (home-page "https://github.com/UMCUGenetics/hpcguix-web") + (synopsis "Web interface for cluster deployments of Guix") + (description "This package provides a web interface to the list of +packages provided by Guix. The list of packages is searchable and +provides instructions on how to use Guix in a shared HPC +environment.") + (license l:agpl3+))) -- 2.17.0 From debbugs-submit-bounces@debbugs.gnu.org Mon May 28 09:28:20 2018 Received: (at 31621) by debbugs.gnu.org; 28 May 2018 13:28:20 +0000 Received: from localhost ([127.0.0.1]:51861 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fNICC-0007Rp-4p for submit@debbugs.gnu.org; Mon, 28 May 2018 09:28:20 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:7998) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fNICA-0007Rb-1d for 31621@debbugs.gnu.org; Mon, 28 May 2018 09:28:18 -0400 X-IronPort-AV: E=Sophos;i="5.49,452,1520895600"; d="scan'208";a="266733822" Received: from unknown (HELO Bordeciel.bordeaux.inria.fr) ([193.50.110.173]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-GCM-SHA256; 28 May 2018 15:28:11 +0200 From: Rouby Pierre-Antoine To: 31621@debbugs.gnu.org Subject: [PATCH 2/3] gnu: service: Add hpcguix-web. Date: Mon, 28 May 2018 15:28:00 +0200 Message-Id: <20180528132800.12488-1-pierre-antoine.rouby@inria.fr> X-Mailer: git-send-email 2.17.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 31621 Cc: Rouby Pierre-Antoine X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) * gnu/service/web.scm (): New record-type. --- gnu/services/web.scm | 71 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 1 deletion(-) diff --git a/gnu/services/web.scm b/gnu/services/web.scm index b336a8dd3..d8acc9549 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -6,6 +6,7 @@ ;;; Copyright © 2017 Christopher Baines ;;; Copyright © 2017 nee ;;; Copyright © 2017 Clément Lassieur +;;; Copyright © 2018 Pierre-Antoine Rouby ;;; ;;; This file is part of GNU Guix. ;;; @@ -25,11 +26,14 @@ (define-module (gnu services web) #:use-module (gnu services) #:use-module (gnu services shepherd) + #:use-module (gnu system pam) #:use-module (gnu system shadow) #:use-module (gnu packages admin) #:use-module (gnu packages web) #:use-module (gnu packages php) + #:use-module (gnu packages guile) #:use-module (guix records) + #:use-module (guix modules) #:use-module (guix gexp) #:use-module ((guix utils) #:select (version-major)) #:use-module ((guix packages) #:select (package-version)) @@ -155,7 +159,11 @@ php-fpm-service-type nginx-php-location - cat-avatar-generator-service)) + cat-avatar-generator-service + + hpcguix-web-configuration + hpcguix-web-configuration? + hpcguix-web-service-type)) ;;; Commentary: ;;; @@ -893,3 +901,64 @@ a webserver.") (nginx-server-configuration-locations configuration))) (root #~(string-append #$package "/share/web/cat-avatar-generator")))))) + +(define-record-type* + hpcguix-web-configuration + make-hpcguix-web-configuration + hpcguix-web-configuration? + + ;; Specs is gexp of hpcguix-web configuration file + (specs hpcguix-web-configuration-specs)) + +(define %hpcguix-web-accounts + (list (user-group + (name "hpcguix-web") + (system? #t)) + (user-account + (name "hpcguix-web") + (group "hpcguix-web") + (system? #t) + (comment "hpcguix-web") + (home-directory "/var/empty") + (shell (file-append shadow "/sbin/nologin"))))) + +(define (%hpcguix-web-activation config) + #~(begin + (use-modules (guix build utils)) + (let ((home-dir "/var/cache/guix/web") + (user (getpwnam "hpcguix-web"))) + (mkdir-p home-dir) + (chown home-dir (passwd:uid user) (passwd:gid user)) + (chmod home-dir #o755)))) + +(define (hpcguix-web-shepherd-service config) + (let* ((specs (hpcguix-web-configuration-specs config))) + (with-imported-modules (source-module-closure + '((gnu build shepherd))) + (shepherd-service + (documentation "hpcguix-web daemon") + (provision '(hpcguix-web)) + (requirement '(networking)) + (start #~(make-forkexec-constructor + (list (string-append #$hpcguix-web "/bin/run") + (string-append "--config=" + #$(scheme-file "hpcguix-web.scm" specs))) + #:user "hpcguix-web" + #:group "hpcguix-web" + #:environment-variables + (list (string-append "XDG_CACHE_HOME=" + "/var/cache")))) + (stop #~(make-kill-destructor)))))) + +(define hpcguix-web-service-type + (service-type + (name 'hpcguix-web) + (description + "Run hpcguix-web daemon @command{run}.") + (extensions + (list (service-extension account-service-type + (const %hpcguix-web-accounts)) + (service-extension activation-service-type + %hpcguix-web-activation) + (service-extension shepherd-root-service-type + (compose list hpcguix-web-shepherd-service)))))) -- 2.17.0 From debbugs-submit-bounces@debbugs.gnu.org Mon May 28 09:28:34 2018 Received: (at 31621) by debbugs.gnu.org; 28 May 2018 13:28:34 +0000 Received: from localhost ([127.0.0.1]:51864 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fNICP-0007SF-GM for submit@debbugs.gnu.org; Mon, 28 May 2018 09:28:34 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:23251) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fNICN-0007S1-G9 for 31621@debbugs.gnu.org; Mon, 28 May 2018 09:28:31 -0400 X-IronPort-AV: E=Sophos;i="5.49,452,1520895600"; d="scan'208";a="266733855" Received: from unknown (HELO Bordeciel.bordeaux.inria.fr) ([193.50.110.173]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-GCM-SHA256; 28 May 2018 15:28:25 +0200 From: Rouby Pierre-Antoine To: 31621@debbugs.gnu.org Subject: [PATCH 3/3] gnu: tests: Add hpcguix-web. Date: Mon, 28 May 2018 15:28:19 +0200 Message-Id: <20180528132819.12534-1-pierre-antoine.rouby@inria.fr> X-Mailer: git-send-email 2.17.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 31621 Cc: Rouby Pierre-Antoine X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) * gnu/tests/web.scm (run-hpcguix-web-server-test): New procedure. (%hpcguix-web-specs, %hpcguix-web-os, %test-hpcguix-web): New variable. --- gnu/tests/web.scm | 83 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 82 insertions(+), 1 deletion(-) diff --git a/gnu/tests/web.scm b/gnu/tests/web.scm index 1912f8f79..474a5bdb5 100644 --- a/gnu/tests/web.scm +++ b/gnu/tests/web.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2017 Ludovic Courtès ;;; Copyright © 2017 Christopher Baines ;;; Copyright © 2017 Clément Lassieur +;;; Copyright © 2018 Pierre-Antoine Rouby ;;; ;;; This file is part of GNU Guix. ;;; @@ -31,7 +32,8 @@ #:use-module (guix store) #:export (%test-httpd %test-nginx - %test-php-fpm)) + %test-php-fpm + %test-hpcguix-web)) (define %index.html-contents ;; Contents of the /index.html file. @@ -281,3 +283,82 @@ HTTP-PORT, along with php-fpm." (name "php-fpm") (description "Test PHP-FPM through nginx.") (value (run-php-fpm-test)))) + + +;;; +;;; HPCGUIX-WEB +;;; + +(define* (run-hpcguix-web-server-test name test-os) + "Run tests in %HPCGUIX-WEB-OS, which has hpcguix-web running." + (define os + (marionette-operating-system + test-os + #:imported-modules '((gnu services herd) + (guix combinators)))) + + (define vm + (virtual-machine + (operating-system os) + (port-forwardings '((8080 . 5000))))) + + (define test + (with-imported-modules '((gnu build marionette)) + #~(begin + (use-modules (srfi srfi-11) (srfi srfi-64) + (gnu build marionette) + (web uri) + (web client) + (web response)) + + (define marionette + (make-marionette (list #$vm))) + + (mkdir #$output) + (chdir #$output) + + (test-begin #$name) + + (test-assert "hpcguix-web running" + (marionette-eval + '(begin + (use-modules (gnu services herd)) + (match (start-service 'hpcguix-web) + (#f #f) + (('service response-parts ...) + (match (assq-ref response-parts 'running) + ((pid) (number? pid)))))) + marionette)) + + (test-equal "http-get" + 200 + (let-values + (((response text) + (begin + (sleep 3) ; HACK wait service available + (http-get "http://localhost:8080")))) + (response-code response))) + + (test-end) + (exit (= (test-runner-fail-count (test-runner-current)) 0))))) + + (gexp->derivation (string-append name "-test") test)) + +(define %hpcguix-web-specs + ;; Server config gexp. + #~(define site-config + (hpcweb-configuration + (title-prefix "[TEST] HPCGUIX-WEB")))) + +(define %hpcguix-web-os + (simple-operating-system + (dhcp-client-service) + (service hpcguix-web-service-type + (hpcguix-web-configuration + (specs %hpcguix-web-specs))))) + +(define %test-hpcguix-web + (system-test + (name "hpcguix-web") + (description "Connect to a running HPCGUIX-WEB server.") + (value (run-hpcguix-web-server-test name %hpcguix-web-os)))) -- 2.17.0 From debbugs-submit-bounces@debbugs.gnu.org Tue May 29 04:32:00 2018 Received: (at 31621) by debbugs.gnu.org; 29 May 2018 08:32:00 +0000 Received: from localhost ([127.0.0.1]:53111 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fNa2x-0000Ns-0L for submit@debbugs.gnu.org; Tue, 29 May 2018 04:32:00 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:36285) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fNa2v-0000Nf-1G for 31621@debbugs.gnu.org; Tue, 29 May 2018 04:31:57 -0400 X-IronPort-AV: E=Sophos;i="5.49,455,1520895600"; d="scan'208";a="266827921" Received: from unknown (HELO Bordeciel.bordeaux.inria.fr) ([193.50.110.173]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-GCM-SHA256; 29 May 2018 10:31:50 +0200 From: Rouby Pierre-Antoine To: 31621@debbugs.gnu.org Subject: [PATCH 2/3] gnu: service: Add hpcguix-web. Date: Tue, 29 May 2018 10:31:43 +0200 Message-Id: <20180529083143.3654-1-pierre-antoine.rouby@inria.fr> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528132800.12488-1-pierre-antoine.rouby@inria.fr> References: <20180528132800.12488-1-pierre-antoine.rouby@inria.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 31621 Cc: Rouby Pierre-Antoine X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) * gnu/service/web.scm (): New record-type. (%hpcguix-web-accounts): New variable. (%hpcguix-web-activation,hpcguix-web-shepherd-service, hpcguix-web-service-type): New procedures. --- gnu/services/web.scm | 71 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 1 deletion(-) diff --git a/gnu/services/web.scm b/gnu/services/web.scm index b336a8dd3..d8acc9549 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -6,6 +6,7 @@ ;;; Copyright © 2017 Christopher Baines ;;; Copyright © 2017 nee ;;; Copyright © 2017 Clément Lassieur +;;; Copyright © 2018 Pierre-Antoine Rouby ;;; ;;; This file is part of GNU Guix. ;;; @@ -25,11 +26,14 @@ (define-module (gnu services web) #:use-module (gnu services) #:use-module (gnu services shepherd) + #:use-module (gnu system pam) #:use-module (gnu system shadow) #:use-module (gnu packages admin) #:use-module (gnu packages web) #:use-module (gnu packages php) + #:use-module (gnu packages guile) #:use-module (guix records) + #:use-module (guix modules) #:use-module (guix gexp) #:use-module ((guix utils) #:select (version-major)) #:use-module ((guix packages) #:select (package-version)) @@ -155,7 +159,11 @@ php-fpm-service-type nginx-php-location - cat-avatar-generator-service)) + cat-avatar-generator-service + + hpcguix-web-configuration + hpcguix-web-configuration? + hpcguix-web-service-type)) ;;; Commentary: ;;; @@ -893,3 +901,64 @@ a webserver.") (nginx-server-configuration-locations configuration))) (root #~(string-append #$package "/share/web/cat-avatar-generator")))))) + +(define-record-type* + hpcguix-web-configuration + make-hpcguix-web-configuration + hpcguix-web-configuration? + + ;; Specs is gexp of hpcguix-web configuration file + (specs hpcguix-web-configuration-specs)) + +(define %hpcguix-web-accounts + (list (user-group + (name "hpcguix-web") + (system? #t)) + (user-account + (name "hpcguix-web") + (group "hpcguix-web") + (system? #t) + (comment "hpcguix-web") + (home-directory "/var/empty") + (shell (file-append shadow "/sbin/nologin"))))) + +(define (%hpcguix-web-activation config) + #~(begin + (use-modules (guix build utils)) + (let ((home-dir "/var/cache/guix/web") + (user (getpwnam "hpcguix-web"))) + (mkdir-p home-dir) + (chown home-dir (passwd:uid user) (passwd:gid user)) + (chmod home-dir #o755)))) + +(define (hpcguix-web-shepherd-service config) + (let* ((specs (hpcguix-web-configuration-specs config))) + (with-imported-modules (source-module-closure + '((gnu build shepherd))) + (shepherd-service + (documentation "hpcguix-web daemon") + (provision '(hpcguix-web)) + (requirement '(networking)) + (start #~(make-forkexec-constructor + (list (string-append #$hpcguix-web "/bin/run") + (string-append "--config=" + #$(scheme-file "hpcguix-web.scm" specs))) + #:user "hpcguix-web" + #:group "hpcguix-web" + #:environment-variables + (list (string-append "XDG_CACHE_HOME=" + "/var/cache")))) + (stop #~(make-kill-destructor)))))) + +(define hpcguix-web-service-type + (service-type + (name 'hpcguix-web) + (description + "Run hpcguix-web daemon @command{run}.") + (extensions + (list (service-extension account-service-type + (const %hpcguix-web-accounts)) + (service-extension activation-service-type + %hpcguix-web-activation) + (service-extension shepherd-root-service-type + (compose list hpcguix-web-shepherd-service)))))) -- 2.17.0 From debbugs-submit-bounces@debbugs.gnu.org Tue May 29 04:51:52 2018 Received: (at 31621) by debbugs.gnu.org; 29 May 2018 08:51:52 +0000 Received: from localhost ([127.0.0.1]:53124 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fNaMB-0000q2-QO for submit@debbugs.gnu.org; Tue, 29 May 2018 04:51:52 -0400 Received: from static.195.114.201.195.clients.your-server.de ([195.201.114.195]:56036 helo=conspiracy.of.n0.is) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fNaM7-0000pr-H6 for 31621@debbugs.gnu.org; Tue, 29 May 2018 04:51:48 -0400 Received: by conspiracy.of.n0.is (OpenSMTPD) with ESMTPSA id 237d0beb (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Tue, 29 May 2018 08:51:45 +0000 (UTC) Date: Tue, 29 May 2018 08:52:19 +0000 From: Nils Gillmann To: Rouby Pierre-Antoine Subject: Re: [bug#31621] [PATCH 2/3] gnu: service: Add hpcguix-web. Message-ID: <20180529085219.3eqr2xljbjtm7d7x@abyayala> References: <20180528132450.12442-1-pierre-antoine.rouby@inria.fr> <20180528132800.12488-1-pierre-antoine.rouby@inria.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180528132800.12488-1-pierre-antoine.rouby@inria.fr> X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 31621 Cc: 31621@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Rouby, thanks for your patch series. The service of it seems not to be documented. Could you write a little documentation for it so people will know how to use it? That's so far the first and only review I have time for right now. Rouby Pierre-Antoine transcribed 4.0K bytes: > * gnu/service/web.scm (): New record-type. > --- > gnu/services/web.scm | 71 +++++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 70 insertions(+), 1 deletion(-) > > diff --git a/gnu/services/web.scm b/gnu/services/web.scm > index b336a8dd3..d8acc9549 100644 > --- a/gnu/services/web.scm > +++ b/gnu/services/web.scm > @@ -6,6 +6,7 @@ > ;;; Copyright © 2017 Christopher Baines > ;;; Copyright © 2017 nee > ;;; Copyright © 2017 Clément Lassieur > +;;; Copyright © 2018 Pierre-Antoine Rouby > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -25,11 +26,14 @@ > (define-module (gnu services web) > #:use-module (gnu services) > #:use-module (gnu services shepherd) > + #:use-module (gnu system pam) > #:use-module (gnu system shadow) > #:use-module (gnu packages admin) > #:use-module (gnu packages web) > #:use-module (gnu packages php) > + #:use-module (gnu packages guile) > #:use-module (guix records) > + #:use-module (guix modules) > #:use-module (guix gexp) > #:use-module ((guix utils) #:select (version-major)) > #:use-module ((guix packages) #:select (package-version)) > @@ -155,7 +159,11 @@ > php-fpm-service-type > nginx-php-location > > - cat-avatar-generator-service)) > + cat-avatar-generator-service > + > + hpcguix-web-configuration > + hpcguix-web-configuration? > + hpcguix-web-service-type)) > > ;;; Commentary: > ;;; > @@ -893,3 +901,64 @@ a webserver.") > (nginx-server-configuration-locations configuration))) > (root #~(string-append #$package > "/share/web/cat-avatar-generator")))))) > + > +(define-record-type* > + hpcguix-web-configuration > + make-hpcguix-web-configuration > + hpcguix-web-configuration? > + > + ;; Specs is gexp of hpcguix-web configuration file > + (specs hpcguix-web-configuration-specs)) > + > +(define %hpcguix-web-accounts > + (list (user-group > + (name "hpcguix-web") > + (system? #t)) > + (user-account > + (name "hpcguix-web") > + (group "hpcguix-web") > + (system? #t) > + (comment "hpcguix-web") > + (home-directory "/var/empty") > + (shell (file-append shadow "/sbin/nologin"))))) > + > +(define (%hpcguix-web-activation config) > + #~(begin > + (use-modules (guix build utils)) > + (let ((home-dir "/var/cache/guix/web") > + (user (getpwnam "hpcguix-web"))) > + (mkdir-p home-dir) > + (chown home-dir (passwd:uid user) (passwd:gid user)) > + (chmod home-dir #o755)))) > + > +(define (hpcguix-web-shepherd-service config) > + (let* ((specs (hpcguix-web-configuration-specs config))) > + (with-imported-modules (source-module-closure > + '((gnu build shepherd))) > + (shepherd-service > + (documentation "hpcguix-web daemon") > + (provision '(hpcguix-web)) > + (requirement '(networking)) > + (start #~(make-forkexec-constructor > + (list (string-append #$hpcguix-web "/bin/run") > + (string-append "--config=" > + #$(scheme-file "hpcguix-web.scm" specs))) > + #:user "hpcguix-web" > + #:group "hpcguix-web" > + #:environment-variables > + (list (string-append "XDG_CACHE_HOME=" > + "/var/cache")))) > + (stop #~(make-kill-destructor)))))) > + > +(define hpcguix-web-service-type > + (service-type > + (name 'hpcguix-web) > + (description > + "Run hpcguix-web daemon @command{run}.") > + (extensions > + (list (service-extension account-service-type > + (const %hpcguix-web-accounts)) > + (service-extension activation-service-type > + %hpcguix-web-activation) > + (service-extension shepherd-root-service-type > + (compose list hpcguix-web-shepherd-service)))))) > -- > 2.17.0 > > > > From debbugs-submit-bounces@debbugs.gnu.org Tue May 29 04:56:52 2018 Received: (at 31621) by debbugs.gnu.org; 29 May 2018 08:56:52 +0000 Received: from localhost ([127.0.0.1]:53132 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fNaQy-0000xk-Hq for submit@debbugs.gnu.org; Tue, 29 May 2018 04:56:52 -0400 Received: from static.195.114.201.195.clients.your-server.de ([195.201.114.195]:56056 helo=conspiracy.of.n0.is) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fNaQt-0000xY-MB for 31621@debbugs.gnu.org; Tue, 29 May 2018 04:56:47 -0400 Received: by conspiracy.of.n0.is (OpenSMTPD) with ESMTPSA id 7b2bc2f7 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Tue, 29 May 2018 08:56:42 +0000 (UTC) Date: Tue, 29 May 2018 08:57:17 +0000 From: Nils Gillmann To: Rouby Pierre-Antoine Subject: Re: [bug#31621] [PATCH 1/3] gnu: Add hpcguix-web. Message-ID: <20180529085717.p6nakfkivswoh5kg@abyayala> References: <20180528132450.12442-1-pierre-antoine.rouby@inria.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180528132450.12442-1-pierre-antoine.rouby@inria.fr> X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 31621 Cc: 31621@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) (Okay, so my email application seems to put your last name first. Sorry for the confusion in the first email I've sent) Rouby Pierre-Antoine transcribed 4.4K bytes: > * gnu/package/web.scm (hpcguix-web): New variable. > --- > gnu/packages/web.scm | 80 ++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 80 insertions(+) > > diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm > index 9f1609591..2c69490f8 100644 > --- a/gnu/packages/web.scm > +++ b/gnu/packages/web.scm > @@ -25,6 +25,7 @@ > ;;; Copyright © 2017 Pierre Langlois > ;;; Copyright © 2017 Rutger Helling > ;;; Copyright © 2018 Julien Lepiller > +;;; Copyright © 2018 Pierre-Antoine Rouby > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -82,6 +83,7 @@ > #:use-module (gnu packages gnuzilla) > #:use-module (gnu packages gperf) > #:use-module (gnu packages gtk) > + #:use-module (gnu packages guile) > #:use-module (gnu packages java) > #:use-module (gnu packages javascript) > #:use-module (gnu packages jemalloc) > @@ -96,6 +98,7 @@ > #:use-module (gnu packages ncurses) > #:use-module (gnu packages openstack) > #:use-module (gnu packages base) > + #:use-module (gnu packages package-management) > #:use-module (gnu packages perl) > #:use-module (gnu packages perl-check) > #:use-module (gnu packages python) > @@ -6428,3 +6431,80 @@ compressed JSON header blocks. > @item @command{inflatehd} converts such compressed headers back to JSON pairs. > @end itemize\n") > (license l:expat))) > + > +(define-public hpcguix-web > + (package > + (name "hpcguix-web") > + (version "0.0.1") > + (source (origin > + (method git-fetch) > + (uri (git-reference > + (url "https://github.com/UMCUGenetics/hpcguix-web.git") > + (commit "3e3b9a3a406ee2dcd10c96cbedcc16ea378e8e8f"))) Unless git-file-name is implicit now, I would add this to the source. You can grep the source directory to find examples. It is relatively new, so not many packages are using it. > + (sha256 > + (base32 > + "01888byi9mh7d3adcmwhmg44kg98g92r44ilc4wd7an66mjnxpry")))) > + (build-system gnu-build-system) > + (arguments > + `(#:modules ((guix build gnu-build-system) > + (guix build utils) > + (srfi srfi-26) > + (ice-9 popen) > + (ice-9 rdelim)) > + > + #:phases > + (modify-phases %standard-phases > + (add-before 'configure 'autoconf > + (lambda _ > + (setenv "GUILE_AUTO_COMPILE" "0") > + (setenv "XDG_CACHE_HOME" (getcwd)) > + (invoke "autoreconf" "-vif"))) > + (add-after 'install 'wrap-program > + (lambda* (#:key inputs outputs #:allow-other-keys) > + (let* ((out (assoc-ref outputs "out")) > + (guix (assoc-ref inputs "guix")) > + (guile (assoc-ref inputs "guile")) > + (json (assoc-ref inputs "guile-json")) > + (guile-cm (assoc-ref inputs > + "guile-commonmark")) > + (deps (list guile guile-cm guix json)) > + (effective > + (read-line > + (open-pipe* OPEN_READ > + (string-append guile "/bin/guile") > + "-c" "(display (effective-version))"))) > + (path (string-join > + (map (cut string-append <> > + "/share/guile/site/" > + effective) > + deps) > + ":")) > + (gopath (string-join > + (map (cut string-append <> > + "/lib/guile/" effective > + "/site-ccache") > + deps) > + ":"))) > + (wrap-program (string-append out "/bin/run") > + `("GUILE_LOAD_PATH" ":" prefix (,path)) > + `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,gopath))) > + > + #t)))))) > + (native-inputs > + `(("autoconf" ,autoconf) > + ("automake" ,automake) > + ("uglify-js" ,uglify-js) > + ("pkg-config" ,pkg-config))) > + (inputs > + `(("guix" ,guix))) > + (propagated-inputs > + `(("guile" ,guile-2.2) > + ("guile-commonmark" ,guile-commonmark) > + ("guile-json" ,guile-json))) > + (home-page "https://github.com/UMCUGenetics/hpcguix-web") > + (synopsis "Web interface for cluster deployments of Guix") > + (description "This package provides a web interface to the list of Nitpick: Replace the start ("This package") with the name of the application. As far as I remember lint should complain here aswell. > +packages provided by Guix. The list of packages is searchable and > +provides instructions on how to use Guix in a shared HPC > +environment.") > + (license l:agpl3+))) > -- > 2.17.0 > > > > From debbugs-submit-bounces@debbugs.gnu.org Wed May 30 03:25:09 2018 Received: (at 31621) by debbugs.gnu.org; 30 May 2018 07:25:09 +0000 Received: from localhost ([127.0.0.1]:54611 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fNvTp-0005G8-97 for submit@debbugs.gnu.org; Wed, 30 May 2018 03:25:09 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:13835) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fNvTn-0005Fj-LL for 31621@debbugs.gnu.org; Wed, 30 May 2018 03:25:08 -0400 X-IronPort-AV: E=Sophos;i="5.49,459,1520895600"; d="scan'208";a="329495739" Received: from zcs-store4.inria.fr ([128.93.142.31]) by mail2-relais-roc.national.inria.fr with ESMTP; 30 May 2018 09:25:01 +0200 Date: Wed, 30 May 2018 09:25:00 +0200 (CEST) From: Pierre-Antoine Rouby To: Nils Gillmann Message-ID: <1403620931.20383297.1527665100959.JavaMail.zimbra@inria.fr> In-Reply-To: <20180529085219.3eqr2xljbjtm7d7x@abyayala> References: <20180528132450.12442-1-pierre-antoine.rouby@inria.fr> <20180528132800.12488-1-pierre-antoine.rouby@inria.fr> <20180529085219.3eqr2xljbjtm7d7x@abyayala> Subject: Re: [bug#31621] [PATCH 2/3] gnu: service: Add hpcguix-web. MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Originating-IP: [193.50.110.173] X-Mailer: Zimbra 8.7.11_GA_1854 (ZimbraWebClient - FF52 (Win)/8.7.11_GA_1854) Thread-Topic: service: Add hpcguix-web. Thread-Index: ApKfDsuekqAKlejqSSKmnA4RSfr7kg== X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 31621 Cc: 31621@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) Hi Nils, > From: "Nils Gillmann" > The service of it seems not to be documented. Could you write > a little documentation for it so people will know how > to use it? Yes, no problem. :) From debbugs-submit-bounces@debbugs.gnu.org Wed May 30 05:42:24 2018 Received: (at 31621) by debbugs.gnu.org; 30 May 2018 09:42:24 +0000 Received: from localhost ([127.0.0.1]:54677 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fNxcZ-0008MH-Ry for submit@debbugs.gnu.org; Wed, 30 May 2018 05:42:24 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:36418) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fNxcX-0008M3-Qv for 31621@debbugs.gnu.org; Wed, 30 May 2018 05:42:18 -0400 X-IronPort-AV: E=Sophos;i="5.49,460,1520895600"; d="scan'208";a="329531342" Received: from unknown (HELO Bordeciel.bordeaux.inria.fr) ([193.50.110.173]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-GCM-SHA256; 30 May 2018 11:42:11 +0200 From: Rouby Pierre-Antoine To: ng0@n0.is Subject: [PATCH 1/3] gnu: Add hpcguix-web. Date: Wed, 30 May 2018 11:41:46 +0200 Message-Id: <20180530094146.14858-1-pierre-antoine.rouby@inria.fr> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180529085717.p6nakfkivswoh5kg@abyayala> References: <20180529085717.p6nakfkivswoh5kg@abyayala> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 31621 Cc: 31621@debbugs.gnu.org, Rouby Pierre-Antoine X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) * gnu/package/web.scm (hpcguix-web): New variable. --- gnu/packages/web.scm | 80 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm index 9f1609591..e540fd4b9 100644 --- a/gnu/packages/web.scm +++ b/gnu/packages/web.scm @@ -25,6 +25,7 @@ ;;; Copyright © 2017 Pierre Langlois ;;; Copyright © 2017 Rutger Helling ;;; Copyright © 2018 Julien Lepiller +;;; Copyright © 2018 Pierre-Antoine Rouby ;;; ;;; This file is part of GNU Guix. ;;; @@ -82,6 +83,7 @@ #:use-module (gnu packages gnuzilla) #:use-module (gnu packages gperf) #:use-module (gnu packages gtk) + #:use-module (gnu packages guile) #:use-module (gnu packages java) #:use-module (gnu packages javascript) #:use-module (gnu packages jemalloc) @@ -96,6 +98,7 @@ #:use-module (gnu packages ncurses) #:use-module (gnu packages openstack) #:use-module (gnu packages base) + #:use-module (gnu packages package-management) #:use-module (gnu packages perl) #:use-module (gnu packages perl-check) #:use-module (gnu packages python) @@ -6428,3 +6431,80 @@ compressed JSON header blocks. @item @command{inflatehd} converts such compressed headers back to JSON pairs. @end itemize\n") (license l:expat))) + +(define-public hpcguix-web + (package + (name "hpcguix-web") + (version "0.0.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/UMCUGenetics/hpcguix-web.git") + (commit "3e3b9a3a406ee2dcd10c96cbedcc16ea378e8e8f"))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "01888byi9mh7d3adcmwhmg44kg98g92r44ilc4wd7an66mjnxpry")))) + (build-system gnu-build-system) + (arguments + `(#:modules ((guix build gnu-build-system) + (guix build utils) + (srfi srfi-26) + (ice-9 popen) + (ice-9 rdelim)) + + #:phases + (modify-phases %standard-phases + (add-before 'configure 'autoconf + (lambda _ + (setenv "GUILE_AUTO_COMPILE" "0") + (setenv "XDG_CACHE_HOME" (getcwd)) + (invoke "autoreconf" "-vif"))) + (add-after 'install 'wrap-program + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (guix (assoc-ref inputs "guix")) + (guile (assoc-ref inputs "guile")) + (json (assoc-ref inputs "guile-json")) + (guile-cm (assoc-ref inputs + "guile-commonmark")) + (deps (list guile guile-cm guix json)) + (effective + (read-line + (open-pipe* OPEN_READ + (string-append guile "/bin/guile") + "-c" "(display (effective-version))"))) + (path (string-join + (map (cut string-append <> + "/share/guile/site/" + effective) + deps) + ":")) + (gopath (string-join + (map (cut string-append <> + "/lib/guile/" effective + "/site-ccache") + deps) + ":"))) + (wrap-program (string-append out "/bin/run") + `("GUILE_LOAD_PATH" ":" prefix (,path)) + `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,gopath))) + + #t)))))) + (native-inputs + `(("autoconf" ,autoconf) + ("automake" ,automake) + ("uglify-js" ,uglify-js) + ("pkg-config" ,pkg-config))) + (inputs + `(("guix" ,guix))) + (propagated-inputs + `(("guile" ,guile-2.2) + ("guile-commonmark" ,guile-commonmark) + ("guile-json" ,guile-json))) + (home-page "https://github.com/UMCUGenetics/hpcguix-web") + (synopsis "Web interface for cluster deployments of Guix") + (description "Hpcguix-web provides a web interface to the list of packages +provided by Guix. The list of packages is searchable and provides +instructions on how to use Guix in a shared HPC environment.") + (license l:agpl3+))) -- 2.17.0 From debbugs-submit-bounces@debbugs.gnu.org Wed May 30 05:47:31 2018 Received: (at 31621) by debbugs.gnu.org; 30 May 2018 09:47:31 +0000 Received: from localhost ([127.0.0.1]:54682 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fNxhY-0008To-1r for submit@debbugs.gnu.org; Wed, 30 May 2018 05:47:31 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:50180) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fNxhV-0008Ta-Ar for 31621@debbugs.gnu.org; Wed, 30 May 2018 05:47:27 -0400 X-IronPort-AV: E=Sophos;i="5.49,460,1520895600"; d="scan'208";a="329532527" Received: from unknown (HELO Bordeciel.bordeaux.inria.fr) ([193.50.110.173]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-GCM-SHA256; 30 May 2018 11:47:19 +0200 From: Rouby Pierre-Antoine To: ng0@n0.is Subject: [PATCH 2/3] gnu: service: Add hpcguix-web. Date: Wed, 30 May 2018 11:47:04 +0200 Message-Id: <20180530094704.14910-1-pierre-antoine.rouby@inria.fr> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180529085219.3eqr2xljbjtm7d7x@abyayala> References: <20180529085219.3eqr2xljbjtm7d7x@abyayala> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 31621 Cc: 31621@debbugs.gnu.org, Rouby Pierre-Antoine X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) * gnu/service/web.scm (): New record-type. (%hpcguix-web-accounts): New variable. (%hpcguix-web-activation,hpcguix-web-shepherd-service, hpcguix-web-service-type): New procedures. * doc/guix.texi (Web Services): Add 'hpcguix-web'. --- doc/guix.texi | 50 ++++++++++++++++++++++++++++++- gnu/services/web.scm | 71 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 119 insertions(+), 2 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 5129b998b..6c91dd5a7 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -47,7 +47,8 @@ Copyright @copyright{} 2017, 2018 Arun Isaac@* Copyright @copyright{} 2017 nee@* Copyright @copyright{} 2018 Rutger Helling@* Copyright @copyright{} 2018 Oleg Pykhalov@* -Copyright @copyright{} 2018 Mike Gerwitz +Copyright @copyright{} 2018 Mike Gerwitz@* +Copyright @copyright{} 2018 Pierre-Antoine Rouby Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -16135,6 +16136,53 @@ A simple setup for cat-avatar-generator can look like this: %base-services)) @end example +@subsubheading Hpcguix-web + +@cindex hpcguix-web +The @code{hpcguix-web} is web interface to @code{Guix} packages visualizations. + +@defvr {Scheme Variable} hpcguix-web-service-type +A service type for @code{hpcguix-web}. +@end defvr + +@deftp {Data Type} hpcguix-web-configuration +Data Type for @code{hpcguix-web} service configuration. + +@table @asis +@item @code{specs} +The @code{hpcguix-web} @code{gexp} service +@url{https://github.com/UMCUGenetics/hpcguix-web/blob/master/hpcweb-configuration.scm, +configuration} + +@table @asis +@item @code{title-prefix} (default: @code{"hpcguix | "}) +The page title prefix. + +@item @code{guix-command} (default: @code{"guix"}) +The @code{Guix} command. + +@item @code{package-filter-proc} (default: @code{(const #t)}) +Package filter. + +@item @code{package-page-extension-proc} (default: @code{(const '())}) +Extension package for @code{hpcguix-web}. + +@item @code{menu} (default: @code{'()}) +Additional entry in page @code{menu}. +@end table +@end table +@end deftp + +@example +(services (cons* (service hpcguix-web-service-type + (hpcguix-web-configuration + (specs + #~(define site-config + (hpcweb-configuration + (title-prefix "Guix-HPC - ") + (menu '(("/about" "ABOUT")))))))) +@end example + @node Certificate Services @subsubsection Certificate Services diff --git a/gnu/services/web.scm b/gnu/services/web.scm index b336a8dd3..d8acc9549 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -6,6 +6,7 @@ ;;; Copyright © 2017 Christopher Baines ;;; Copyright © 2017 nee ;;; Copyright © 2017 Clément Lassieur +;;; Copyright © 2018 Pierre-Antoine Rouby ;;; ;;; This file is part of GNU Guix. ;;; @@ -25,11 +26,14 @@ (define-module (gnu services web) #:use-module (gnu services) #:use-module (gnu services shepherd) + #:use-module (gnu system pam) #:use-module (gnu system shadow) #:use-module (gnu packages admin) #:use-module (gnu packages web) #:use-module (gnu packages php) + #:use-module (gnu packages guile) #:use-module (guix records) + #:use-module (guix modules) #:use-module (guix gexp) #:use-module ((guix utils) #:select (version-major)) #:use-module ((guix packages) #:select (package-version)) @@ -155,7 +159,11 @@ php-fpm-service-type nginx-php-location - cat-avatar-generator-service)) + cat-avatar-generator-service + + hpcguix-web-configuration + hpcguix-web-configuration? + hpcguix-web-service-type)) ;;; Commentary: ;;; @@ -893,3 +901,64 @@ a webserver.") (nginx-server-configuration-locations configuration))) (root #~(string-append #$package "/share/web/cat-avatar-generator")))))) + +(define-record-type* + hpcguix-web-configuration + make-hpcguix-web-configuration + hpcguix-web-configuration? + + ;; Specs is gexp of hpcguix-web configuration file + (specs hpcguix-web-configuration-specs)) + +(define %hpcguix-web-accounts + (list (user-group + (name "hpcguix-web") + (system? #t)) + (user-account + (name "hpcguix-web") + (group "hpcguix-web") + (system? #t) + (comment "hpcguix-web") + (home-directory "/var/empty") + (shell (file-append shadow "/sbin/nologin"))))) + +(define (%hpcguix-web-activation config) + #~(begin + (use-modules (guix build utils)) + (let ((home-dir "/var/cache/guix/web") + (user (getpwnam "hpcguix-web"))) + (mkdir-p home-dir) + (chown home-dir (passwd:uid user) (passwd:gid user)) + (chmod home-dir #o755)))) + +(define (hpcguix-web-shepherd-service config) + (let* ((specs (hpcguix-web-configuration-specs config))) + (with-imported-modules (source-module-closure + '((gnu build shepherd))) + (shepherd-service + (documentation "hpcguix-web daemon") + (provision '(hpcguix-web)) + (requirement '(networking)) + (start #~(make-forkexec-constructor + (list (string-append #$hpcguix-web "/bin/run") + (string-append "--config=" + #$(scheme-file "hpcguix-web.scm" specs))) + #:user "hpcguix-web" + #:group "hpcguix-web" + #:environment-variables + (list (string-append "XDG_CACHE_HOME=" + "/var/cache")))) + (stop #~(make-kill-destructor)))))) + +(define hpcguix-web-service-type + (service-type + (name 'hpcguix-web) + (description + "Run hpcguix-web daemon @command{run}.") + (extensions + (list (service-extension account-service-type + (const %hpcguix-web-accounts)) + (service-extension activation-service-type + %hpcguix-web-activation) + (service-extension shepherd-root-service-type + (compose list hpcguix-web-shepherd-service)))))) -- 2.17.0 From debbugs-submit-bounces@debbugs.gnu.org Thu May 31 12:10:03 2018 Received: (at 31621) by debbugs.gnu.org; 31 May 2018 16:10:03 +0000 Received: from localhost ([127.0.0.1]:56231 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fOQ9L-0004Nm-77 for submit@debbugs.gnu.org; Thu, 31 May 2018 12:10:03 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:49606) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fOQ9J-0004NC-CT for 31621@debbugs.gnu.org; Thu, 31 May 2018 12:10:02 -0400 X-IronPort-AV: E=Sophos;i="5.49,463,1520895600"; d="scan'208";a="267157471" Received: from unknown (HELO ribbon) ([193.50.110.154]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/AES256-GCM-SHA384; 31 May 2018 18:09:54 +0200 From: ludovic.courtes@inria.fr (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Rouby Pierre-Antoine Subject: Re: [bug#31621] [PATCH 1/3] gnu: Add hpcguix-web. References: <20180529085717.p6nakfkivswoh5kg@abyayala> <20180530094146.14858-1-pierre-antoine.rouby@inria.fr> Date: Thu, 31 May 2018 18:09:54 +0200 In-Reply-To: <20180530094146.14858-1-pierre-antoine.rouby@inria.fr> (Rouby Pierre-Antoine's message of "Wed, 30 May 2018 11:41:46 +0200") Message-ID: <87wovjlsbx.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 31621 Cc: 31621@debbugs.gnu.org, ng0@n0.is X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) Hello! (Cc=E2=80=99ing Roel, who might have something to say. :-)) Rouby Pierre-Antoine skribis: > * gnu/package/web.scm (hpcguix-web): New variable. [...] > +(define-public hpcguix-web > + (package > + (name "hpcguix-web") > + (version "0.0.1") > + (source (origin > + (method git-fetch) > + (uri (git-reference > + (url "https://github.com/UMCUGenetics/hpcguix-web.gi= t") > + (commit "3e3b9a3a406ee2dcd10c96cbedcc16ea378e8e8f"))) Please use the version scheme as explained in the manual (info "(guix) Version Numbers"). That=E2=80=99s all I have to say. :-) Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Thu May 31 12:12:38 2018 Received: (at 31621) by debbugs.gnu.org; 31 May 2018 16:12:38 +0000 Received: from localhost ([127.0.0.1]:56236 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fOQBq-0004Rs-L8 for submit@debbugs.gnu.org; Thu, 31 May 2018 12:12:38 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:18173) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fOQBo-0004Rd-Re for 31621@debbugs.gnu.org; Thu, 31 May 2018 12:12:37 -0400 X-IronPort-AV: E=Sophos;i="5.49,463,1520895600"; d="scan'208";a="329761460" Received: from unknown (HELO ribbon) ([193.50.110.154]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/AES256-GCM-SHA384; 31 May 2018 18:12:30 +0200 From: ludovic.courtes@inria.fr (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Rouby Pierre-Antoine Subject: Re: [bug#31621] [PATCH 2/3] gnu: service: Add hpcguix-web. References: <20180529085219.3eqr2xljbjtm7d7x@abyayala> <20180530094704.14910-1-pierre-antoine.rouby@inria.fr> Date: Thu, 31 May 2018 18:12:30 +0200 In-Reply-To: <20180530094704.14910-1-pierre-antoine.rouby@inria.fr> (Rouby Pierre-Antoine's message of "Wed, 30 May 2018 11:47:04 +0200") Message-ID: <87sh67ls7l.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 31621 Cc: 31621@debbugs.gnu.org, ng0@n0.is X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) Rouby Pierre-Antoine skribis: > * gnu/service/web.scm (): New record-type. > (%hpcguix-web-accounts): New variable. > (%hpcguix-web-activation,hpcguix-web-shepherd-service, > hpcguix-web-service-type): New procedures. > * doc/guix.texi (Web Services): Add 'hpcguix-web'. I think you had written a system test no? Did it end up in a different patch? Apart from that it LGTM, thank you, and thanks Nils for the review! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Thu May 31 18:38:53 2018 Received: (at 31621) by debbugs.gnu.org; 31 May 2018 22:38:53 +0000 Received: from localhost ([127.0.0.1]:56349 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fOWDc-0000Nm-3F for submit@debbugs.gnu.org; Thu, 31 May 2018 18:38:53 -0400 Received: from eggs.gnu.org ([208.118.235.92]:45100) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fOWDa-0000NX-0L for 31621@debbugs.gnu.org; Thu, 31 May 2018 18:38:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fOWDQ-0002j6-Qg for 31621@debbugs.gnu.org; Thu, 31 May 2018 18:38:44 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57536) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fOWDQ-0002j2-Lz; Thu, 31 May 2018 18:38:40 -0400 Received: from ip112-245-209-87.adsl2.static.versatel.nl ([87.209.245.112]:51527 helo=yellowstone) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fOWDQ-0000vV-7C; Thu, 31 May 2018 18:38:40 -0400 References: <20180529085717.p6nakfkivswoh5kg@abyayala> <20180530094146.14858-1-pierre-antoine.rouby@inria.fr> <87wovjlsbx.fsf@gnu.org> User-agent: mu4e 1.0; emacs 26.1 From: Roel Janssen To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [bug#31621] [PATCH 1/3] gnu: Add hpcguix-web. In-reply-to: <87wovjlsbx.fsf@gnu.org> Date: Fri, 01 Jun 2018 00:38:36 +0200 Message-ID: <87muwfqwlv.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 31621 Cc: 31621@debbugs.gnu.org, ng0@n0.is, Rouby Pierre-Antoine X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) Ludovic Court=C3=A8s writes: > Hello! > > (Cc=E2=80=99ing Roel, who might have something to say. :-)) Yes yes. Shamefully, I haven't tested the patches yet. I like the work of Pierre-Antoine on hpcguix-web a lot! > > Rouby Pierre-Antoine skribis: > >> * gnu/package/web.scm (hpcguix-web): New variable. > > [...] > >> +(define-public hpcguix-web >> + (package >> + (name "hpcguix-web") >> + (version "0.0.1") >> + (source (origin >> + (method git-fetch) >> + (uri (git-reference >> + (url "https://github.com/UMCUGenetics/hpcguix-web.g= it") >> + (commit "3e3b9a3a406ee2dcd10c96cbedcc16ea378e8e8f")= )) > > Please use the version scheme as explained in the manual (info "(guix) > Version Numbers"). > > That=E2=80=99s all I have to say. :-) We could just release a 0.0.2. Then we don't need use git-fetch at all. Kind regards, Roel Janssen From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 01 04:05:37 2018 Received: (at 31621-done) by debbugs.gnu.org; 1 Jun 2018 08:05:37 +0000 Received: from localhost ([127.0.0.1]:56767 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fOf45-00056W-Bz for submit@debbugs.gnu.org; Fri, 01 Jun 2018 04:05:37 -0400 Received: from eggs.gnu.org ([208.118.235.92]:47820) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fOf43-00056I-TH for 31621-done@debbugs.gnu.org; Fri, 01 Jun 2018 04:05:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fOf3u-0004Q2-Cd for 31621-done@debbugs.gnu.org; Fri, 01 Jun 2018 04:05:30 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:37021) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fOf3t-0004Pa-UP; Fri, 01 Jun 2018 04:05:26 -0400 Received: from [193.50.110.154] (port=33382 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fOf3t-0000YN-At; Fri, 01 Jun 2018 04:05:25 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Rouby Pierre-Antoine Subject: Re: [bug#31621] [PATCH 2/3] gnu: service: Add hpcguix-web. References: <20180529085219.3eqr2xljbjtm7d7x@abyayala> <20180530094704.14910-1-pierre-antoine.rouby@inria.fr> Date: Fri, 01 Jun 2018 10:05:23 +0200 Message-ID: <871sdrc4os.fsf@inria.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 31621-done Cc: Roel Janssen , 31621-done@debbugs.gnu.org, ng0@n0.is X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, (+Cc: Roel.) Rouby Pierre-Antoine skribis: > * gnu/service/web.scm (): New record-type. > (%hpcguix-web-accounts): New variable. > (%hpcguix-web-activation,hpcguix-web-shepherd-service, > hpcguix-web-service-type): New procedures. > * doc/guix.texi (Web Services): Add 'hpcguix-web'. I found the test ;-), sorry for the confusion. I squashed the test with the other commit (because they logically belong to the same change), and I applied it with the changes below. Thank you! Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/doc/guix.texi b/doc/guix.texi index 9b9ce0f77..3b5078741 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -16163,30 +16163,32 @@ A simple setup for cat-avatar-generator can look like this: @subsubheading Hpcguix-web @cindex hpcguix-web -The @code{hpcguix-web} is web interface to @code{Guix} packages visualizations. +The @uref{hpcguix-web, https://github.com/UMCUGenetics/hpcguix-web/} +program is a customizable web interface to browse Guix packages, +initially designed for users of high-performance computing (HPC) +clusters. @defvr {Scheme Variable} hpcguix-web-service-type -A service type for @code{hpcguix-web}. +The service type for @code{hpcguix-web}. @end defvr @deftp {Data Type} hpcguix-web-configuration -Data Type for @code{hpcguix-web} service configuration. +Data type for the hpcguix-web service configuration. @table @asis @item @code{specs} -The @code{hpcguix-web} @code{gexp} service -@url{https://github.com/UMCUGenetics/hpcguix-web/blob/master/hpcweb-configuration.scm, -configuration} +A gexp (@pxref{G-Expressions}) specifying the hpcguix-web service +configuration. The main items available in this spec are: @table @asis @item @code{title-prefix} (default: @code{"hpcguix | "}) The page title prefix. @item @code{guix-command} (default: @code{"guix"}) -The @code{Guix} command. +The @command{guix} command. @item @code{package-filter-proc} (default: @code{(const #t)}) -Package filter. +A procedure specifying how to filter packages that are displayed. @item @code{package-page-extension-proc} (default: @code{(const '())}) Extension package for @code{hpcguix-web}. @@ -16194,17 +16196,26 @@ Extension package for @code{hpcguix-web}. @item @code{menu} (default: @code{'()}) Additional entry in page @code{menu}. @end table + +See the hpcguix-web repository for a +@uref{https://github.com/UMCUGenetics/hpcguix-web/blob/master/hpcweb-configuration.scm, +complete example}. + +@item @code{package} (default: @code{hpcguix-web}) +The hpcguix-web package to use. @end table @end deftp +A typical hpcguix-web service declaration looks like this: + @example -(services (cons* (service hpcguix-web-service-type - (hpcguix-web-configuration - (specs - #~(define site-config - (hpcweb-configuration - (title-prefix "Guix-HPC - ") - (menu '(("/about" "ABOUT")))))))) +(service hpcguix-web-service-type + (hpcguix-web-configuration + (specs + #~(define site-config + (hpcweb-configuration + (title-prefix "Guix-HPC - ") + (menu '(("/about" "ABOUT")))))))) @end example @node Certificate Services diff --git a/gnu/services/web.scm b/gnu/services/web.scm index d8acc9549..aae2f3db0 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -902,13 +902,15 @@ a webserver.") (root #~(string-append #$package "/share/web/cat-avatar-generator")))))) + (define-record-type* - hpcguix-web-configuration - make-hpcguix-web-configuration + hpcguix-web-configuration make-hpcguix-web-configuration hpcguix-web-configuration? + (package hpcguix-web-package (default hpcguix-web)) ; + ;; Specs is gexp of hpcguix-web configuration file - (specs hpcguix-web-configuration-specs)) + (specs hpcguix-web-configuration-specs)) (define %hpcguix-web-accounts (list (user-group @@ -922,7 +924,7 @@ a webserver.") (home-directory "/var/empty") (shell (file-append shadow "/sbin/nologin"))))) -(define (%hpcguix-web-activation config) +(define %hpcguix-web-activation #~(begin (use-modules (guix build utils)) (let ((home-dir "/var/cache/guix/web") @@ -932,7 +934,8 @@ a webserver.") (chmod home-dir #o755)))) (define (hpcguix-web-shepherd-service config) - (let* ((specs (hpcguix-web-configuration-specs config))) + (let ((specs (hpcguix-web-configuration-specs config)) + (hpcguix-web (hpcguix-web-package config))) (with-imported-modules (source-module-closure '((gnu build shepherd))) (shepherd-service @@ -940,25 +943,23 @@ a webserver.") (provision '(hpcguix-web)) (requirement '(networking)) (start #~(make-forkexec-constructor - (list (string-append #$hpcguix-web "/bin/run") + (list #$(file-append hpcguix-web "/bin/run") (string-append "--config=" #$(scheme-file "hpcguix-web.scm" specs))) #:user "hpcguix-web" #:group "hpcguix-web" #:environment-variables - (list (string-append "XDG_CACHE_HOME=" - "/var/cache")))) + (list "XDG_CACHE_HOME=/var/cache"))) (stop #~(make-kill-destructor)))))) (define hpcguix-web-service-type (service-type (name 'hpcguix-web) - (description - "Run hpcguix-web daemon @command{run}.") + (description "Run the hpcguix-web server.") (extensions (list (service-extension account-service-type (const %hpcguix-web-accounts)) (service-extension activation-service-type - %hpcguix-web-activation) + (const %hpcguix-web-activation)) (service-extension shepherd-root-service-type (compose list hpcguix-web-shepherd-service)))))) diff --git a/gnu/tests/web.scm b/gnu/tests/web.scm index 474a5bdb5..a6bf6efcf 100644 --- a/gnu/tests/web.scm +++ b/gnu/tests/web.scm @@ -286,7 +286,7 @@ HTTP-PORT, along with php-fpm." ;;; -;;; HPCGUIX-WEB +;;; hpcguix-web ;;; (define* (run-hpcguix-web-server-test name test-os) @@ -329,15 +329,14 @@ HTTP-PORT, along with php-fpm." (match (assq-ref response-parts 'running) ((pid) (number? pid)))))) marionette)) - + (test-equal "http-get" 200 - (let-values - (((response text) - (begin - (sleep 3) ; HACK wait service available - (http-get "http://localhost:8080")))) - (response-code response))) + (begin + (wait-for-tcp-port 5000 marionette) + (let-values (((response text) + (http-get "http://localhost:8080"))) + (response-code response)))) (test-end) (exit (= (test-runner-fail-count (test-runner-current)) 0))))) @@ -360,5 +359,5 @@ HTTP-PORT, along with php-fpm." (define %test-hpcguix-web (system-test (name "hpcguix-web") - (description "Connect to a running HPCGUIX-WEB server.") + (description "Connect to a running hpcguix-web server.") (value (run-hpcguix-web-server-test name %hpcguix-web-os)))) --=-=-=-- From unknown Sat Aug 16 17:01:26 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 29 Jun 2018 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator