Skip to content

Commit aa032d3

Browse files
authored
Merge pull request Snapchat#438 from Snapchat/update_pkg
Packaging Updates
2 parents 7c9c448 + 6ad5cab commit aa032d3

6 files changed

Lines changed: 93 additions & 13 deletions

File tree

pkg/deb/deb-buildsource.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ pkg_name=keydb-$majorv:$version$distname
2323

2424
# create build tree
2525
cd ../../../
26-
tar -czvf keydb_$version.orig.tar.gz --force-local keydb-internal
27-
cd keydb-internal/pkg/deb/
26+
tar -czvf keydb_$version.orig.tar.gz --force-local KeyDB
27+
cd KeyDB/pkg/deb/
2828
mkdir -p $pkg_name/tmp
2929
if [[ "$codename" == "xenial" ]] || [[ "$codename" == "stretch" ]]; then
3030
cp -r debian_dh9 $pkg_name/tmp/debian

pkg/deb/debian/control

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ Build-Depends:
2626
libzstd-dev <!nocheck>
2727
Standards-Version: 4.2.1
2828
Homepage: https://docs.keydb.dev/
29-
Vcs-Git: https://github.com/EQ-Alpha/KeyDB.git
30-
Vcs-Browser: https://github.com/EQ-Alpha/KeyDB
29+
Vcs-Git: https://github.com/Snapchat/KeyDB.git
30+
Vcs-Browser: https://github.com/Snapchat/KeyDB
3131

3232
Package: keydb
3333
Architecture: all

pkg/deb/debian_dh9/control

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ Build-Depends:
2525
libzstd-dev <!nocheck>
2626
Standards-Version: 4.2.1
2727
Homepage: https://docs.keydb.dev/
28-
Vcs-Git: https://github.com/EQ-Alpha/KeyDB.git
29-
Vcs-Browser: https://github.com/EQ-Alpha/KeyDB
28+
Vcs-Git: https://github.com/Snapchat/KeyDB.git
29+
Vcs-Browser: https://github.com/Snapchat/KeyDB
3030

3131
Package: keydb
3232
Architecture: all

pkg/deb/master_changelog

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
keydb (6:6.3.1-1distribution_placeholder) codename_placeholder; urgency=medium
2+
3+
* This point release contains fixes to bugs related to expires, active-rep, and rdb saving
4+
* Issues fixed: #419, #422, #428
5+
* PRs: #426, #429, #431, #433
6+
7+
-- Ben Schermel <ben@eqalpha.com> Mon, 23 May 2022 20:00:37 +0000
8+
19
keydb (6:6.3.0-1distribution_placeholder) codename_placeholder; urgency=medium
210

311
* This release open sources KeyDB Enterprise features into the open source project along with PSYNC for active replication

pkg/docker/Dockerfile

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:20.04
1+
FROM ubuntu:18.04
22
SHELL ["/bin/bash","-c"]
33
RUN groupadd -r keydb && useradd -r -g keydb keydb
44
# use gosu for easy step-down from root: https://github.com/tianon/gosu/releases
@@ -77,7 +77,7 @@ RUN \
7777
mkdir /data && chown keydb:keydb /data; \
7878
mkdir /flash && chown keydb:keydb /flash; \
7979
mkdir -p /etc/keydb; \
80-
cp /tmp/keydb-internal/keydb.conf /etc/keydb/; \
80+
cp /tmp/KeyDB/keydb.conf /etc/keydb/; \
8181
sed -i 's/^\(daemonize .*\)$/# \1/' /etc/keydb/keydb.conf; \
8282
sed -i 's/^\(dir .*\)$/# \1\ndir \/data/' /etc/keydb/keydb.conf; \
8383
sed -i 's/^\(logfile .*\)$/# \1/' /etc/keydb/keydb.conf; \
@@ -110,8 +110,3 @@ ENV KEYDB_PRO_DIRECTORY=/usr/local/bin/
110110
ENTRYPOINT ["docker-entrypoint.sh"]
111111
EXPOSE 6379
112112
CMD ["keydb-server","/etc/keydb/keydb.conf"]
113-
114-
115-
116-
117-

