Skip to contentSkip to conversation

package/redis: bump to Redis 6

PATCH New Titouan Christophe 2 participants 9 messages Jun 2, 2020 – Jun 5, 2020

lore
Share & tools
lore
#0 lore raw

v2 cover package/redis: bump to Redis 6

This series bumps Redis to the new major version 6.

Redis 6 introduces new data types and commands, support for clients ACL, TLS connections, client-side caching, threaded I/O, and many other improvements. See the full announcement on: http://antirez.com/news/132
See the changelog:
https://raw.githubusercontent.com/antirez/redis/6.0/00-RELEASENOTES

In addition to the version bump, this series also adds a runtime test for Redis, and enables support for TLS and Systemd integration.
---
Changes v1 -> v2:
* Bump to Redis 6.0.4 instead of 6.0.1
* Drop patch which has been applied upstream
---
Titouan Christophe (4):
package/redis: bump to version 6.0.4
support/testing: add runtime test for Redis
package/redis: add optional support for TLS connections package/redis: add optional support for systemd

 .gitlab-ci.yml                              |  1 +
 DEVELOPERS                                  |  1 +
 package/redis/Config.in                     | 15 +++++++------
 package/redis/redis.hash                    |  4 ++--
 package/redis/redis.mk                      | 11 +++++++++-
 package/redis/redis.service                 | 10 +++++----
 support/testing/tests/package/test_redis.py | 24 +++++++++++++++++++++
 7 files changed, 53 insertions(+), 13 deletions(-)
 create mode 100644 support/testing/tests/package/test_redis.py
Signature · 1 line
2.25.3
#1 lore raw

PATCH v2 1/4 package/redis: bump to version 6.0.4

- Update dependencies in Config.in because of new requirements
- Update the help text in Config.in to a more recent wording
- Update the hash file to the new 2 spaces convention

---
 package/redis/Config.in  | 15 +++++++++------
 package/redis/redis.hash |  4 ++--
 package/redis/redis.mk   |  2 +-
 3 files changed, 12 insertions(+), 9 deletions(-)
package/redis/Config.in +9 -6
index 2450ccdf7f..5c418da73c 100644
@@ -2,16 +2,19 @@ config BR2_PACKAGE_REDIS
 	bool "redis"
 	depends on BR2_USE_MMU # fork()
 	depends on !BR2_STATIC_LIBS # dlfcn.h
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # _Atomic keyword
 	depends on BR2_TOOLCHAIN_HAS_ATOMIC
-	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL # pthread_setname_np()
 	help
-	  Redis is an open source, advanced key-value store. It is
-	  often referred to as a data structure server since keys can
-	  contain strings, hashes, lists, sets and sorted sets.
+	  Redis is an open source (BSD licensed), in-memory data structure
+	  store, used as a database, cache and message broker. It supports
+	  data structures such as strings, hashes, lists, sets, sorted sets
+	  with range queries, bitmaps, hyperloglogs, geospatial indexes with
+	  radius queries and streams.
 
 	  http://www.redis.io
 
-comment "redis needs a toolchain w/ dynamic library, threads"
+comment "redis needs a toolchain w/ gcc>=4.9, dynamic library, nptl"
 	depends on BR2_USE_MMU
 	depends on BR2_TOOLCHAIN_HAS_ATOMIC
-	depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS_NPTL || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
package/redis/redis.hash +2 -2
index ee15b75e08..cf13bb9c0a 100644
@@ -1,5 +1,5 @@
 # From https://github.com/antirez/redis-hashes/blob/master/README
-sha256 f3c7eac42f433326a8d981b50dba0169fdfaf46abb23fcda2f933a7552ee4ed7  redis-5.0.8.tar.gz
+sha256  3337005a1e0c3aa293c87c313467ea8ac11984921fab08807998ba765c9943de  redis-6.0.4.tar.gz
 
 # Locally calculated
-sha256 cbf420a3672475a6e2765e3c0984c1f81efe0212afb94a3c998ee63bfd661063  COPYING
+sha256  cbf420a3672475a6e2765e3c0984c1f81efe0212afb94a3c998ee63bfd661063  COPYING
package/redis/redis.mk +1 -1
index d3954d87ca..1578f97e0d 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-REDIS_VERSION = 5.0.8
+REDIS_VERSION = 6.0.4
 REDIS_SITE = http://download.redis.io/releases
 REDIS_LICENSE = BSD-3-Clause (core); MIT and BSD family licenses (Bundled components)
 REDIS_LICENSE_FILES = COPYING
Signature · 1 line
2.25.3
#2 lore raw

PATCH v2 1/4 package/redis: bump to version 6.0.4

Titouan, All,

On 2020-06-02 12:40 +0200, Titouan Christophe spake thusly:

