From 73b6facefbbf6f5b7af176b1e21cc77b497371fd Mon Sep 17 00:00:00 2001 From: Judy Joseph Date: Wed, 6 May 2020 21:07:01 -0700 Subject: [PATCH] Updated with a missing , in the database_config.json.j2 file, Do pip install of j2cli in docker-base-buster. --- dockers/docker-base-buster/Dockerfile.j2 | 4 ++++ dockers/docker-database/database_config.json.j2 | 2 +- files/build_templates/docker_image_ctl.j2 | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dockers/docker-base-buster/Dockerfile.j2 b/dockers/docker-base-buster/Dockerfile.j2 index de78845c62b3..35016faf89a2 100644 --- a/dockers/docker-base-buster/Dockerfile.j2 +++ b/dockers/docker-base-buster/Dockerfile.j2 @@ -44,6 +44,7 @@ RUN apt-get update && \ perl \ procps \ python \ + python-pip \ rsyslog \ vim-tiny \ # Install dependencies of supervisor @@ -66,6 +67,9 @@ RUN apt-get -y install \ iproute2 \ net-tools +# For templating +RUN pip install j2cli + RUN mkdir -p /etc/supervisor /var/log/supervisor RUN apt-get -y purge \ diff --git a/dockers/docker-database/database_config.json.j2 b/dockers/docker-database/database_config.json.j2 index 17b792e9274a..3383ec161144 100644 --- a/dockers/docker-database/database_config.json.j2 +++ b/dockers/docker-database/database_config.json.j2 @@ -3,7 +3,7 @@ "redis":{ "hostname" : "127.0.0.1", "port" : 6379, - "unix_socket_path" : "/var/run/redis{{NAMESPACE_ID}}/redis.sock" + "unix_socket_path" : "/var/run/redis{{NAMESPACE_ID}}/redis.sock", "persistence_for_warm_boot" : "yes" } }, diff --git a/files/build_templates/docker_image_ctl.j2 b/files/build_templates/docker_image_ctl.j2 index 67dbc92deb0b..90a234c009eb 100644 --- a/files/build_templates/docker_image_ctl.j2 +++ b/files/build_templates/docker_image_ctl.j2 @@ -202,6 +202,7 @@ start() { # various namesapces. The database_config paths are relative to the DIR of SONIC_DB_GLOBAL_JSON. SONIC_DB_GLOBAL_JSON="/var/run/redis/sonic-db/database_global.json" if [ -f "$SONIC_DB_GLOBAL_JSON" ]; then + # TODO Create a separate python script with the below logic and invoke it here. redis_dir_list=`/usr/bin/python -c "import sys; import os; import json; f=open(sys.argv[1]); \ global_db_dir = os.path.dirname(sys.argv[1]); data=json.load(f); \ print(\" \".join([os.path.normpath(global_db_dir+'/'+elem['include']).partition('sonic-db')[0]\