Skip to content

Commit

Permalink
Merge pull request #28 from MOV-AI/dev
Browse files Browse the repository at this point in the history
Release log_level setting
  • Loading branch information
AlexFernandes-MOVAI authored Oct 9, 2024
2 parents 8c745c9 + 9bec4bc commit 4b3f995
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Bump version and push tag
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
if: ${{ contains(github.ref, 'refs/heads/main') || contains(github.ref, 'refs/tags/v')}}
steps:
- name: Login to Movai Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.PORTUS_APP_USER }}
password: ${{ secrets.PORTUS_APP_TOKEN }}
Expand Down
13 changes: 7 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ LABEL description="MOV.AI Redis Image"
LABEL maintainer="maintainer@mov.ai"
LABEL movai="redis"

# Configure and install
COPY files/etc/ /etc/
COPY files/bin/ /usr/local/bin/

ENV REDIS_PORT 6379

# hadolint ignore=DL3008
RUN apt-get update &&\
apt-get -y install --no-install-recommends redis-tools \
Expand All @@ -22,4 +16,11 @@ RUN apt-get update &&\
rm -rf /tmp/* &&\
mkdir -p /default

# Configure and install
COPY files/etc/ /etc/
COPY files/bin/ /usr/local/bin/

ENV REDIS_PORT=6379 \
REDIS_LOG_LEVEL=warning

ENTRYPOINT ["movai-entrypoint.sh","/etc/redis.conf"]
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,12 @@ This image uses [RedisJSON](https://github.com/RedisJSON/RedisJSON) v2.11 as a b
# run with specific port

docker run -e REDIS_PORT=6380 -p 6380:6380 --name redis2 pubregistry.aws.cloud.mov.ai/ce/redis2

# run with specific log level

docker run -e REDIS_LOG_LEVEL=notice -p 6379:6379 --name redis2 pubregistry.aws.cloud.mov.ai/ce/redis2


## Build

docker build -t redis2 .
6 changes: 5 additions & 1 deletion files/bin/movai-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,18 @@
set -m

sed -i -e "/^port:/s/:.*/ $REDIS_PORT/" /etc/redis.conf
sed -i -e "/^loglevel:/s/:.*/ $REDIS_LOG_LEVEL/" /etc/redis.conf

# Run command in background
exec docker-entrypoint.sh ${@} &

HOST=localhost
PORT=$REDIS_PORT
PORT=${REDIS_PORT:-6379}
LOG_LEVEL=${REDIS_LOG_LEVEL:-notice}

printf "Waiting redis on %s:.\n" "$HOST:$PORT"
printf "Log level: %s\n" "$LOG_LEVEL"

while ! redis-cli -h $HOST -p $PORT ping | grep -q PONG; do
sleep 1
printf "."
Expand Down
2 changes: 1 addition & 1 deletion files/etc/redis.conf
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ pidfile /var/run/redis_6379.pid
# verbose (many rarely useful info, but not a mess like the debug level)
# notice (moderately verbose, what you want in production probably)
# warning (only very important / critical messages are logged)
loglevel notice
loglevel:REDIS_LOG_LEVEL

# Specify the log file name. Also the empty string can be used to force
# Redis to log on the standard output. Note that if you use standard
Expand Down

0 comments on commit 4b3f995

Please sign in to comment.