adding packaging

Former-commit-id: 108c58ba5333129eabf64f775e69f5cb7b6cbdf9
This commit is contained in:
Ben Schermel 2020-05-23 17:35:55 -04:00 committed by John Sully
parent e06d7d18e1
commit c825dd388f
33 changed files with 323 additions and 108 deletions

16
.gitignore vendored
View File

@ -10,18 +10,17 @@ core
!**/keydb-sentinel.service.d !**/keydb-sentinel.service.d
*.log *.log
dump.rdb dump.rdb
src/keydb-server src/keydb-pro-server
**/bin/keydb-server bin/keydb-pro-server
**/app/keydb-server app/keydb-pro-server
*.deb *.deb
*.rpm *.rpm
keydb-pro-server
src/keydb-cli src/keydb-cli
**/bin/keydb-cli bin/keydb-cli
**/app/keydb-cli app/keydb-cli
src/keydb-sentinel src/keydb-sentinel
**/bin/keydb-sentinel bin/keydb-sentinel
**/app/keydb-sentinel app/keydb-sentinel
redis-benchmark redis-benchmark
keydb-benchmark keydb-benchmark
redis-check-aof redis-check-aof
@ -33,7 +32,6 @@ keydb-check-dump
redis-cli redis-cli
redis-sentinel redis-sentinel
redis-server redis-server
keydb-pro-server
doc-tools doc-tools
release release
misc/* misc/*

View File

@ -1,18 +1,14 @@
### KeyDB DEB Package Source Builds ### KeyDB DEB Package Source Builds
This directory contains scripts and components needed to generate debian packages on different distributions/architectures from source This directory contains scripts and components needed to generate debian packages on different distributions/architectures using source
The 'debian' directory contains debian source code for bionic, buster and later distributions as it uses functions only available with debhelper11+. 'debian_dh9' is used for xenial, stretch and earlier distributions using debhelper9. You will need to install pbuilder `sudo apt install pbuilder`
You will need to install pbuilder `sudo apt install pbuilder` along with other distribution specific dependancies
Generate deb packages with the following script command run from this directory: Generate deb packages with the following script command run from this directory:
``` ```
$ ./deb-buildsource.sh $ ./deb-buildsource.sh
``` ```
This generates a directory structure, .dsc file, original.tar.gz, .changes files and new changelog for the distribution and architecture installed.
This generates a directory structure, .dsc file, original.tar.gz, and new changelog for the distribution and architecture installed.
When complete the produced debian packages will be located in deb_files_generated directory. When complete the produced debian packages will be located in deb_files_generated directory.

View File

@ -19,22 +19,18 @@ elif [ "$distributor" == "Ubuntu" ]; then
fi fi
codename=$(lsb_release --codename --short) codename=$(lsb_release --codename --short)
date=$(date +%a," "%d" "%b" "%Y" "%T) date=$(date +%a," "%d" "%b" "%Y" "%T)
pkg_name=keydb-$majorv:$version$distname pkg_name=keydb-pro-$version$distname
# create build tree # create build tree
cd ../../../ cd ../../../
tar -czvf keydb_$version.orig.tar.gz --force-local KeyDB tar -czvf keydb-pro_$version.orig.tar.gz --force-local KeyDB-Pro
cd KeyDB/pkg/deb/ cd KeyDB-Pro/pkg/deb/
mkdir -p $pkg_name/tmp mkdir -p $pkg_name/tmp
if [[ "$codename" == "xenial" ]] || [[ "$codename" == "stretch" ]]; then cp -r debian $pkg_name/tmp
cp -r debian_dh9 $pkg_name/tmp/debian
else
cp -r debian $pkg_name/tmp
fi
cp master_changelog $pkg_name/tmp/debian/changelog cp master_changelog $pkg_name/tmp/debian/changelog
mv ../../../keydb_$version.orig.tar.gz ./$pkg_name mv ../../../keydb-pro_$version.orig.tar.gz ./$pkg_name
cd $pkg_name/tmp cd $pkg_name/tmp
changelog_str="keydb ($majorv:$version-$build$distname) $codename; urgency=medium\n\n * $version $changelog_comments \n\n -- Ben Schermel <ben@eqalpha.com> $date +0000\n\n" changelog_str="keydb-pro ($version-$build$distname) $codename; urgency=medium\n\n * $version $changelog_comments \n\n -- Ben Schermel <ben@eqalpha.com> $date +0000\n\n"
if [ $# -eq 0 ]; then if [ $# -eq 0 ]; then
sed -i "1s/^/$changelog_str\n/" debian/changelog sed -i "1s/^/$changelog_str\n/" debian/changelog
elif [ $# -eq 1 ] && [ "$1" != "None" ]; then elif [ $# -eq 1 ] && [ "$1" != "None" ]; then
@ -48,16 +44,12 @@ debuild -S -sa
cd ../ cd ../
# create pbuilder chrooted environment and build the deb package # create pbuilder chrooted environment and build the deb package
if [ "$codename" == "xenial" ]; then sudo pbuilder create --distribution $codename
sudo pbuilder create --distribution $codename --othermirror "deb http://archive.ubuntu.com/ubuntu $codename universe multiverse"
else
sudo pbuilder create --distribution $codename
fi
sudo pbuilder --update sudo pbuilder --update
sudo pbuilder --build *.dsc sudo pbuilder --build *.dsc --logfile /mnt/pbuilderlog.log
# move new packages to deb_files_generated and clean up # move new packages to deb_files_generated and clean up
cp /var/cache/pbuilder/result/*$version*.deb ../deb_files_generated cp /var/cache/pbuilder/result/*$version*.deb ../deb_files_generated
sudo pbuilder clean sudo pbuilder --autocleanaptcache
cd ../ cd ../
rm -rf $pkg_name rm -rf $pkg_name

View File

@ -9,7 +9,6 @@ else
SYSTEMD_EXTRA=$(cat <<EOF SYSTEMD_EXTRA=$(cat <<EOF
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
#MemoryDenyWriteExecute=true
ProtectKernelModules=true ProtectKernelModules=true
ProtectKernelTunables=true ProtectKernelTunables=true
ProtectControlGroups=true ProtectControlGroups=true
@ -26,9 +25,13 @@ do
case "${BINARY}" in case "${BINARY}" in
keydb-server) keydb-server)
NAME="keydb" NAME="keydb"
BINARY_EXEC="keydb-server"
BINARY_NAME="keydb-pro-server"
;; ;;
keydb-sentinel) keydb-sentinel)
NAME="sentinel" NAME="sentinel"
BINARY_EXEC="keydb-sentinel"
BINARY_NAME="keydb-sentinel"
;; ;;
esac esac
@ -78,6 +81,8 @@ do
# #
# $ systemctl start ${BINARY}@myname.service # $ systemctl start ${BINARY}@myname.service
# $ keydb-cli -s /var/run/${NAME}-myname/${BINARY}.sock info | grep config_file # $ keydb-cli -s /var/run/${NAME}-myname/${BINARY}.sock info | grep config_file
#
# -- Chris Lamb <lamby@debian.org> Mon, 09 Oct 2017 22:17:24 +0100
EOF EOF
fi fi
@ -89,7 +94,7 @@ Documentation=https://docs.keydb.dev, man:${BINARY}(1)
[Service] [Service]
Type=forking Type=forking
ExecStart=/usr/bin/${BINARY} /etc/keydb/${NAMESPACED}.conf ExecStart=/usr/bin/${BINARY_NAME} /etc/keydb/${NAMESPACED}.conf
ExecStop=/bin/kill -s TERM \$MAINPID ExecStop=/bin/kill -s TERM \$MAINPID
PIDFile=/var/run/${NAMESPACED}/${BINARY}.pid PIDFile=/var/run/${NAMESPACED}/${BINARY}.pid
TimeoutStopSec=0 TimeoutStopSec=0

View File

@ -1,4 +1,4 @@
Source: keydb Source: keydb-pro
Section: database Section: database
Priority: optional Priority: optional
Maintainer: Ben Schermel <ben@eqalpha.com> Maintainer: Ben Schermel <ben@eqalpha.com>
@ -6,6 +6,11 @@ Build-Depends:
debhelper (>= 9~), debhelper (>= 9~),
dpkg-dev (>= 1.17.5), dpkg-dev (>= 1.17.5),
systemd, systemd,
# libhiredis-dev (>= 0.14.0),
# libjemalloc-dev [linux-any],
# liblua5.1-dev,
# lua-bitop-dev,
# lua-cjson-dev,
procps <!nocheck>, procps <!nocheck>,
build-essential <!nocheck>, build-essential <!nocheck>,
tcl <!nocheck>, tcl <!nocheck>,
@ -19,14 +24,14 @@ Build-Depends:
libssl-dev <!nocheck> libssl-dev <!nocheck>
Standards-Version: 4.2.1 Standards-Version: 4.2.1
Homepage: https://docs.keydb.dev/ Homepage: https://docs.keydb.dev/
Vcs-Git: https://github.com/JohnSully/KeyDB.git Vcs-Git: https://github.com/JohnSully/KeyDB-Pro.git
Vcs-Browser: https://github.com/JohnSully/KeyDB Vcs-Browser: https://github.com/JohnSully/KeyDB-Pro
Package: keydb Package: keydb-pro
Architecture: all Architecture: all
Depends: Depends:
keydb-server (<< ${binary:Version}.1~), keydb-pro-server (<< ${binary:Version}.1~),
keydb-server (>= ${binary:Version}), keydb-pro-server (>= ${binary:Version}),
${misc:Depends}, ${misc:Depends},
Description: Persistent key-value database with network interface (metapackage) Description: Persistent key-value database with network interface (metapackage)
keydb is a key-value database in a similar vein to memcache but the dataset keydb is a key-value database in a similar vein to memcache but the dataset
@ -37,11 +42,11 @@ Description: Persistent key-value database with network interface (metapackage)
. .
This package depends on the keydb-server package. This package depends on the keydb-server package.
Package: keydb-sentinel Package: keydb-pro-sentinel
Architecture: any Architecture: any
Depends: Depends:
lsb-base (>= 3.2-14), lsb-base (>= 3.2-14),
keydb-tools (= ${binary:Version}), keydb-pro-tools (= ${binary:Version}),
${misc:Depends}, ${misc:Depends},
Description: Persistent key-value database with network interface (monitoring) Description: Persistent key-value database with network interface (monitoring)
keydb is a key-value database in a similar vein to memcache but the dataset keydb is a key-value database in a similar vein to memcache but the dataset
@ -50,11 +55,11 @@ Description: Persistent key-value database with network interface (monitoring)
. .
This package contains the keydb Sentinel monitoring software. This package contains the keydb Sentinel monitoring software.
Package: keydb-server Package: keydb-pro-server
Architecture: any Architecture: any
Depends: Depends:
lsb-base (>= 3.2-14), lsb-base (>= 3.2-14),
keydb-tools (= ${binary:Version}), keydb-pro-tools (= ${binary:Version}),
${misc:Depends}, ${misc:Depends},
Description: Persistent key-value database with network interface Description: Persistent key-value database with network interface
keydb is a key-value database in a similar vein to memcache but the dataset keydb is a key-value database in a similar vein to memcache but the dataset
@ -63,7 +68,7 @@ Description: Persistent key-value database with network interface
. .
The dataset is stored entirely in memory and periodically flushed to disk. The dataset is stored entirely in memory and periodically flushed to disk.
Package: keydb-tools Package: keydb-pro-tools
Architecture: any Architecture: any
Depends: Depends:
adduser, adduser,

View File

@ -0,0 +1,23 @@
.TH KEYDB-SENTINEL 1 "August 17, 2019"
.SH NAME
keydb-sentinel \- Persistent key-value database (cluster mode)
.SH SYNOPSIS
.B keydb-sentinel
.RI configfile
.SH DESCRIPTION
KeyDB is a key-value database. It is similar to memcached but the dataset is
not volatile and other datatypes (such as lists and sets) are natively
supported.
.PP
.SH OPTIONS
.IP "configfile"
Read options from specified configuration file.
.SH NOTES
On Debian GNU/Linux systems, \fBkeydb-sentinel\fP is typically started via the
\fB/etc/init.d/keydb-sentinel\fP initscript, not manually. This defaults to using
\fB/etc/keydb/sentinel.conf\fP as a configuration file.
.SH AUTHOR
\fBkeydb-sentinel\fP was written by John Sully, originating as a fork of Redis. Redis was written by Salvatore Sanfilippo.
.PP
This manual page was written by Chris Lamb <lamby@debian.org> for the Debian
project (but may be used by others). Modified by Ben Schermel <ben@eqalpha.com>

View File

@ -0,0 +1,2 @@
debian/keydb-sentinel.service /lib/systemd/system/
pkg/deb/conf/sentinel.conf /etc/keydb

View File

@ -0,0 +1,7 @@
/var/log/keydb/keydb-sentinel*.log {
weekly
missingok
rotate 12
compress
notifempty
}

View File

@ -0,0 +1 @@
debian/keydb-pro-sentinel.1

View File

@ -0,0 +1,26 @@
#!/bin/sh
set -eu
USER="keydb"
GROUP="$USER"
CONFFILE="/etc/keydb/sentinel.conf"
if [ "$1" = "configure" ]
then
if ! dpkg-statoverride --list ${CONFFILE} >/dev/null 2>&1
then
dpkg-statoverride --update --add ${USER} ${GROUP} 640 ${CONFFILE}
fi
fi
#DEBHELPER#
if [ "$1" = "configure" ]
then
find /etc/keydb -maxdepth 1 -type d -name 'keydb-sentinel.*.d' -empty -delete
fi
systemctl daemon-reload
exit 0

View File

@ -0,0 +1,16 @@
#!/bin/sh
set -eu
CONFFILE="/etc/keydb/sentinel.conf"
if [ "$1" = "purge" ]
then
dpkg-statoverride --remove ${CONFFILE} || test $? -eq 2
fi
#DEBHELPER#
systemctl daemon-reload
exit 0

View File

@ -0,0 +1,23 @@
.TH KEYDB-SERVER 1 "August 17, 2019"
.SH NAME
keydb-server \- Persistent key-value database
.SH SYNOPSIS
.B keydb-server
.RI configfile
.SH DESCRIPTION
KeyDB is a key-value database. It is similar to memcached but the dataset is
not volatile and other datatypes (such as lists and sets) are natively
supported.
.PP
.SH OPTIONS
.IP "configfile"
Read options from specified configuration file.
.SH NOTES
On Debian GNU/Linux systems, \fBkeydb-server\fP is typically started via the
\fB/etc/init.d/keydb-server\fP initscript, not manually. This defaults to using
\fB/etc/keydb/keydb.conf\fP as a configuration file.
.SH AUTHOR
\fBkeydb-server\fP was written by John Sully, originating as a fork of Redis. Redis was written by Salvatore Sanfilippo.
.PP
This manual page was written by Chris Lamb <lamby@debian.org> for the Debian
project (but may be used by others). Modified by Ben Schermel <ben@eqalpha.com>

View File

@ -0,0 +1 @@
README.md

View File

@ -0,0 +1,2 @@
debian/keydb-server.service /lib/systemd/system/
pkg/deb/conf/keydb.conf /etc/keydb

View File

@ -0,0 +1,7 @@
/var/log/keydb/keydb-server*.log {
weekly
missingok
rotate 12
compress
notifempty
}

View File

@ -0,0 +1 @@
debian/keydb-pro-server.1

View File

@ -0,0 +1,26 @@
#!/bin/sh
set -eu
USER="keydb"
GROUP="$USER"
CONFFILE="/etc/keydb/keydb.conf"
if [ "$1" = "configure" ]
then
if ! dpkg-statoverride --list ${CONFFILE} >/dev/null 2>&1
then
dpkg-statoverride --update --add ${USER} ${GROUP} 640 ${CONFFILE}
fi
fi
#DEBHELPER#
if [ "$1" = "configure" ]
then
find /etc/keydb -maxdepth 1 -type d -name 'keydb-server.*.d' -empty -delete
fi
systemctl daemon-reload
exit 0

View File

@ -0,0 +1,16 @@
#!/bin/sh
set -eu
CONFFILE="/etc/keydb/keydb.conf"
if [ "${1}" = "purge" ]
then
dpkg-statoverride --remove ${CONFFILE} || test $? -eq 2
fi
#DEBHELPER#
systemctl daemon-reload
exit 0

View File

@ -0,0 +1,2 @@
src/redis-trib.rb
utils/lru

View File

@ -0,0 +1,6 @@
debian/bash_completion.d/* /usr/share/bash-completion/completions
src/keydb-benchmark /usr/bin
src/keydb-check-aof /usr/bin
src/keydb-check-rdb /usr/bin
src/keydb-cli /usr/bin
src/keydb-pro-server /usr/bin

View File

@ -0,0 +1,4 @@
debian/keydb-benchmark.1
debian/keydb-check-aof.1
debian/keydb-check-rdb.1
debian/keydb-cli.1

View File

@ -0,0 +1,47 @@
#!/bin/sh
set -eu
USER="keydb"
Setup_dir () {
DIR="${1}"
MODE="${2}"
GROUP="${3}"
mkdir -p ${DIR}
case "${DIR}" in
/var/log/keydb)
MODE="02750"
GROUP="adm"
;;
*)
MODE="750"
GROUP="${USER}"
;;
esac
if ! dpkg-statoverride --list ${DIR} >/dev/null 2>&1
then
chown ${USER}:${GROUP} ${DIR}
chmod ${MODE} ${DIR}
fi
}
if [ "$1" = "configure" ]
then
adduser \
--system \
--home /var/lib/keydb \
--quiet \
--group \
${USER} || true
Setup_dir /var/log/keydb ${USER}:adm 2750
Setup_dir /var/lib/keydb ${USER}:${USER} 750
fi
#DEBHELPER#
exit 0

View File

@ -0,0 +1,13 @@
#!/bin/sh
set -eu
if [ "${1}" = "purge" ]
then
userdel keydb || true
rm -rf /var/lib/keydb /var/log/keydb
fi
#DEBHELPER#
exit 0

View File

@ -18,14 +18,13 @@ endif
override_dh_auto_install: override_dh_auto_install:
debian/bin/generate-systemd-service-files debian/bin/generate-systemd-service-files
dh_installsystemd --restart-after-upgrade
override_dh_auto_test: override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
# Avoid race conditions in upstream testsuite. # Avoid race conditions in upstream testsuite.
./runtest || true # ./runtest --clients 1 || true
./runtest-cluster || true # ./runtest-cluster || true
./runtest-sentinel || true # ./runtest-sentinel || true
endif endif
override_dh_auto_clean: override_dh_auto_clean:

View File

@ -1,24 +1,12 @@
keydb (6:6.0.9-1distribution_placeholder) codename_placeholder; urgency=medium keydb (6.0.7-1distribution_placeholder) codename_placeholder; urgency=medium
* 6.0.9 Addressing issues 187 - cpu lockup with subkey expire, 190 - missing sentinel binary in keydb-tools. * 6.0.7 Updating builds from deb source package
* Naming conventions are now updated
-- Ben Schermel <ben@eqalpha.com> Sun, 07 Jun 2020 18:00:37 +0000 * Builds now genrated accross different distributions/architectures automatically.
* Same changelog used for all distribitions/architectures and will be updated on each release
keydb (6:6.0.8-1distribution_placeholder) codename_placeholder; urgency=medium * init.d has been phased out and scripts updated to use systemd only
* keydb-pro=server binary is no longer inluded in the open source package
* This is our first release to fully support all Redis 6.0.4 features, including but not limited to: TLS Support (fully supports multithreading!), Client side caching, RESP 3 Support * see github pkg directory for debian code and build scripts used in distributions
* KeyDB Has also added the following new features: Improved memory efficiency for short strings, Fastlock autotuning, KeyDB.HRENAME (rename a member of a hash)In addition we've spent a lot of time focussing on stability.
* The following bug fixes are resolved: 150 - Deadlock in ReplicationFeedMonitors, 170 - KeyDB dying via SIGABORT, 180 - crash after setting maxclients via cmd line, 169 - Write performance of a master dropped sharply when a slave is added
* In addition untracked issues were resolved: Potential deadlock when entering futex sleep, Pub/Sub Async messages may not be sent in a timely manner when load is low, Excessive logging during failed RREPLAY, KeyDB unresponsive handling clients on different threads during RDB load
* Updated deb package builds to build from source and phasing out init.d. dh_installsystemd from deb helper 11 used where applicable
* Naming conventions are now updated [ keydbpackage_version-build~distribution_architecture] and master changelog included and maintained
* keydb-pro-server binary is no longer inluded in the open source package
-- Ben Schermel <ben@eqalpha.com> Mon, 1 Jun 2020 8:00:37 +0000
keydb (5:5.3.3-1distribution_placeholder) codename_placeholder; urgency=medium
* 5.3.3 Updating deb source package, naming conventions, and build scripts.
-- Ben Schermel <ben@eqalpha.com> Wed, 06 May 2020 8:00:37 +0000 -- Ben Schermel <ben@eqalpha.com> Wed, 06 May 2020 8:00:37 +0000

View File

@ -15,6 +15,7 @@ RUN set -eux; \
gnupg \ gnupg \
wget \ wget \
; \ ; \
# rm -rf /var/lib/apt/lists/*; \
\ \
dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \ dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \
wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \ wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \
@ -38,14 +39,13 @@ RUN set -eux; \
gosu nobody true gosu nobody true
# Load pre-generated equivalent binaries to image (reduces deployment build times) # Load pre-generated equivalent binaries to image (reduces deployment build times)
RUN \ ADD ./app/* /usr/local/bin/
mkdir -p /etc/keydb
ADD ./app/keydb-* /usr/local/bin/
ADD ./app/docker-entrypoint.sh /usr/local/bin/
ADD ./app/*.conf /etc/keydb/
# Set up config and binaries # Set up config and binaries
RUN \ RUN \
cd /usr/local/bin && \ cd /usr/local/bin && \
mkdir -p /etc/keydb && \
mv -f *.conf /etc/keydb && \
sed -i 's/^\(bind .*\)$/# \1/' /etc/keydb/keydb.conf && \ sed -i 's/^\(bind .*\)$/# \1/' /etc/keydb/keydb.conf && \
sed -i 's/^\(daemonize .*\)$/# \1/' /etc/keydb/keydb.conf && \ sed -i 's/^\(daemonize .*\)$/# \1/' /etc/keydb/keydb.conf && \
sed -i 's/^\(dir .*\)$/# \1\ndir \/data/' /etc/keydb/keydb.conf && \ sed -i 's/^\(dir .*\)$/# \1\ndir \/data/' /etc/keydb/keydb.conf && \
@ -55,7 +55,8 @@ RUN \
cd /etc/keydb && \ cd /etc/keydb && \
ln -s keydb.conf redis.conf ln -s keydb.conf redis.conf
# Ensure deps installed for binaries # Ensure deps installed for binaries (including Pro)
# libc6 (>= 2.17), libcurl4 (>= 7.16.2), libgcc1 (>= 1:3.0), libstdc++6 (>= 4.8.1), libuuid1 (>= 2.16), libssl1.1 (>= 1.1.1)
RUN set -eux; \ RUN set -eux; \
\ \
savedAptMark="$(apt-mark showmanual)"; \ savedAptMark="$(apt-mark showmanual)"; \
@ -67,12 +68,20 @@ RUN set -eux; \
libstdc++6 \ libstdc++6 \
libgcc1 \ libgcc1 \
zlib1g \ zlib1g \
libbz2-1.0 \
liblz4-1 \
libsnappy1v5 \
libzstd1 \
; \ ; \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*; \
\
apt-mark auto '.*' > /dev/null; \
[ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; \
find /usr/local -type f -executable -exec ldd '{}' ';' \
| awk '/=>/ { print $(NF-1) }' \
| sort -u \
| xargs -r dpkg-query --search \
| cut -d: -f1 \
| sort -u \
| xargs -r apt-mark manual \
; \
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false
# create working directories # create working directories
RUN \ RUN \
@ -88,4 +97,4 @@ ENTRYPOINT ["docker-entrypoint.sh"]
# Expose container port and start KeyDB by default on running container # Expose container port and start KeyDB by default on running container
EXPOSE 6379 EXPOSE 6379
CMD ["keydb-server", "/etc/keydb/keydb.conf"] CMD ["keydb-pro-server", "/etc/keydb/keydb.conf"]

View File

@ -1,6 +1,6 @@
### Generate RPM files for the generated binaries ### Generate RPM files for the generated binaries
After running make to produce keydb binaries you can run the following script to create rpm package After making the binaries you can run the following script
Usage: Usage:
``` ```

View File

@ -1,38 +1,39 @@
#! /bin/bash #! /bin/bash
### usage sudo ./generate_rpms ### usage sudo ./generate_rpms
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
version=$(grep KEYDB_REAL_VERSION $DIR/../../src/version.h | awk '{ printf $3 }' | tr -d \") version=$(grep KEYDB_REAL_VERSION ../../src/version.h | awk '{ printf $3 }' | tr -d \")
release=1 # by default this will always be 1 for keydb version structure. If build release version needs to be update you can modify here release=1 # by default this will always be 1 for keydb version structure. If build release version needs to be update you can modify here
arch=$(uname -m) arch=$(uname -m)
dist=el$(rpm -q --queryformat '%{VERSION}' centos-release | cut -d. -f1) dist=el$(rpm -q --queryformat '%{VERSION}' centos-release)
if [[ "$arch" != "aarch64" ]] && [[ "$arch" != "x86_64" ]]; then if [ "$arch" != "aarch64" ] || [ "$arch" != "x86_64" ]; then
echo "This script is only valid and tested for aarch64 and x86_64 architectures. You are trying to use: $arch" echo "This script is only valid and tested for aarch64 and x86_64 architectures. You are trying to use: $arch"
fi fi
# remove any old rpm packages # remove any old rpm packages
rm $DIR/rpm_files_generated/keydb* rm $PWD/rpm_files_generated/keydb*
# generate empty directories that github would otherwise delete (avoids .gitkeep in directory) # generate empty directories that github would otherwise delete (avoids .gitkeep in directory)
mkdir -p $DIR/keydb_build/keydb_rpm/usr/bin mkdir $PWD/keydb_build/keydb_rpm/usr/bin
mkdir -p $DIR/keydb_build/keydb_rpm/usr/lib64/redis/modules mkdir $PWD/keydb_build/keydb_rpm/usr/lib64/redis/modules
mkdir -p $DIR/keydb_build/keydb_rpm/var/lib/keydb mkdir $PWD/keydb_build/keydb_rpm/var/lib/keydb
mkdir -p $DIR/keydb_build/keydb_rpm/var/log/keydb mkdir $PWD/keydb_build/keydb_rpm/var/log/keydb
# move binaries to bin # move binaries to bin
rm $DIR/keydb_build/keydb_rpm/usr/bin/* rm $PWD/keydb_build/keydb_rpm/usr/bin/*
cp $DIR/../../src/keydb-* $DIR/keydb_build/keydb_rpm/usr/bin/ cp $PWD/../../src/keydb-* $PWD/keydb_build/keydb_rpm/usr/bin/
# update spec file with build info # update spec file with build info
sed -i '2d' $DIR/keydb_build/keydb.spec sed -i '2d' $PWD/keydb_build/keydb.spec
sed -i -E "1a\Version : $version" $DIR/keydb_build/keydb.spec sed -i -E "1a\Version : $version" $PWD/keydb_build/keydb.spec
sed -i '3d' $DIR/keydb_build/keydb.spec sed -i '3d' $PWD/keydb_build/keydb.spec
sed -i -E "2a\Release : $release%{?dist}" $DIR/keydb_build/keydb.spec sed -i -E "2a\Release : $release%{?dist}" $PWD/keydb_build/keydb.spec
mkdir -p /root/rpmbuild/BUILDROOT/keydb-$version-$release.$dist.$arch # yum install -y scl-utils centos-release-scl rpm-build
cp -r $DIR/keydb_build/keydb_rpm/* /root/rpmbuild/BUILDROOT/keydb-$version-$release.$dist.$arch/ mkdir -p /root/rpmbuild/BUILDROOT/keydb-pro-$version-$release.$dist.$arch
rpmbuild -bb $DIR/keydb_build/keydb.spec cp -r ./keydb_build/keydb_rpm/* /root/rpmbuild/BUILDROOT/keydb-pro-$version-$release.$dist.$arch/
mv /root/rpmbuild/RPMS/$arch/* $DIR/rpm_files_generated rpmbuild -bb /rpm_build/keydb.spec
mv /root/rpmbuild/RPMS/$arch/* .$PWD/rpm_files_generated
exit exit

View File

@ -1,5 +1,5 @@
Name : keydb Name : keydb-pro
Version : 5.3.3 Version : 6.0.5
Release : 1%{?dist} Release : 1%{?dist}
Group : Unspecified Group : Unspecified
License : BSD License : BSD
@ -8,7 +8,6 @@ Packager : EQ Alpha Technology
URL : https://keydb.dev URL : https://keydb.dev
Summary : A persistent key-value database Summary : A persistent key-value database
Requires: /bin/awk Requires: /bin/awk
Requires: logrotate Requires: logrotate
Requires(pre): shadow-utils Requires(pre): shadow-utils
@ -28,7 +27,7 @@ getent group keydb &> /dev/null || \
groupadd -r keydb &> /dev/null groupadd -r keydb &> /dev/null
getent passwd keydb &> /dev/null || \ getent passwd keydb &> /dev/null || \
useradd -r -g keydb -d /var/lib/keydb -s /sbin/nologin \ useradd -r -g keydb -d /var/lib/keydb -s /sbin/nologin \
-c 'KeyDB Database Server' keydb &> /dev/null -c 'KeyDB Professional Database Server' keydb &> /dev/null
exit 0 exit 0
#postinstall scriptlet (using /bin/sh): #postinstall scriptlet (using /bin/sh):

Binary file not shown.

Binary file not shown.

View File

@ -1,7 +1,7 @@
[Unit] [Unit]
Description=Advanced key-value store Description=Advanced key-value store
After=network.target After=network.target
Documentation=https://docs.keydb.dev, man:keydb-sentinel(1) Documentation=http://keydb.io/documentation, man:keydb-sentinel(1)
[Service] [Service]
Type=forking Type=forking

View File

@ -5,7 +5,7 @@ Documentation=https://docs.keydb.dev, man:keydb-server(1)
[Service] [Service]
Type=forking Type=forking
ExecStart=/usr/bin/keydb-server /etc/keydb/keydb.conf ExecStart=/usr/bin/keydb-pro-server /etc/keydb/keydb.conf
ExecStop=/bin/kill -s TERM $MAINPID ExecStop=/bin/kill -s TERM $MAINPID
PIDFile=/var/run/keydb/keydb-server.pid PIDFile=/var/run/keydb/keydb-server.pid
TimeoutStopSec=0 TimeoutStopSec=0