Skip to content

Commit

Permalink
Permit to choose gunicorn workers number
Browse files Browse the repository at this point in the history
  • Loading branch information
montjoie committed Nov 17, 2023
1 parent ab549e7 commit d34a316
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions lava-master/entrypoint.d/01_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,12 @@ do
done
done

if [ ! -z "$GUNICORN_WORKERS" ];then
echo "DEBUG: set gunicorn workers to $GUNICORN_WORKERS"
grep -ri workers /etc
sed -i "s,.*WORKERS=.*,WORKERS=$GUNICORN_WORKERS," /etc/lava-server/lava-server-gunicorn || exit $?
fi

echo "DEBUG: fix owning rights on /etc/lava-server/dispatcher-config"
chown -Rc lavaserver:lavaserver /etc/lava-server/dispatcher-config
exit 0
6 changes: 5 additions & 1 deletion lavalab-gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def main():
"allowed_hosts",
"build_args",
"event_notifications",
"groups",
"groups", "gunicorn_workers",
"healthcheck_url", "host", "http_fqdn",
"loglevel", "lava-coordinator",
"name",
Expand Down Expand Up @@ -199,6 +199,10 @@ def main():
f_entrypoint.write("exit $?\n")
f_entrypoint.close()
os.chmod("%s/entrypoint.d/02_lava-coordinator.sh" % workerdir, 0o755)
if "gunicorn_workers" in worker:
dockcomp["services"][name]["environment"] = {}
dockcomp["services"][name]["environment"]["GUNICORN_WORKERS"] = worker["gunicorn_workers"]

with open(dockcomposeymlpath, 'w') as f:
yaml.dump(dockcomp, f)
if "healthcheck_url" in master:
Expand Down

0 comments on commit d34a316

Please sign in to comment.