From c9c15fa790ddc7da4f12f929c76f3cd5ff682760 Mon Sep 17 00:00:00 2001 From: Corentin LABBE Date: Mon, 7 Jan 2019 15:58:01 +0100 Subject: lava-slave: add missing apt-get update The first action need to be an apt-get update since we dont know how old is the base image. --- lava-slave/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lava-slave/Dockerfile') diff --git a/lava-slave/Dockerfile b/lava-slave/Dockerfile index f0e699d..5850208 100644 --- a/lava-slave/Dockerfile +++ b/lava-slave/Dockerfile @@ -1,5 +1,7 @@ FROM baylibre/lava-slave-base:2018.11-1_bpo9_1 +RUN apt-get update + RUN DEBIAN_FRONTEND=noninteractive apt-get -y install cu conmux COPY configs/lava-slave /etc/lava-dispatcher/lava-slave -- cgit 1.2.3-korg From e9c7827af4a9f8e52b8f0df04365808298d08c0a Mon Sep 17 00:00:00 2001 From: Corentin LABBE Date: Tue, 8 Jan 2019 14:33:27 +0100 Subject: Permit to choose loglevel By default, all process use the DEBUG loglevel, this could be too much for a production server. This patch permits to tune the loglevel. --- README.md | 5 +++++ lava-master/Dockerfile | 2 ++ lava-master/default/.empty | 0 lava-slave/Dockerfile | 2 ++ lava-slave/default/.empty | 0 lavalab-gen.py | 28 ++++++++++++++++++++++++++-- 6 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 lava-master/default/.empty create mode 100644 lava-slave/default/.empty (limited to 'lava-slave/Dockerfile') diff --git a/README.md b/README.md index da88f2b..177667a 100644 --- a/README.md +++ b/README.md @@ -221,6 +221,11 @@ masters: slave_keys: optional path to a directory with slaves public key. Usefull when you want to create a master without slaves nodes in boards.yaml. persistent_db: True/False (default False) Is the postgres DB is persistent over reboot http_fqdn: The FQDN used to access the LAVA web interface. This is necessary if you use https otherwise you will issue CSRF errors. + loglevel: + lava-logs: DEBUG/INFO/WARN/ERROR (optional) select the loglevel of lava-logs (default to DEBUG) + lava-slave: DEBUG/INFO/WARN/ERROR (optional) select the loglevel of lava-slave (default to DEBUG) + lava-master: DEBUG/INFO/WARN/ERROR (optional) select the loglevel of lava-master (default to DEBUG) + lava-server-gunicorn: DEBUG/INFO/WARN/ERROR (optional) select the loglevel of lava-server-gunicorn (default to DEBUG) users: - name: LAVA username token: The token of this user (optional) diff --git a/lava-master/Dockerfile b/lava-master/Dockerfile index b41446f..5d2a119 100644 --- a/lava-master/Dockerfile +++ b/lava-master/Dockerfile @@ -4,6 +4,8 @@ COPY backup /root/backup/ COPY configs/tftpd-hpa /etc/default/tftpd-hpa +COPY default/* /etc/default/ + RUN git clone https://github.com/BayLibre/lava-healthchecks.git RUN cp lava-healthchecks/health-checks/* /etc/lava-server/dispatcher-config/health-checks/ COPY health-checks/* /etc/lava-server/dispatcher-config/health-checks/ diff --git a/lava-master/default/.empty b/lava-master/default/.empty new file mode 100644 index 0000000..e69de29 diff --git a/lava-slave/Dockerfile b/lava-slave/Dockerfile index 5850208..7cb607b 100644 --- a/lava-slave/Dockerfile +++ b/lava-slave/Dockerfile @@ -34,6 +34,8 @@ RUN apt-get update RUN apt-get -y install lavacli +COPY default/* /etc/default/ + COPY phyhostname /root/ COPY scripts/setup.sh . diff --git a/lava-slave/default/.empty b/lava-slave/default/.empty new file mode 100644 index 0000000..e69de29 diff --git a/lavalab-gen.py b/lavalab-gen.py index 378f40c..d6c2b75 100755 --- a/lavalab-gen.py +++ b/lavalab-gen.py @@ -94,7 +94,7 @@ def main(): else: masters = workers["masters"] for master in masters: - keywords_master = [ "name", "type", "host", "users", "groups", "tokens", "webadmin_https", "persistent_db", "zmq_auth", "zmq_auth_key", "zmq_auth_key_secret", "http_fqdn", "slave_keys", "slaveenv" ] + keywords_master = [ "name", "type", "host", "users", "groups", "tokens", "webadmin_https", "persistent_db", "zmq_auth", "zmq_auth_key", "zmq_auth_key_secret", "http_fqdn", "slave_keys", "slaveenv", "loglevel" ] for keyword in master: if not keyword in keywords_master: print("WARNING: unknown keyword %s" % keyword) @@ -254,6 +254,18 @@ def main(): for line in slaveenv["env"]: fenv.write(" %s\n" % line) fenv.close() + if "loglevel" in worker: + for component in worker["loglevel"]: + if component != "lava-master" and component != "lava-logs" and component != 'lava-server-gunicorn': + print("ERROR: invalid loglevel component %s" % component) + sys.exit(1) + loglevel = worker["loglevel"][component] + if loglevel != 'DEBUG' and loglevel != 'INFO' and loglevel != 'WARN' and loglevel != 'ERROR': + print("ERROR: invalid loglevel %s for %s" % (loglevel, component)) + sys.exit(1) + fcomponent = open("%s/default/%s" % (workerdir, component), 'w') + fcomponent.write("LOGLEVEL=%s\n" % loglevel) + fcomponent.close() default_slave = "lab-slave-0" if "slaves" not in workers: @@ -261,7 +273,7 @@ def main(): else: slaves = workers["slaves"] for slave in slaves: - keywords_slaves = [ "name", "host", "dispatcher_ip", "remote_user", "remote_master", "remote_address", "remote_rpc_port", "remote_proto", "extra_actions", "zmq_auth_key", "zmq_auth_key_secret", "default_slave", "export_ser2net", "expose_ser2net", "remote_user_token", "zmq_auth_master_key", "expose_ports", "env", "bind_dev" ] + keywords_slaves = [ "name", "host", "dispatcher_ip", "remote_user", "remote_master", "remote_address", "remote_rpc_port", "remote_proto", "extra_actions", "zmq_auth_key", "zmq_auth_key_secret", "default_slave", "export_ser2net", "expose_ser2net", "remote_user_token", "zmq_auth_master_key", "expose_ports", "env", "bind_dev", "loglevel" ] for keyword in slave: if not keyword in keywords_slaves: print("WARNING: unknown keyword %s" % keyword) @@ -393,6 +405,18 @@ def main(): fp.write("\n") fp.close() os.chmod("%s/scripts/extra_actions" % workerdir, 0o755) + if "loglevel" in worker: + for component in worker["loglevel"]: + if component != "lava-slave": + print("ERROR: invalid loglevel component %s" % component) + sys.exit(1) + loglevel = worker["loglevel"][component] + if loglevel != 'DEBUG' and loglevel != 'INFO' and loglevel != 'WARN' and loglevel != 'ERROR': + print("ERROR: invalid loglevel %s for %s" % (loglevel, component)) + sys.exit(1) + fcomponent = open("%s/default/%s" % (workerdir, component), 'w') + fcomponent.write("LOGLEVEL=%s\n" % loglevel) + fcomponent.close() if "boards" not in workers: boards = {} -- cgit 1.2.3-korg