Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 4136: Fix logging configurations are broken in docker image #4137

Merged
merged 1 commit into from
Dec 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions docker/scripts/apply-config-from-env.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,28 @@
## based on the ENV variables
## export my-key=new-value
##
## ./apply-config-from-env config_dir
## ./apply-config-from-env file ...
##

import os, sys

if len(sys.argv) != 2:
print('Usage: %s ' + 'config_dir' % (sys.argv[0]))
if len(sys.argv) < 2:
print('Usage: %s file ...' % (sys.argv[0]))
sys.exit(1)

def mylistdir(dir):
return [os.path.join(dir, filename) for filename in os.listdir(dir)]
def prepare_conf_files(files):
conf_files = []
for f in files:
if os.path.isfile(f):
if not os.path.isabs(f):
f = os.path.join(os.getcwd(), f)
conf_files.append(f)
else:
print('%s is not a readable file' % f)
sys.exit(1)
return conf_files

# Always apply env config to all the files under conf
conf_dir = sys.argv[1]
conf_files = mylistdir(conf_dir)
conf_files = prepare_conf_files(sys.argv[1:])
print('conf files: ')
print(conf_files)

Expand Down
2 changes: 1 addition & 1 deletion docker/scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ echo " BK_STREAM_STORAGE_ROOT_PATH is ${BK_STREAM_STORAGE_ROOT_PATH}"
echo " BK_NUM_STORAGE_CONTAINERS is ${BK_NUM_STORAGE_CONTAINERS}"
echo " BOOKIE_GRPC_PORT is ${BOOKIE_GRPC_PORT}"

python scripts/apply-config-from-env.py ${BK_HOME}/conf
python scripts/apply-config-from-env.py ${BK_HOME}/conf/*.conf

export BOOKIE_CONF=${BK_HOME}/conf/bk_server.conf
export SERVICE_PORT=${PORT0}
Expand Down
2 changes: 1 addition & 1 deletion docker/scripts/init_zookeeper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function create_zk_dynamic_conf() {
function init_zookeeper() {

# apply zookeeper envs
python scripts/apply-config-from-env.py ${BK_HOME}/conf
python scripts/apply-config-from-env.py ${BK_HOME}/conf/zookeeper.conf

# create dirs if they don't exist
create_zk_dirs
Expand Down
Loading