Quoted 22 lines

- Update dependencies in Config.in because of new requirements
- Update the help text in Config.in to a more recent wording
- Update the hash file to the new 2 spaces convention

---
 package/redis/Config.in  | 15 +++++++++------
 package/redis/redis.hash |  4 ++--
 package/redis/redis.mk   |  2 +-
 3 files changed, 12 insertions(+), 9 deletions(-)
package/redis/Config.in +1 -1
index 2450ccdf7f..5c418da73c 100644
@@ -2,16 +2,19 @@ config BR2_PACKAGE_REDIS
 	bool "redis"
 	depends on BR2_USE_MMU # fork()
 	depends on !BR2_STATIC_LIBS # dlfcn.h
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # _Atomic keyword
 	depends on BR2_TOOLCHAIN_HAS_ATOMIC
-	depends on BR2_TOOLCHAIN_HAS_THREADS

package/redis/Config.in config BR2_PACKAGE_REDIS · line 13

Quoted 10 lines
package/redis/Config.in +6 -3
+	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL # pthread_setname_np()
 	help
-	  Redis is an open source, advanced key-value store. It is
-	  often referred to as a data structure server since keys can
-	  contain strings, hashes, lists, sets and sorted sets.
+	  Redis is an open source (BSD licensed), in-memory data structure
+	  store, used as a database, cache and message broker. It supports
+	  data structures such as strings, hashes, lists, sets, sorted sets
+	  with range queries, bitmaps, hyperloglogs, geospatial indexes with
+	  radius queries and streams.

make check-package complained about the width of the lines. Fixed when applying.

package/redis/Config.in config BR2_PACKAGE_REDIS · line 20

Quoted 8 lines
package/redis/Config.in +2 -2
 	  http://www.redis.io
 
-comment "redis needs a toolchain w/ dynamic library, threads"
+comment "redis needs a toolchain w/ gcc>=4.9, dynamic library, nptl"
 	depends on BR2_USE_MMU
 	depends on BR2_TOOLCHAIN_HAS_ATOMIC
-	depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS_NPTL || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9

Ditto, this line was too long (but check-package did not report it, weird...). Fixed.

Applied to master, thanks!

Regards,
Yann E. MORIN.

Quoted 32 lines
package/redis/redis.hash +2 -2
index ee15b75e08..cf13bb9c0a 100644
@@ -1,5 +1,5 @@
 # From https://github.com/antirez/redis-hashes/blob/master/README
-sha256 f3c7eac42f433326a8d981b50dba0169fdfaf46abb23fcda2f933a7552ee4ed7  redis-5.0.8.tar.gz
+sha256  3337005a1e0c3aa293c87c313467ea8ac11984921fab08807998ba765c9943de  redis-6.0.4.tar.gz
 
 # Locally calculated
-sha256 cbf420a3672475a6e2765e3c0984c1f81efe0212afb94a3c998ee63bfd661063  COPYING
+sha256  cbf420a3672475a6e2765e3c0984c1f81efe0212afb94a3c998ee63bfd661063  COPYING
package/redis/redis.mk +1 -1
index d3954d87ca..1578f97e0d 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-REDIS_VERSION = 5.0.8
+REDIS_VERSION = 6.0.4
 REDIS_SITE = http://download.redis.io/releases
 REDIS_LICENSE = BSD-3-Clause (core); MIT and BSD family licenses (Bundled components)
 REDIS_LICENSE_FILES = COPYING
Signature · 6 lines
2.25.3

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#3 lore raw

PATCH v2 2/4 support/testing: add runtime test for Redis

In reply to Titouan Christophe
---
 .gitlab-ci.yml                              |  1 +
 DEVELOPERS                                  |  1 +
 support/testing/tests/package/test_redis.py | 24 +++++++++++++++++++++
 3 files changed, 26 insertions(+)
 create mode 100644 support/testing/tests/package/test_redis.py
