[PATCH 0/8] adding nats-server package

  • Done
  • quality assurance status badge
Details
2 participants
  • Benjamin
  • Sharlatan Hellseher
Owner
unassigned
Submitted by
Benjamin
Severity
normal
B
B
Benjamin wrote on 18 Nov 2023 19:14
(address . guix-patches@gnu.org)(name . Benjamin)(address . benjamin@uvy.fr)
cover.1700330009.git.benjamin@uvy.fr
Hello,

Here is a series of patch that is adding nats-server.
Nats [0] is a nice implementation in go of a message broker that is
memory efficient, really fast and also quite easy to package.

For now, I only added the server part. I am working on the command line
client but it is much more complicated to package (because of the number
of dependencies to add). I will add it in the future.

I added the nats-server in messaging.scm because I saw another message
broker there. The other possible location would be in golang.scm.

Best

Benjamin



Benjamin (8):
gnu: Add go-github-com-minio-highwayhash.
gnu: Add go-github-com-prashantv-gostub.
gnu: Add go-go-uber-org-automaxprocs.
gnu: Add go-github-com-nats-io-nuid.
gnu: Add go-github-com-nats-io-nkeys.
gnu: Add go-github-com-nats-io-jwt-v2.
gnu: Add go-github-com-nats-io-nats-go.
gnu: Add nats-server.

gnu/packages/golang-check.scm | 24 ++++++
gnu/packages/golang.scm | 148 ++++++++++++++++++++++++++++++++++
gnu/packages/messaging.scm | 32 ++++++++
3 files changed, 204 insertions(+)


base-commit: 2ab5e449246f98b049888dde3c310f5b4a0a64a2
--
2.41.0
B
B
Benjamin wrote on 18 Nov 2023 19:17
[PATCH 1/8] gnu: Add go-github-com-minio-highwayhash.
(name . Benjamin)(address . benjamin@uvy.fr)
23832dff8247bb34f3da1ceb04181bf90ffd5e4e.1700330009.git.benjamin@uvy.fr
* gnu/packages/golang.scm (go-github-com-minio-highwayhash): New variable.

Change-Id: Ib6aa8a38946841e840b17848b07434487f0435ef
---
gnu/packages/golang.scm | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)

