Skip to content

Commit

Permalink
Add Valkey to 3.0 (#10579)
Browse files Browse the repository at this point in the history
  • Loading branch information
xordux authored Oct 1, 2024
1 parent 15168cc commit 1118da2
Show file tree
Hide file tree
Showing 6 changed files with 127 additions and 1 deletion.
2 changes: 1 addition & 1 deletion LICENSES-AND-NOTICES/SPECS/LICENSES-MAP.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions LICENSES-AND-NOTICES/SPECS/data/licenses.json
Original file line number Diff line number Diff line change
Expand Up @@ -2432,6 +2432,7 @@
"umoci",
"usrsctp",
"vala",
"valkey",
"verity-read-only-root",
"vnstat",
"zstd"
Expand Down
22 changes: 22 additions & 0 deletions SPECS/valkey/valkey-conf.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/valkey.conf b/valkey.conf
index 0f43f5c..f6738ad 100644
--- a/valkey.conf
+++ b/valkey.conf
@@ -351,7 +351,7 @@ loglevel notice
# Specify the log file name. Also the empty string can be used to force
# the server to log on the standard output. Note that if you use standard
# output for logging but daemonize, logs will be sent to /dev/null
-logfile ""
+logfile "/var/log/valkey/valkey.log"

# To enable logging to the system logger, just set 'syslog-enabled' to yes,
# and optionally update the other syslog parameters to suit your needs.
@@ -526,7 +526,7 @@ rdb-del-sync-files no
# 'cluster-config-file' configuration directive is a relative path.
#
# Note that you must specify a directory here, not a file name.
-dir ./
+dir /var/lib/valkey

################################# REPLICATION #################################

5 changes: 5 additions & 0 deletions SPECS/valkey/valkey.signatures.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"Signatures": {
"valkey-8.0.0.tar.gz": "f87fef2ba81ae4bce891b874fba58cfde2d19370a3bcac20f0e17498b33c33c0"
}
}
88 changes: 88 additions & 0 deletions SPECS/valkey/valkey.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
Summary: advanced key-value store
Name: valkey
Version: 8.0.0
Release: 1%{?dist}
License: BSD
Vendor: Microsoft Corporation
Distribution: Azure Linux
Group: Applications/Databases
URL: https://valkey.io/
Source0: https://github.com/valkey-io/valkey/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz
Patch0: valkey-conf.patch
BuildRequires: gcc
BuildRequires: make
BuildRequires: openssl-devel
BuildRequires: systemd
BuildRequires: tcl
BuildRequires: tcl-devel
BuildRequires: which
Requires: systemd
Requires(pre): %{_sbindir}/groupadd
Requires(pre): %{_sbindir}/useradd

%description
A flexible distributed key-value datastore that supports both caching and beyond caching workloads.

%prep
%autosetup -p1

%build
make BUILD_TLS=yes %{?_smp_mflags}

%install
install -vdm 755 %{buildroot}
make PREFIX=%{buildroot}%{_prefix} install
install -D -m 0640 %{name}.conf %{buildroot}%{_sysconfdir}/%{name}.conf
mkdir -p %{buildroot}%{_sharedstatedir}/valkey
mkdir -p %{buildroot}%{_var}/log
mkdir -p %{buildroot}%{_var}/opt/%{name}/log
ln -sfv %{_var}/opt/%{name}/log %{buildroot}%{_var}/log/%{name}
mkdir -p %{buildroot}/usr/lib/systemd/system
cat << EOF >> %{buildroot}/usr/lib/systemd/system/valkey.service
[Unit]
Description=Valkey in-memory key-value datastore
After=network.target
[Service]
ExecStart=%{_bindir}/valkey-server %{_sysconfdir}/valkey.conf --daemonize no
ExecStop=%{_bindir}/valkey-cli shutdown
User=valkey
Group=valkey
[Install]
WantedBy=multi-user.target
EOF

%check
make check

%pre
getent group %{name} &> /dev/null || \
groupadd -r %{name} &> /dev/null
getent passwd %{name} &> /dev/null || \
useradd -r -g %{name} -d %{_sharedstatedir}/valkey -s /sbin/nologin \
-c 'Valkey Datastore Server' %{name} &> /dev/null
exit 0

%post
/sbin/ldconfig
%systemd_post valkey.service

%postun
/sbin/ldconfig
%systemd_postun_with_restart valkey.service

%files
%defattr(-,root,root)
%license COPYING
%dir %attr(0750, valkey, valkey) %{_sharedstatedir}/valkey
%dir %attr(0750, valkey, valkey) %{_var}/opt/%{name}/log
%attr(0750, valkey, valkey) %{_var}/log/%{name}
%{_bindir}/*
%{_libdir}/systemd/*
%config(noreplace) %attr(0640, %{name}, %{name}) %{_sysconfdir}/valkey.conf

%changelog
* Mon Sep 30 2024 Rohit Rawat <[email protected]> - 8.0.0-1
- Original version for CBL-Mariner.
- License Verified.
10 changes: 10 additions & 0 deletions cgmanifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -29281,6 +29281,16 @@
}
}
},
{
"component": {
"type": "other",
"other": {
"name": "valkey",
"version": "8.0.0",
"downloadUrl": "https://github.com/valkey-io/valkey/archive/refs/tags/8.0.0.tar.gz"
}
}
},
{
"component": {
"type": "other",
Expand Down

0 comments on commit 1118da2

Please sign in to comment.