.gitlab-ci.yml +1 -0
index fa8e077a07..a3800d4ba1 100644
@@ -513,6 +513,7 @@ tests.package.test_python_txtorcon.TestPythonPy2Txtorcon: { extends: .runtime_te
 tests.package.test_python_txtorcon.TestPythonPy3Txtorcon: { extends: .runtime_test }
 tests.package.test_python_ubjson.TestPythonPy2Ubjson: { extends: .runtime_test }
 tests.package.test_python_ubjson.TestPythonPy3Ubjson: { extends: .runtime_test }
+tests.package.test_redis.TestRedis: { extends: .runtime_test }
 tests.package.test_rings.TestLuaRings: { extends: .runtime_test }
 tests.package.test_rings.TestLuajitRings: { extends: .runtime_test }
 tests.package.test_rust.TestRust: { extends: .runtime_test }
DEVELOPERS +1 -0
index efb97c739c..ae46331c63 100644
@@ -2521,6 +2521,7 @@ F:	package/python-avro/
 F:	package/redis/
 F:	package/waf/
 F:	support/testing/tests/package/test_crudini.py
+F:	support/testing/tests/package/test_redis.py
 
 N:	Trent Piepho <[email protected]>
 F:	package/libp11/
support/testing/tests/package/test_redis.py new file +24 -0
new file mode 100644
index 0000000000..d79998514e
@@ -0,0 +1,24 @@
+import os
+
+import infra.basetest
+
+
+class TestRedis(infra.basetest.BRTest):
+    config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + """
+    BR2_TARGET_ROOTFS_CPIO=y
+    BR2_PACKAGE_REDIS=y
+    """
+
+    def test_run(self):
+        cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio")
+        self.emulator.boot(arch="armv5",
+                           kernel="builtin",
+                           options=["-initrd", cpio_file])
+        self.emulator.login()
+
+        _, exit_code = self.emulator.run("redis-cli SET hello world")
+        self.assertEqual(exit_code, 0)
+
+        output, exit_code = self.emulator.run("redis-cli GET hello")
+        self.assertEqual(exit_code, 0)
+        self.assertEqual(output[0].strip(), '"world"')
Signature · 1 line
2.25.3
#4 lore raw

PATCH v2 3/4 package/redis: add optional support for TLS connections

In reply to Titouan Christophe
---
 package/redis/redis.mk | 5 +++++
 1 file changed, 5 insertions(+)
package/redis/redis.mk +5 -0
index 1578f97e0d..c88e107c2b 100644
@@ -30,6 +30,11 @@ endif
 REDIS_BUILDOPTS = $(TARGET_CONFIGURE_OPTS) \
 	PREFIX=$(TARGET_DIR)/usr MALLOC=libc
 
+ifeq ($(BR2_PACKAGE_LIBOPENSSL),y)
+REDIS_DEPENDENCIES += libopenssl
+REDIS_BUILDOPTS += BUILD_TLS=yes
+endif
+
 define REDIS_BUILD_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) $(REDIS_BUILDOPTS) -C $(@D)
 endef
Signature · 1 line
2.25.3
#5 lore raw

PATCH v2 3/4 package/redis: add optional support for TLS connections

Titouan, All,

On 2020-06-02 12:40 +0200, Titouan Christophe spake thusly:

Quoted 10 lines
---
 package/redis/redis.mk | 5 +++++
 1 file changed, 5 insertions(+)
package/redis/redis.mk +0 -0
index 1578f97e0d..c88e107c2b 100644

package/redis/redis.mk endif · line 35

Quoted 6 lines
package/redis/redis.mk +3 -0
@@ -30,6 +30,11 @@ endif
 REDIS_BUILDOPTS = $(TARGET_CONFIGURE_OPTS) \
 	PREFIX=$(TARGET_DIR)/usr MALLOC=libc
 
+ifeq ($(BR2_PACKAGE_LIBOPENSSL),y)
+REDIS_DEPENDENCIES += libopenssl
+REDIS_BUILDOPTS += BUILD_TLS=yes

I've added the =no case otherwise, for consistency with other parts of the code (--enabel/--disable for autotools packages), and to avoid an environemnt variable from leaking.

Applied to master with that fixed, thanks.

Regards,
Yann E. MORIN.

Quoted 12 lines
package/redis/redis.mk +2 -0
+endif
+
 define REDIS_BUILD_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) $(REDIS_BUILDOPTS) -C $(@D)
 endef
Signature · 6 lines
2.25.3

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#6 lore raw

PATCH v2 4/4 package/redis: add optional support for systemd

In reply to Titouan Christophe

- Use the unit type=notify (Redis contacts systemd when ready)
- Start redis with the supervised option, so it knows it should talk to systemd

---
 package/redis/redis.mk      |  4 ++++
 package/redis/redis.service | 10 ++++++----
 2 files changed, 10 insertions(+), 4 deletions(-)
package/redis/redis.mk +4 -0
index c88e107c2b..1883f2fbaa 100644
@@ -30,6 +30,10 @@ endif
 REDIS_BUILDOPTS = $(TARGET_CONFIGURE_OPTS) \
 	PREFIX=$(TARGET_DIR)/usr MALLOC=libc
 
+ifeq ($(BR2_PACKAGE_SYSTEMD),y)
+REDIS_DEPENDENCIES += systemd
+endif
+
 ifeq ($(BR2_PACKAGE_LIBOPENSSL),y)
 REDIS_DEPENDENCIES += libopenssl
 REDIS_BUILDOPTS += BUILD_TLS=yes
