diff options
author | Corentin LABBE <clabbe@baylibre.com> | 2019-07-02 11:14:07 +0200 |
---|---|---|
committer | Corentin LABBE <clabbe@baylibre.com> | 2019-08-26 14:36:50 +0200 |
commit | 63da4cb3d258222ff1b11052951c7e5d7ca8e02c (patch) | |
tree | 2c309e475a66d2a8126549d444d3ca23aee97931 /lavalab-gen.py | |
parent | c0be09b6ddfd855eeadb3628a481f9c0bb4e26b7 (diff) |
Upgrade to 2019.07
This patch upgrade LAVA to 2019.07 via their official docker images.
Along with the change of the baseimage from our lava-xx-base to official
2019.07, some minor changes are needed:
- Activate the en_US.UTF-8 locale needed for postgresql
- chown to lavaserver all copied device-types
- Fix the start scripts for using the official entrypoints
Diffstat (limited to 'lavalab-gen.py')
-rwxr-xr-x | lavalab-gen.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/lavalab-gen.py b/lavalab-gen.py index b3f096a..28a3a22 100755 --- a/lavalab-gen.py +++ b/lavalab-gen.py @@ -128,8 +128,6 @@ def main(): dockcomp["services"][name]["volumes"] = [ "/boot:/boot", "/lib/modules:/lib/modules" ] dockcomp["services"][name]["build"] = {} dockcomp["services"][name]["build"]["context"] = name - if "lava-coordinator" in master and master["lava-coordinator"]: - dockcomp["services"][name]["ports"].append('3079:3079') persistent_db = False if "persistent_db" in master: persistent_db = master["persistent_db"] @@ -140,8 +138,6 @@ def main(): dockcomp["volumes"] = {} dockcomp["volumes"][pg_volume_name] = {} dockcomp["volumes"]["lava_job_output"] = {} - with open(dockcomposeymlpath, 'w') as f: - yaml.dump(dockcomp, f) shutil.copytree("lava-master", workerdir) os.mkdir("%s/devices" % workerdir) @@ -151,6 +147,18 @@ def main(): groupdir = "%s/groups" % workerdir os.mkdir(groupdir) worker = master + if "lava-coordinator" in master and master["lava-coordinator"]: + dockcomp["services"][name]["ports"].append('3079:3079') + f_entrypoint = open("%s/entrypoint.d/02_lava-coordinator.sh" % workerdir, 'w') + f_entrypoint.write("#!/bin/sh\n") + f_entrypoint.write("echo 'Start lava-coordinator'\n") + f_entrypoint.write("mkdir /run/lava-coordinator && chown lavaserver /run/lava-coordinator\n") + f_entrypoint.write("start-stop-daemon --start --chuid lavaserver --background --exec /usr/bin/lava-coordinator -- --logfile=/var/log/lava-server/lava-coordinator.log\n") + f_entrypoint.write("exit $?\n") + f_entrypoint.close() + os.chmod("%s/entrypoint.d/02_lava-coordinator.sh" % workerdir, 0o755) + with open(dockcomposeymlpath, 'w') as f: + yaml.dump(dockcomp, f) if "healthcheck_url" in master: f_hc = open("%s/health-checks/healthcheck_url" % workerdir, 'w') f_hc.write(master["healthcheck_url"]) |