Toggle diff (38 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 9c707e5414..00620690b9 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -6405,6 +6405,31 @@ (define-public go-github-com-minio-blake2b-simd
increase approaching hashing speeds of 1GB/sec on a single core.")
(license license:asl2.0))))
+(define-public go-github-com-minio-highwayhash
+ (package
+ (name "go-github-com-minio-highwayhash")
+ (version "1.0.2")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/minio/highwayhash")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1inrix7720273ccynxcyi7xsgc55cskxrw7gwn08qkmdj9xdxqai"))))
+ (build-system go-build-system)
+ (arguments
+ '(#:import-path "github.com/minio/highwayhash"))
+ (propagated-inputs (list go-golang-org-x-sys))
+ (home-page "https://github.com/minio/highwayhash")
+ (synopsis "HighwayHash library for Go")
+ (description
+ "This package implements the pseudo-random-function (PRF) HighwayHash.
+HighwayHash is a fast hash function designed to defend hash-flooding attacks or
+to authenticate short-lived messages.")
+ (license license:asl2.0)))
+
(define-public go-github-com-spaolacci-murmur3
(package
(name "go-github-com-spaolacci-murmur3")
--
2.41.0
B
B
Benjamin wrote on 18 Nov 2023 19:17
[PATCH 2/8] gnu: Add go-github-com-prashantv-gostub.
(name . Benjamin)(address . benjamin@uvy.fr)
5f3c5d8b36713a7e28f1e974b1d2e112e1442e86.1700330009.git.benjamin@uvy.fr
* gnu/packages/golang-check.scm (go-github-com-prashantv-gostub): New variable.

Change-Id: I2ffde6cb83e4c7f6b2e412b38341add952803719
---
gnu/packages/golang-check.scm | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)

Toggle diff (37 lines)
diff --git a/gnu/packages/golang-check.scm b/gnu/packages/golang-check.scm
index 42e501a6e3..a54a4bd226 100644
--- a/gnu/packages/golang-check.scm
+++ b/gnu/packages/golang-check.scm
@@ -414,6 +414,30 @@ (define-public go-github-com-stretchr-testify
@end itemize")
(license license:expat)))
+(define-public go-github-com-prashantv-gostub
+ (package
+ (name "go-github-com-prashantv-gostub")
+ (version "1.1.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/prashantv/gostub")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "035xf5w4fqlicdbbjcflsqflc0z5gmrn6wr7q41xwqfwfpraf9ah"))))
+ (build-system go-build-system)
+ (arguments
+ '(#:import-path "github.com/prashantv/gostub"))
+ (native-inputs (list go-github-com-stretchr-testify))
+ (home-page "https://github.com/prashantv/gostub")
+ (synopsis "Stubbing library for Go")
+ (description
+ "Package gostub is used for stubbing variables in tests, and resetting the
+original value once the test has been run.")
+ (license license:expat)))
+
(define-public go-github-com-tdewolff-test
(package
(name "go-github-com-tdewolff-test")
--
2.41.0
B
B
Benjamin wrote on 18 Nov 2023 19:17
[PATCH 3/8] gnu: Add go-go-uber-org-automaxprocs.
(name . Benjamin)(address . benjamin@uvy.fr)
29a2b081d37ecda469d338204769feeecf77a4d3.1700330009.git.benjamin@uvy.fr
* gnu/packages/golang.scm (go-go-uber-org-automaxprocs): New variable.

Change-Id: I06abcaf3f3b74e23e5808d4ff37a93a0dc45b137
---
gnu/packages/golang.scm | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)

Toggle diff (38 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 00620690b9..b644783d1d 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -11500,6 +11500,31 @@ (define-public go-go-uber-org-zap
Go.")
(license license:expat)))
+(define-public go-go-uber-org-automaxprocs
+ (package
+ (name "go-go-uber-org-automaxprocs")
+ (version "1.5.3")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/uber-go/automaxprocs")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "03arxcfaj7k6iwfdk0liaynxf9rjfj9m5glsjp7ws01xjkgrdpbc"))))
+ (build-system go-build-system)
+ (arguments
+ '(#:import-path "go.uber.org/automaxprocs"))
+ (native-inputs (list go-github-com-stretchr-testify
+ go-github-com-prashantv-gostub))
+ (home-page "https://go.uber.org/automaxprocs")
+ (synopsis "CPU-count detection library for Go")
+ (description
+ "This package automatically set GOMAXPROCS to match Linux container
+CPU quota.")
+ (license license:expat)))
+
(define-public go-github-com-davecgh-go-xdr
(package
(name "go-github-com-davecgh-go-xdr")
--
2.41.0
B
B
Benjamin wrote on 18 Nov 2023 19:17
[PATCH 4/8] gnu: Add go-github-com-nats-io-nuid.
(name . Benjamin)(address . benjamin@uvy.fr)
6bebe928d54cb6b882beb3a20f7e2640b7cf70b0.1700330009.git.benjamin@uvy.fr
* gnu/packages/golang.scm (go-github-com-nats-io-nuid): New variable.

Change-Id: I71ef84703b6971cabacafcba09d1447544fb48bf
---
gnu/packages/golang.scm | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)

Toggle diff (36 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index b644783d1d..74c3da8ba4 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -3292,6 +3292,29 @@ (define-public go-github-com-hebcal-hebcal-go
and anniversaries.")
(license license:gpl2+))))
+(define-public go-github-com-nats-io-nuid
+ (package
+ (name "go-github-com-nats-io-nuid")
+ (version "1.0.1")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/nats-io/nuid")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "11zbhg4kds5idsya04bwz4plj0mmiigypzppzih731ppbk2ms1zg"))))
+ (build-system go-build-system)
+ (arguments
+ '(#:import-path "github.com/nats-io/nuid"))
+ (home-page "https://github.com/nats-io/nuid")
+ (synopsis "Go library implementing identifier generator for NATS ecosystem")
+ (description
+ "This package provides a unique identifier generator that is high performance,
+very fast, and tries to be entropy pool friendly.")
+ (license license:asl2.0)))
+
(define-public go-github-com-aws-sdk
(package
(name "go-github-com-aws-sdk")
--
2.41.0
B
B
Benjamin wrote on 18 Nov 2023 19:17
[PATCH 5/8] gnu: Add go-github-com-nats-io-nkeys.
(name . Benjamin)(address . benjamin@uvy.fr)
51662c100b361821e6738e2b985ea9153b6986b6.1700330009.git.benjamin@uvy.fr
* gnu/packages/golang.scm (go-github-com-nats-io-nkeys): New variable.

Change-Id: Id82a9afd15f110426fd7a16b286b5af5cae45c6a
---
gnu/packages/golang.scm | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)

Toggle diff (37 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 74c3da8ba4..d52ec94059 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -3315,6 +3315,30 @@ (define-public go-github-com-nats-io-nuid
very fast, and tries to be entropy pool friendly.")
(license license:asl2.0)))
+(define-public go-github-com-nats-io-nkeys
+ (package
+ (name "go-github-com-nats-io-nkeys")
+ (version "0.4.6")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/nats-io/nkeys")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0l9ssz8bm9gqr07x5hif9r5b1mb324x61x4kkvgzvcqfm7wzh22a"))))
+ (build-system go-build-system)
+ (arguments
+ '(#:import-path "github.com/nats-io/nkeys"))
+ (propagated-inputs (list go-golang-org-x-crypto))
+ (home-page "https://github.com/nats-io/nkeys")
+ (synopsis "Go library implementing public-key system for NATS ecosystem")
+ (description
+ "This package is an Ed25519 based public-key signature system that simplifies
+keys and seeds and performs signing and verification.")
+ (license license:asl2.0)))
+
(define-public go-github-com-aws-sdk
(package
(name "go-github-com-aws-sdk")
--
2.41.0
B
B
Benjamin wrote on 18 Nov 2023 19:17
[PATCH 6/8] gnu: Add go-github-com-nats-io-jwt-v2.
(name . Benjamin)(address . benjamin@uvy.fr)
021459b2ecc018146d8baa9e3166aff51b5036f7.1700330009.git.benjamin@uvy.fr
* gnu/packages/golang.scm (go-github-com-nats-io-jwt-v2): New variable.

Change-Id: I5253db9ceb1aa118cfc15e89823903f3f5b2b75c
---
gnu/packages/golang.scm | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)

Toggle diff (38 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index d52ec94059..17ec5296bf 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -3339,6 +3339,31 @@ (define-public go-github-com-nats-io-nkeys
keys and seeds and performs signing and verification.")
(license license:asl2.0)))
+(define-public go-github-com-nats-io-jwt-v2
+ (package
+ (name "go-github-com-nats-io-jwt-v2")
+ (version "2.5.3")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/nats-io/jwt")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0wcqbfyd3b4qdspmf72cpsbi0y2a4b1qd0cv3qvhh17d1h1a6zib"))))
+ (build-system go-build-system)
+ (arguments
+ (list #:import-path "github.com/nats-io/jwt/v2"
+ #:unpack-path "github.com/nats-io/jwt"))
+ (propagated-inputs (list go-github-com-nats-io-nkeys))
+ (home-page "https://github.com/nats-io/jwt")
+ (synopsis "Go library signing JWT tokens with NKeys for the NATS ecosystem")
+ (description
+ "This library is a JWT implementation that uses nkeys to digitally sign
+JWT tokens. Nkeys use Ed25519 to provide authentication of JWT claims.")
+ (license license:asl2.0)))
+
(define-public go-github-com-aws-sdk
(package
(name "go-github-com-aws-sdk")
--
2.41.0
B
B
Benjamin wrote on 18 Nov 2023 19:17
[PATCH 7/8] gnu: Add go-github-com-nats-io-nats-go.
(name . Benjamin)(address . benjamin@uvy.fr)
c9701e2753c0061bc28b8cdc8e84717b28fa6995.1700330009.git.benjamin@uvy.fr
* gnu/packages/golang.scm (go-github-com-nats-io-nats-go): New variable.

Change-Id: Ic2897e20fdcd8d68505f8a96281071fe3de224c9
---
gnu/packages/golang.scm | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)

Toggle diff (39 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 17ec5296bf..2ec9938a98 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -3364,6 +3364,32 @@ (define-public go-github-com-nats-io-jwt-v2
JWT tokens. Nkeys use Ed25519 to provide authentication of JWT claims.")
(license license:asl2.0)))
+(define-public go-github-com-nats-io-nats-go
+ (package
+ (name "go-github-com-nats-io-nats-go")
+ (version "1.31.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/nats-io/nats.go")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0jqzqjwpp3p4fwpv2qcwskysnvgggp22p60zg3w25d3xsainjpbi"))))
+ (build-system go-build-system)
+ (arguments
+ (list #:go go-1.20 #:import-path "github.com/nats-io/nats.go"))
+ (propagated-inputs (list go-golang-org-x-text
+ go-github-com-nats-io-nuid
+ go-github-com-nats-io-nkeys
+ go-github-com-klauspost-compress))
+ (home-page "https://github.com/nats-io/nats.go")
+ (synopsis "Go Client for NATS server")
+ (description
+ "This package provides a Go client for the NATS messaging system.")
+ (license license:asl2.0)))
+
(define-public go-github-com-aws-sdk
(package
(name "go-github-com-aws-sdk")
--
2.41.0
B
B
Benjamin wrote on 18 Nov 2023 19:17
[PATCH 8/8] gnu: Add nats-server.
(name . Benjamin)(address . benjamin@uvy.fr)
8cd092123fd42e51fe17ce528f5e717146a81b19.1700330009.git.benjamin@uvy.fr
* gnu/packages/messaging.scm (nats-server): New variable.

Change-Id: Idb05684fae798b37d396279f136f11fce85e2e02
---
gnu/packages/messaging.scm | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)

Toggle diff (45 lines)
diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index 1c5bc4bbd7..04474a1094 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -2889,6 +2889,38 @@ (define-public mosquitto
;; Dual licensed.
(license (list license:epl1.0 license:edl1.0))))
+(define-public nats-server
+ (package
+ (name "nats-server")
+ (version "2.10.5")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/nats-io/nats-server")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "07dcn6him4r1chsqr9p4i7fnbfw60gq29f4zmlyljf2c47i58rf9"))))
+ (build-system go-build-system)
+ (inputs (list go-github-com-klauspost-compress go-github-com-minio-highwayhash
+ go-github-com-nats-io-jwt-v2 go-github-com-nats-io-nats-go
+ go-github-com-nats-io-nkeys go-github-com-nats-io-nuid
+ go-go-uber-org-automaxprocs go-golang-org-x-crypto
+ go-golang-org-x-sys go-golang-org-x-time))
+ (arguments
+ (list #:go go-1.20 #:import-path "github.com/nats-io/nats-server" #:install-source? #f))
+ (home-page "https://github.com/nats-io/nats-server")
+ (synopsis "High performance message broker")
+ (description
+ "NATS is a simple, secure and performant communications system for digital
+ systems, services and devices. NATS is part of the Cloud Native Computing
+ Foundation (CNCF). NATS has over 40 client language implementations, and its
+ server can run on-premise, in the cloud, at the edge, and even on a Raspberry
+ Pi. NATS can secure and simplify design and operation of modern distributed
+ systems.")
+ (license license:asl2.0)))
+
(define-public python-paho-mqtt
(package
(name "python-paho-mqtt")
--
2.41.0
S
S
Sharlatan Hellseher wrote on 1 Feb 20:55 +0100
[PATCH 0/8] adding nats-server package
(address . 67263@debbugs.gnu.org)
CAO+9K5oQty2xo_KBzfV1jLZ-M__W8cWAjoK0tj3e8otbfm1vjQ@mail.gmail.com
Hi,

Thank you for the patches!

I started the review process for this series.

NATS is in the same group as nsq, rabitmq, Kafka.
We may place it to high-availability module next to nsq.

golang.scm is a process of split into logical modules (golang-check,
golang-crypto, golang-web, gokang-xyz). I would place
packages which provides golag modules in any relevant.

Thanks,
Oleg
Attachment: file
S
S
Sharlatan Hellseher wrote on 8 Feb 22:55 +0100
(address . 67263-done@debbugs.gnu.org)
87zfwatyd5.fsf@gmail.com
Hi Benjamin,

Your patches are finally reviewed, merged, sorted by golang-*.scm
modules and updated to the latest versions. I've slightly adjust some of
the to resolve lint warnings. nats-server is placed to high-availability
module next to nsq.

Looking foward for service(s) now =)

Pushed as ff61ca41d9..2d084f23a2 to master.

Regards,
Oleg
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEmEeB3micIcJkGAhndtcnv/Ys0rUFAmXFTcYACgkQdtcnv/Ys
0rX0Og/+KApqjKIjs2jJwOyJLy2fRxDFdAB9QGL5IfJVMOwkN/SSC2JfpoRTGcyE
9gTdTHdYibuTHdA9gY1XcZC+iay7wtCwVhumo2SIzB3O2t7hDz3X4J7IP+GT3Yh0
I02YkEoi1Ds3CyeZlNBXjJdQwiSeBIwQa9vc3ULDGYBgqQN2vDNKpu2mq/4p/mmk
C2TyhYppmcWuHBmLrDCLL5BOc613zFgS50MzNW94x2JG76XeZq1mTTNF3tKSFST9
VsAbNlMcrLC+7CFxWIPHDFLGAFdaUOdLnP5ttcwMOFgcJGaW4Z9iFPFkecwHtWzR
H3fFtiTJwiyGhX/t+7NPUTAdSXxACjJoF0AuXDNuIkHRw4OIAsQwCacE6pmD63GH
fdrguboDF3a5/F7+l6z4V1VLbx4sydPkHhllRVrztXPPlQ7Bo1ay+VvC+bSWDNtO
Er+9KUAbDl/Qr30fWF0IfgsJxP/iwPM0DT2DSx5Lloyj0SBIaCZPZGrnByGyUdQg
+FeWaAlZO9tXWOaR5X4CAWhPOPuNo6ynCSfxbUEvCpaFTi9p2zmE1sEGOnpb1yNg
uDD1bvt/W2GIAyK6PwtrfRVgVFLVMipvM37HdxpAvKavTITadqVQU8qXWQduco6l
PLwxP0kRW9eYGd/qS3ISCuXmIiUyaXhsbO9XD9WCPRk6OtkJmm4=
=6OHB
-----END PGP SIGNATURE-----

Closed
?