package/redis/redis.service +6 -4
index 0a8162b8ab..2cc82a1980 100644
@@ -1,13 +1,15 @@
 [Unit]
-Description=Advanced key-value store
+Description=Redis data structure server
+Documentation=https://redis.io/documentation
 After=network.target
 
 [Service]
-Type=simple
+Type=notify
 User=redis
 Group=redis
-ExecStart=/usr/bin/redis-server /etc/redis.conf
-ExecStop=/usr/bin/redis-cli shutdown
+ExecStart=/usr/bin/redis-server --supervised systemd --daemonize no
+TimeoutStartSec=5
+TimeoutStopSec=5
 CapabilityBoundingSet=
 PrivateTmp=true
 PrivateDevices=true
Signature · 1 line
2.25.3
#7 lore raw

PATCH v2 4/4 package/redis: add optional support for systemd

Titouan, All,

On 2020-06-02 12:40 +0200, Titouan Christophe spake thusly:

Quoted 14 lines

- Use the unit type=notify (Redis contacts systemd when ready)
- Start redis with the supervised option, so it knows it should talk to systemd

---
 package/redis/redis.mk      |  4 ++++
 package/redis/redis.service | 10 ++++++----
 2 files changed, 10 insertions(+), 4 deletions(-)
package/redis/redis.mk +0 -0
index c88e107c2b..1883f2fbaa 100644

package/redis/redis.mk endif · line 34

Quoted 5 lines
package/redis/redis.mk +2 -0
@@ -30,6 +30,10 @@ endif
 REDIS_BUILDOPTS = $(TARGET_CONFIGURE_OPTS) \
 	PREFIX=$(TARGET_DIR)/usr MALLOC=libc
 
+ifeq ($(BR2_PACKAGE_SYSTEMD),y)
+REDIS_DEPENDENCIES += systemd

Although this is not documented, there is a variable used to decide whether to use systemd or not, USE_SYSTEMD. I've added use of it to explicitly enable or disable systemd support.

Applied to master, thanks.

Regards,
Yann E. MORIN.

Quoted 36 lines
package/redis/redis.mk +2 -0
+endif
+
 ifeq ($(BR2_PACKAGE_LIBOPENSSL),y)
 REDIS_DEPENDENCIES += libopenssl
 REDIS_BUILDOPTS += BUILD_TLS=yes
package/redis/redis.service +6 -4
index 0a8162b8ab..2cc82a1980 100644
@@ -1,13 +1,15 @@
 [Unit]
-Description=Advanced key-value store
+Description=Redis data structure server
+Documentation=https://redis.io/documentation
 After=network.target
 
 [Service]
-Type=simple
+Type=notify
 User=redis
 Group=redis
-ExecStart=/usr/bin/redis-server /etc/redis.conf
-ExecStop=/usr/bin/redis-cli shutdown
+ExecStart=/usr/bin/redis-server --supervised systemd --daemonize no
+TimeoutStartSec=5
+TimeoutStopSec=5
 CapabilityBoundingSet=
 PrivateTmp=true
 PrivateDevices=true
Signature · 6 lines
2.25.3

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#8 lore raw

v2 cover package/redis: bump to Redis 6

In reply to Titouan Christophe

Titouan, All,

On 2020-06-02 12:40 +0200, Titouan Christophe spake thusly:

Quoted 11 lines

This series bumps Redis to the new major version 6.

Redis 6 introduces new data types and commands, support for clients ACL, TLS connections, client-side caching, threaded I/O, and many other improvements. See the full announcement on: http://antirez.com/news/132
See the changelog:
https://raw.githubusercontent.com/antirez/redis/6.0/00-RELEASENOTES

In addition to the version bump, this series also adds a runtime test for Redis, and enables support for TLS and Systemd integration.

Series applied to master, but I will reply to individual patches...

Thanks!

Regards,
Yann E. MORIN.

Quoted 28 lines

---
Changes v1 -> v2:
* Bump to Redis 6.0.4 instead of 6.0.1
* Drop patch which has been applied upstream
---
Titouan Christophe (4):
package/redis: bump to version 6.0.4 support/testing: add runtime test for Redis package/redis: add optional support for TLS connections package/redis: add optional support for systemd

 .gitlab-ci.yml                              |  1 +
 DEVELOPERS                                  |  1 +
 package/redis/Config.in                     | 15 +++++++------
 package/redis/redis.hash                    |  4 ++--
 package/redis/redis.mk                      | 11 +++++++++-
 package/redis/redis.service                 | 10 +++++----
 support/testing/tests/package/test_redis.py | 24 +++++++++++++++++++++
 7 files changed, 53 insertions(+), 13 deletions(-)
 create mode 100644 support/testing/tests/package/test_redis.py
Signature · 6 lines
2.25.3

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'