pkg/docker/Dockerfile_Alpine

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
FROM alpine:3.12
2+
# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
3+
RUN addgroup -S -g 1000 keydb && adduser -S -G keydb -u 999 keydb
4+
RUN mkdir -p /etc/keydb
5+
ARG BRANCH
6+
RUN set -eux; \
7+
\
8+
apk add --no-cache su-exec; \
9+
apk add --no-cache --virtual .build-deps \
10+
coreutils \
11+
gcc \
12+
linux-headers \
13+
make \
14+
musl-dev \
15+
openssl-dev \
16+
git \
17+
util-linux-dev \
18+
curl-dev \
19+
g++ \
20+
libunwind-dev \
21+
bash \
22+
perl \
23+
git \
24+
; \
25+
cd /tmp && git clone --branch $BRANCH https://github.com/Snapchat/KeyDB.git --recursive; \
26+
cd /tmp/KeyDB; \
27+
# disable protected mode as it relates to docker
28+
grep -E '^ *createBoolConfig[(]"protected-mode",.*, *1 *,.*[)],$' ./src/config.cpp; \
29+
sed -ri 's!^( *createBoolConfig[(]"protected-mode",.*, *)1( *,.*[)],)$!\10\2!' ./src/config.cpp; \
30+
grep -E '^ *createBoolConfig[(]"protected-mode",.*, *0 *,.*[)],$' ./src/config.cpp; \
31+
make -j$(nproc) BUILD_TLS=yes; \
32+
cd src; \
33+
strip keydb-cli keydb-benchmark keydb-check-rdb keydb-check-aof keydb-diagnostic-tool keydb-sentinel keydb-server; \
34+
mv keydb-server keydb-cli keydb-benchmark keydb-check-rdb keydb-check-aof keydb-diagnostic-tool keydb-sentinel /usr/local/bin/; \
35+
runDeps="$( \
36+
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
37+
| tr ',' '\n' \
38+
| sort -u \
39+
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
40+
)"; \
41+
apk add --no-network --virtual .keydb-rundeps $runDeps; \
42+
apk del --no-network .build-deps; \
43+
# create working directories and organize files
44+
mkdir /data && chown keydb:keydb /data; \
45+
mkdir /flash && chown keydb:keydb /flash; \
46+
mkdir -p /etc/keydb; \
47+
cp /tmp/KeyDB/keydb.conf /etc/keydb/; \
48+
sed -i 's/^\(daemonize .*\)$/# \1/' /etc/keydb/keydb.conf; \
49+
sed -i 's/^\(dir .*\)$/# \1\ndir \/data/' /etc/keydb/keydb.conf; \
50+
sed -i 's/^\(logfile .*\)$/# \1/' /etc/keydb/keydb.conf; \
51+
sed -i 's/protected-mode yes/protected-mode no/g' /etc/keydb/keydb.conf; \
52+
sed -i 's/^\(bind .*\)$/# \1/' /etc/keydb/keydb.conf; \
53+
ln -s keydb-cli redis-cli; \
54+
cd /etc/keydb; \
55+
ln -s keydb.conf redis.conf; \
56+
rm -rf /tmp/*
57+
# generate entrypoint script
58+
RUN set -eux; \
59+
echo '#!/bin/sh' > /usr/local/bin/docker-entrypoint.sh; \
60+
echo 'set -e' >> /usr/local/bin/docker-entrypoint.sh; \
61+
echo "# first arg is '-f' or '--some-option'" >> /usr/local/bin/docker-entrypoint.sh; \
62+
echo "# or first arg is `something.conf`" >> /usr/local/bin/docker-entrypoint.sh; \
63+
echo 'if [ "${1#-}" != "$1" ] || [ "${1%.conf}" != "$1" ]; then' >> /usr/local/bin/docker-entrypoint.sh; \
64+
echo ' set -- keydb-server "$@"' >> /usr/local/bin/docker-entrypoint.sh; \
65+
echo 'fi' >> /usr/local/bin/docker-entrypoint.sh; \
66+
echo "# allow the container to be started with `--user`" >> /usr/local/bin/docker-entrypoint.sh; \
67+
echo 'if [ "$1" = "keydb-server" -a "$(id -u)" = "0" ]; then' >> /usr/local/bin/docker-entrypoint.sh; \
68+
echo " find . \! -user keydb -exec chown keydb '{}' +" >> /usr/local/bin/docker-entrypoint.sh; \
69+
echo ' exec su-exec keydb "$0" "$@"' >> /usr/local/bin/docker-entrypoint.sh; \
70+
echo 'fi' >> /usr/local/bin/docker-entrypoint.sh; \
71+
echo 'exec "$@"' >> /usr/local/bin/docker-entrypoint.sh; \
72+
chmod +x /usr/local/bin/docker-entrypoint.sh
73+
VOLUME /data
74+
WORKDIR /data
75+
ENTRYPOINT ["docker-entrypoint.sh"]
76+
EXPOSE 6379
77+
CMD ["keydb-server", "/etc/keydb/keydb.conf"]

0 commit comments

Comments
 (0)