GNU bug report logs - #30803
[PATCH 0/2] Add Elasticsearch package and service.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Christopher Baines <mail@HIDDEN>; Keywords: moreinfo; dated Tue, 13 Mar 2018 19:14:01 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at 30803 <at> debbugs.gnu.org:


Received: (at 30803) by debbugs.gnu.org; 17 Mar 2018 22:36:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 17 18:36:14 2018
Received: from localhost ([127.0.0.1]:38824 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1exKQw-0007Kx-05
	for submit <at> debbugs.gnu.org; Sat, 17 Mar 2018 18:36:14 -0400
Received: from li622-129.members.linode.com ([212.71.249.129]:39460
 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1exKQt-0007Kp-IU
 for 30803 <at> debbugs.gnu.org; Sat, 17 Mar 2018 18:36:12 -0400
Received: by mira.cbaines.net (Postfix, from userid 113)
 id ACE2813D067; Sat, 17 Mar 2018 22:36:10 +0000 (GMT)
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net
X-Spam-Level: 
X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00,
 URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0
Received: from localhost (cpc102582-walt20-2-0-cust14.13-2.cable.virginm.net
 [86.27.34.15])
 by mira.cbaines.net (Postfix) with ESMTPSA id 4A6C613D064;
 Sat, 17 Mar 2018 22:36:10 +0000 (GMT)
Received: from phact (localhost [127.0.0.1])
 by localhost (OpenSMTPD) with ESMTP id e6a5f25f;
 Sat, 17 Mar 2018 22:36:10 +0000 (UTC)
References: <871sgn23ip.fsf@HIDDEN> <874lleo1j1.fsf@HIDDEN>
User-agent: mu4e 1.0; emacs 25.3.1
From: Christopher Baines <mail@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: [bug#30803] [PATCH 0/2] Add Elasticsearch package and service.
In-reply-to: <874lleo1j1.fsf@HIDDEN>
Date: Sat, 17 Mar 2018 22:36:03 +0000
Message-ID: <87woyaxrcc.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha512; protocol="application/pgp-signature"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 30803
Cc: 30803 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable


Ludovic Court=C3=A8s <ludo@HIDDEN> writes:

> Hello Christopher,
>
> Christopher Baines <mail@HIDDEN> skribis:
>
>> I'm trying to reduce the number of patches I have sitting around in git
>> branches, so here is a bug about Elasticsearch.
>
> Cool, thanks for sharing!
>
>> I've had a really awful package definition for this for a while, which
>> just makes the built things in the release tarball run. While this isn't
>> suitable for inclusion in to Guix, it does still work.
>
> Do you know if we=E2=80=99re missing a lot of the Java dependencies to bu=
ild it
> from source?

Unfortunately not, I haven't attempted to build it from source.

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlqtmFNfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE
9Xdejg//ZoQiD5q0FjYUcpAWcGRaxh4YnkGwgnxOpm+HICgoNApdP/ZPN2baHYTE
7TpJGF+4IYGYoYdhPujxFHkzXxrwQzpvxPJbsb+5jutbThqfoQuO5FQCXUDP866d
IHiBKD3Kx+I0+FUwdvYElNI3ELxj/e/Sghgu1WESEsgmCUlWq2F+3tGAIBjGzOYJ
4rCaz9jzt0a4i3NxckPFFaTyhP22EpT4oWf5Q34RNelr8jaGwqgKbHxYWEVvrAiQ
c9P+zBz0FfDa7KVu9pkNljw321b6iJeOsK8lmpyUpIv3EfcH8eFAp34X11gzZtNG
M+jfcBfAq4GAFwCAqeOtGpeBYM9PC9KuVI8aOXxAWjabkDwORc5hYUdNeoN0+/z3
nWYYUj/yfc16Y9OpYRBx2nhmiM4AvJkZydCTMVU5Ie3cKQfK9TdDghyyKuFeHssb
P5+5M3zDWr7Mv8TXcpPoV9fBhMoE+1lzu7DMHEpuifgyd1kp0g7aDnMrp/8sYQDN
8qu6/L54jCL7GZOXJs9ZACwT/2BvGzDyl5UD/ZHr/cAj1DkZlWz5E2VRx0Mmj9x7
td2bwcC5zx4iNIoBf4acN/Ibwjx0wEp+33+NXkRw8MjWIFgg94cwM9owxnUeHzyL
A/lNenD+zp6Eu3+iTgCkmhLHOjtZXh4FFksHtQ7rfy1mK9xCs58=
=NGxi
-----END PGP SIGNATURE-----
--=-=-=--




Information forwarded to guix-patches@HIDDEN:
bug#30803; Package guix-patches. Full text available.

Message received at 30803 <at> debbugs.gnu.org:


Received: (at 30803) by debbugs.gnu.org; 17 Mar 2018 21:06:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 17 17:06:18 2018
Received: from localhost ([127.0.0.1]:38721 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1exJ1s-0001AE-0a
	for submit <at> debbugs.gnu.org; Sat, 17 Mar 2018 17:06:16 -0400
Received: from hera.aquilenet.fr ([185.233.100.1]:48920)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1exJ1q-0001A6-AA
 for 30803 <at> debbugs.gnu.org; Sat, 17 Mar 2018 17:06:14 -0400
Received: from localhost (localhost [127.0.0.1])
 by hera.aquilenet.fr (Postfix) with ESMTP id 3BB4B1325B;
 Sat, 17 Mar 2018 22:06:13 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at aquilenet.fr
Received: from hera.aquilenet.fr ([127.0.0.1])
 by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id Zj-IGQ1QeoCV; Sat, 17 Mar 2018 22:06:11 +0100 (CET)
Received: from ribbon (unknown [IPv6:2a01:e0a:1d:7270:af76:b9b:ca24:c465])
 by hera.aquilenet.fr (Postfix) with ESMTPSA id 64AB31323D;
 Sat, 17 Mar 2018 22:06:11 +0100 (CET)
From: ludo@HIDDEN (Ludovic =?utf-8?Q?Court=C3=A8s?=)
To: Christopher Baines <mail@HIDDEN>
Subject: Re: [bug#30803] [PATCH 0/2] Add Elasticsearch package and service.
References: <871sgn23ip.fsf@HIDDEN>
Date: Sat, 17 Mar 2018 22:06:10 +0100
In-Reply-To: <871sgn23ip.fsf@HIDDEN> (Christopher Baines's message of
 "Tue, 13 Mar 2018 19:12:46 +0000")
Message-ID: <874lleo1j1.fsf@HIDDEN>
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: 1.0 (+)
X-Debbugs-Envelope-To: 30803
Cc: 30803 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.0 (+)

Hello Christopher,

Christopher Baines <mail@HIDDEN> skribis:

> I'm trying to reduce the number of patches I have sitting around in git
> branches, so here is a bug about Elasticsearch.

Cool, thanks for sharing!

> I've had a really awful package definition for this for a while, which
> just makes the built things in the release tarball run. While this isn't
> suitable for inclusion in to Guix, it does still work.

Do you know if we=E2=80=99re missing a lot of the Java dependencies to buil=
d it
from source?

Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#30803; Package guix-patches. Full text available.

Message received at 30803 <at> debbugs.gnu.org:


Received: (at 30803) by debbugs.gnu.org; 13 Mar 2018 19:17:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 13 15:17:35 2018
Received: from localhost ([127.0.0.1]:59883 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1evpQS-0002SR-0h
	for submit <at> debbugs.gnu.org; Tue, 13 Mar 2018 15:17:35 -0400
Received: from li622-129.members.linode.com ([212.71.249.129]:35562
 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1evpQP-0002S6-8n
 for 30803 <at> debbugs.gnu.org; Tue, 13 Mar 2018 15:17:29 -0400
Received: by mira.cbaines.net (Postfix, from userid 113)
 id E132D13D067; Tue, 13 Mar 2018 19:17:28 +0000 (GMT)
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,UNPARSEABLE_RELAY,
 URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0
Received: from localhost (cpc102582-walt20-2-0-cust14.13-2.cable.virginm.net
 [86.27.34.15])
 by mira.cbaines.net (Postfix) with ESMTPSA id B8C3613D064
 for <30803 <at> debbugs.gnu.org>; Tue, 13 Mar 2018 19:17:27 +0000 (GMT)
Received: from localhost (localhost [local])
 by localhost (OpenSMTPD) with ESMTPA id 8c9b4d0b
 for <30803 <at> debbugs.gnu.org>; Tue, 13 Mar 2018 19:17:27 +0000 (UTC)
From: Christopher Baines <mail@HIDDEN>
To: 30803 <at> debbugs.gnu.org
Subject: [PATCH 1/2] gnu: Add elasticsearch.
Date: Tue, 13 Mar 2018 19:17:26 +0000
Message-Id: <20180313191727.24508-1-mail@HIDDEN>
X-Mailer: git-send-email 2.16.2
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 30803
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

* gnu/packages/databases.scm (elasticsearch-2.4.6, elasticsearch): New
  variables.
---
 gnu/packages/databases.scm | 64 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 64 insertions(+)

diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index 87f65404f..661ee3a3e 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -69,6 +69,7 @@
   #:use-module (gnu packages guile)
   #:use-module (gnu packages time)
   #:use-module (gnu packages golang)
+  #:use-module (gnu packages java)
   #:use-module (gnu packages jemalloc)
   #:use-module (gnu packages language)
   #:use-module (gnu packages libevent)
@@ -355,6 +356,69 @@ ElasticSearch server")
     (home-page "https://github.com/patientslikeme/es_dump_restore")
     (license license:expat)))
 
+(define-public elasticsearch-2.4.6
+  (package
+   (name "elasticsearch")
+   (version "2.4.6")
+   (source
+    (origin
+     (method url-fetch)
+     (uri (string-append
+           "https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-"
+           version ".tar.gz"))
+     (sha256
+      (base32 "0vzw9kpyyyv3f1m5sy9zara6shc7xkgi5xm5qbzvfywijavlnzjz"))))
+   (build-system gnu-build-system)
+   (inputs
+    `(("jre" ,icedtea)
+      ("coreutils" ,coreutils)
+      ("inetutils" ,inetutils)
+      ("util-linux" ,util-linux)
+      ("grep" ,grep)))
+   (arguments
+    `(#:phases
+      (modify-phases %standard-phases
+        (delete 'check)
+        (delete 'configure)
+        (delete 'build)
+        (replace 'install
+          (lambda* (#:key inputs outputs #:allow-other-keys)
+            (let ((out (assoc-ref outputs "out")))
+              (for-each
+               (lambda (dir)
+                 (copy-recursively dir (string-append out "/" dir)
+                                   #:log (%make-void-port "w")))
+               '("bin" "config" "lib" "modules"))
+              (for-each
+               (lambda (dir)
+                 (mkdir (string-append out "/" dir)))
+               '("plugins"))
+              (for-each
+               delete-file
+               (find-files
+                (string-append out "/lib")
+                (lambda (name stat)
+                  (or (string-contains name "freebsd")
+                      (string-contains name "solaris")))))
+              (wrap-program
+                  (string-append out "/bin/elasticsearch")
+                `("PATH" = (,(string-append (assoc-ref inputs "util-linux")
+                                            "/bin")
+                            ,(string-append (assoc-ref inputs "coreutils")
+                                            "/bin")
+                            ,(string-append (assoc-ref inputs "inetutils")
+                                            "/bin")
+                            ,(string-append (assoc-ref inputs "grep")
+                                            "/bin")))
+                `("JAVA_HOME" = (,(assoc-ref inputs "jre"))))
+              #t))))))
+   (home-page "")
+   (synopsis "")
+   (description "")
+   (license "")))
+
+(define-public elasticsearch elasticsearch-2.4.6)
+
 (define-public leveldb
   (package
     (name "leveldb")
-- 
2.16.2





Information forwarded to guix-patches@HIDDEN:
bug#30803; Package guix-patches. Full text available.

Message received at 30803 <at> debbugs.gnu.org:


Received: (at 30803) by debbugs.gnu.org; 13 Mar 2018 19:17:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 13 15:17:31 2018
Received: from localhost ([127.0.0.1]:59881 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1evpQQ-0002SJ-Ko
	for submit <at> debbugs.gnu.org; Tue, 13 Mar 2018 15:17:30 -0400
Received: from li622-129.members.linode.com ([212.71.249.129]:35558
 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1evpQO-0002S5-Om
 for 30803 <at> debbugs.gnu.org; Tue, 13 Mar 2018 15:17:29 -0400
Received: by mira.cbaines.net (Postfix, from userid 113)
 id 2BB1013D069; Tue, 13 Mar 2018 19:17:28 +0000 (GMT)
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,UNPARSEABLE_RELAY
 autolearn=ham autolearn_force=no version=3.4.0
Received: from localhost (cpc102582-walt20-2-0-cust14.13-2.cable.virginm.net
 [86.27.34.15])
 by mira.cbaines.net (Postfix) with ESMTPSA id D3FC613D067
 for <30803 <at> debbugs.gnu.org>; Tue, 13 Mar 2018 19:17:27 +0000 (GMT)
Received: from localhost (localhost [local])
 by localhost (OpenSMTPD) with ESMTPA id 4535d048
 for <30803 <at> debbugs.gnu.org>; Tue, 13 Mar 2018 19:17:27 +0000 (UTC)
From: Christopher Baines <mail@HIDDEN>
To: 30803 <at> debbugs.gnu.org
Subject: [PATCH 2/2] services: Add elasticsearch.
Date: Tue, 13 Mar 2018 19:17:27 +0000
Message-Id: <20180313191727.24508-2-mail@HIDDEN>
X-Mailer: git-send-email 2.16.2
In-Reply-To: <20180313191727.24508-1-mail@HIDDEN>
References: <20180313191727.24508-1-mail@HIDDEN>
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 30803
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

---
 gnu/services/databases.scm | 107 +++++++++++++++++++++++++++++++++++++++++++++
 gnu/tests/databases.scm    |  57 +++++++++++++++++++++++-
 2 files changed, 163 insertions(+), 1 deletion(-)

diff --git a/gnu/services/databases.scm b/gnu/services/databases.scm
index 72927c453..cbb9e1699 100644
--- a/gnu/services/databases.scm
+++ b/gnu/services/databases.scm
@@ -51,6 +51,18 @@
             postgresql-service
             postgresql-service-type
 
+            <elasticsearch-configuration>
+            elasticsearch-configuration
+            elasticsearch-configuration?
+            elasticsearch-configuration-elasticsearch
+            elasticsearch-configuration-data-path
+            elasticsearch-configuration-logs-path
+            elasticsearch-configuration-port
+            elasticsearch-configuration-transport-port
+
+            elasticsearch-service
+            elasticsearch-service-type
+
             memcached-service-type
             <memcached-configuration>
             memcached-configuration
@@ -260,6 +272,101 @@ and stores the database cluster in @var{data-directory}."
             (data-directory data-directory))))
 
 
+;;;
+;;; Elasticsearch
+;;;
+
+(define-record-type* <elasticsearch-configuration>
+  elasticsearch-configuration make-elasticsearch-configuration
+  elasticsearch-configuration?
+  (elasticsearch     elasticsearch-configuration-elasticsearch
+                     (default elasticsearch))
+  (data-path         elasticsearch-configuration-data-path
+                     (default "/var/lib/"))
+  (logs-path         elasticsearch-configuration-logs-path
+                     (default "/var/log/elasticsearch"))
+  (http-port         elasticsearch-configuration-port
+                     (default 9200))
+  (transport-port    elasticsearch-configuration-transport-port
+                     (default 9300)))
+
+(define (elasticsearch-configuration-directory
+         data-path logs-path http-port transport-port)
+  (computed-file
+   "elasticsearch-config"
+   #~(begin
+       (mkdir #$output)
+       (mkdir (string-append #$output "/scripts"))
+       (call-with-output-file (string-append #$output "/elasticsearch.yml")
+         (lambda (port)
+           (display
+            (string-append
+             "path.data: " #$data-path "\n"
+             "path.logs: " #$logs-path "\n"
+             "http.port: " #$(number->string http-port) "\n"
+             "transport.tcp.port: " #$(number->string transport-port) "\n")
+            port))))))
+
+(define %elasticsearch-accounts
+  (list (user-group (name "elasticsearch") (system? #t))
+        (user-account
+         (name "elasticsearch")
+         (group "elasticsearch")
+         (system? #t)
+         (comment "Elasticsearch server user")
+         (home-directory "/var/empty")
+         (shell (file-append shadow "/sbin/nologin")))))
+
+(define elasticsearch-activation
+  (match-lambda
+    (($ <elasticsearch-configuration> elasticsearch data-path logs-path
+                                      http-port transport-port)
+     #~(begin
+         (use-modules (guix build utils)
+                      (ice-9 match))
+
+         (let ((user (getpwnam "elasticsearch")))
+           ;; Create db state directory.
+           (for-each
+            (lambda (path)
+              (mkdir-p path)
+              (chown path (passwd:uid user) (passwd:gid user)))
+            '(#$data-path #$logs-path "/var/run/elasticsearch")))))))
+
+(define elasticsearch-shepherd-service
+  (match-lambda
+    (($ <elasticsearch-configuration> elasticsearch data-path logs-path
+                                      http-port transport-port)
+     (list (shepherd-service
+            (provision '(elasticsearch))
+            (documentation "Run the Elasticsearch daemon.")
+            (requirement '(user-processes syslogd))
+            (start #~(make-forkexec-constructor
+                      (list
+                       (string-append #$elasticsearch "/bin/elasticsearch")
+                       "-d"
+                       "-p" "/var/run/elasticsearch/pid"
+                       (string-append
+                        "-Dpath.conf="
+                        #$(elasticsearch-configuration-directory
+                           data-path logs-path http-port transport-port)))
+                      #:user "elasticsearch"
+                      #:pid-file "/var/run/elasticsearch/pid"
+                      #:log-file "/var/log/elasticsearch.log"))
+            (stop #~(make-kill-destructor)))))))
+
+(define elasticsearch-service-type
+  (service-type (name 'elasticsearch)
+                (extensions
+                 (list (service-extension shepherd-root-service-type
+                                          elasticsearch-shepherd-service)
+                       (service-extension activation-service-type
+                                          elasticsearch-activation)
+                       (service-extension account-service-type
+                                          (const %elasticsearch-accounts))))
+                (default-value (elasticsearch-configuration))))
+
+
 ;;;
 ;;; Memcached
 ;;;
diff --git a/gnu/tests/databases.scm b/gnu/tests/databases.scm
index 5c8ca85c1..e07a1f9dd 100644
--- a/gnu/tests/databases.scm
+++ b/gnu/tests/databases.scm
@@ -31,7 +31,8 @@
   #:export (%test-memcached
             %test-mongodb
             %test-postgresql
-            %test-mysql))
+            %test-mysql
+            %test-elasticsearch))
 
 (define %memcached-os
   (simple-operating-system
@@ -319,3 +320,57 @@
    (name "mysql")
    (description "Start the MySQL service.")
    (value (run-mysql-test))))
+
+
+;;;
+;;; The Elasticsearch service.
+;;;
+
+(define %elasticsearch-os
+  (simple-operating-system
+   (service elasticsearch-service-type)))
+
+(define (run-elasticsearch-test)
+  "Run tests in %ELASTICSEARCH-OS."
+  (define os
+    (marionette-operating-system
+     %elasticsearch-os
+     #:imported-modules '((gnu services herd)
+                          (guix combinators))))
+
+  (define vm
+    (virtual-machine
+     (operating-system os)
+     (memory-size 512)))
+
+  (define test
+    (with-imported-modules '((gnu build marionette))
+      #~(begin
+          (use-modules (srfi srfi-64)
+                       (gnu build marionette))
+
+          (define marionette
+            (make-marionette (list #$vm)))
+
+          (mkdir #$output)
+          (chdir #$output)
+
+          (test-begin "elasticsearch")
+
+          (test-assert "service running"
+            (marionette-eval
+             '(begin
+                (use-modules (gnu services herd))
+                (start-service 'elasticsearch))
+             marionette))
+
+          (test-end)
+          (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
+
+  (gexp->derivation "elasticsearch-test" test))
+
+(define %test-elasticsearch
+  (system-test
+   (name "elasticsearch")
+   (description "Start the Elasticsearch service.")
+   (value (run-elasticsearch-test))))
-- 
2.16.2





Information forwarded to guix-patches@HIDDEN:
bug#30803; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 13 Mar 2018 19:13:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 13 15:13:03 2018
Received: from localhost ([127.0.0.1]:59873 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1evpM6-0002Je-RF
	for submit <at> debbugs.gnu.org; Tue, 13 Mar 2018 15:13:03 -0400
Received: from eggs.gnu.org ([208.118.235.92]:40446)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1evpM5-0002J0-3E
 for submit <at> debbugs.gnu.org; Tue, 13 Mar 2018 15:13:01 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <mail@HIDDEN>) id 1evpLy-0007uX-Le
 for submit <at> debbugs.gnu.org; Tue, 13 Mar 2018 15:12:55 -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.5 required=5.0 tests=BAYES_05 autolearn=disabled
 version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:60638)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <mail@HIDDEN>) id 1evpLy-0007uK-J1
 for submit <at> debbugs.gnu.org; Tue, 13 Mar 2018 15:12:54 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:59592)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <mail@HIDDEN>) id 1evpLx-0007k5-GG
 for guix-patches@HIDDEN; Tue, 13 Mar 2018 15:12:54 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <mail@HIDDEN>) id 1evpLu-0007oe-Ai
 for guix-patches@HIDDEN; Tue, 13 Mar 2018 15:12:53 -0400
Received: from mira.cbaines.net ([2a01:7e00::f03c:91ff:fe69:8da9]:57748)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <mail@HIDDEN>) id 1evpLu-0007oS-3y
 for guix-patches@HIDDEN; Tue, 13 Mar 2018 15:12:50 -0400
Received: by mira.cbaines.net (Postfix, from userid 113)
 id 8509313D067; Tue, 13 Mar 2018 19:12:49 +0000 (GMT)
Received: from localhost (cpc102582-walt20-2-0-cust14.13-2.cable.virginm.net
 [86.27.34.15])
 by mira.cbaines.net (Postfix) with ESMTPSA id 5F08413D064
 for <guix-patches@HIDDEN>; Tue, 13 Mar 2018 19:12:49 +0000 (GMT)
Received: from giedi (localhost [127.0.0.1])
 by localhost (OpenSMTPD) with ESMTP id 197f9536
 for <guix-patches@HIDDEN>; Tue, 13 Mar 2018 19:12:49 +0000 (UTC)
User-agent: mu4e 1.0; emacs 25.3.1
From: Christopher Baines <mail@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH 0/2] Add Elasticsearch package and service.
Date: Tue, 13 Mar 2018 19:12:46 +0000
Message-ID: <871sgn23ip.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha512; protocol="application/pgp-signature"
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: -0.5 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.5 (/)

--=-=-=
Content-Type: text/plain

Tags: moreinfo

I'm trying to reduce the number of patches I have sitting around in git
branches, so here is a bug about Elasticsearch.

I've had a really awful package definition for this for a while, which
just makes the built things in the release tarball run. While this isn't
suitable for inclusion in to Guix, it does still work.

Also included is a service, along with a really simple test.


Christopher Baines (2):
  gnu: Add elasticsearch.
  services: Add elasticsearch.

 gnu/packages/databases.scm |  64 +++++++++++++++++++++++++++
 gnu/services/databases.scm | 107 +++++++++++++++++++++++++++++++++++++++++++++
 gnu/tests/databases.scm    |  57 +++++++++++++++++++++++-
 3 files changed, 227 insertions(+), 1 deletion(-)

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlqoIq5fFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE
9XdmbA//bxqx1YPnqNWxUURtKQawZoDzhG0DuNHrzH66PZOkLkiSrU53v8TBMQVH
o80IdFqfyAs7/BYEytgIGEprRW7SCwdpS2og8PZuDXTg07hDchdO1KP+7keOz12O
4Gvzr6s36ZfXqFXozLmDYe+Tlms/4WP22+DcYBNMPm4W/HcXhX3gxl7vlUoApkEU
B8Zb8Ap3YZD3IEgDhWkykoHuP0gR6Q0ArRXUCPwoFE+0gds5/TZMkKDB0WrDl4lk
HirSTp2r491Y+pVEO63hjpnuB43LRgwLGOleHeZ61ncCztrEqogUz8zDqQ3STPAN
VRLzK6kByGaRU1fDRh0/GzcDfEcNRsR2efsA5mYPNCY9dBxyNTv4a7a9tn+NjhEY
XnHULCNyGw+C4+sW8VuEt/OjCXGouHe9C8/akqqeNMhmeTw6Pl3jQGShZfZpRKEe
GjOY00WHaOCmiHa0i2R3EE+9zrP4yiDRZOf5K3sbAlSknFuMMl+KeGr8rCq+MX1z
ZSzxCi2phq5PYIxAwsVRyR93Dy5k8FjE6/8WPnX10PsZS6NszSslhewJatMDUhzb
4mGWsAyNKbMMPHQJEqcrkFIbGSn3Se/SLiHfWqN/tGyt8sZ2gTNg+vJy4KLK80t6
NB3jIgncYRSrybs+Zn6eCs+I5u3BOQSsTTs6R2HGnk/eYlOI4t8=
=2KjD
-----END PGP SIGNATURE-----
--=-=-=--




Acknowledgement sent to Christopher Baines <mail@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#30803; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.