diff options
-rw-r--r-- | README.md | 1 | ||||
-rwxr-xr-x | lava-slave/scripts/setup.sh | 7 | ||||
-rwxr-xr-x | lavalab-gen.py | 16 |
3 files changed, 13 insertions, 11 deletions
@@ -242,6 +242,7 @@ slaves: remote_rpc_port: the port used by the LAVA RPC2 (default 80) remote_user: the user used for connecting to the master remote_proto: http(default) or https + default_slave: Does this slave is the default slave where to add boards (default: lab-slave-0) extra_actions: An optional list of action to do at end of the docker build - "apt-get install package" diff --git a/lava-slave/scripts/setup.sh b/lava-slave/scripts/setup.sh index e7992c0..e688c9e 100755 --- a/lava-slave/scripts/setup.sh +++ b/lava-slave/scripts/setup.sh @@ -15,17 +15,18 @@ cd /root/lavacli LAVACLIOPTS="--uri $LAVA_MASTER_URI" # do a sort of ping for letting master to be up -TIMEOUT=30 +TIMEOUT=300 while [ $TIMEOUT -ge 1 ]; do + STEP=2 lavacli $LAVACLIOPTS device-types list 2>/dev/null >/dev/null if [ $? -eq 0 ];then TIMEOUT=0 else echo "Wait for master...." - sleep 2 + sleep $STEP fi - TIMEOUT=$(($TIMEOUT-1)) + TIMEOUT=$(($TIMEOUT-$STEP)) done # This directory is used for storing device-types already added diff --git a/lavalab-gen.py b/lavalab-gen.py index 597bd1a..b327813 100755 --- a/lavalab-gen.py +++ b/lavalab-gen.py @@ -219,7 +219,7 @@ def main(): sys.exit(1) 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" ] + 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" ] for keyword in slave: if not keyword in keywords_slaves: print("WARNING: unknown keyword %s" % keyword) @@ -331,29 +331,29 @@ def main(): for board in boards: board_name = board["name"] if "slave" in board: - slave_name = board["slave"] + worker_name = board["slave"] else: - slave_name = default_slave - print("\tFound %s on %s" % (board_name, slave_name)) + worker_name = default_slave + print("\tFound %s on %s" % (board_name, worker_name)) found_slave = False for fs in workers["slaves"]: - if fs["name"] == slave_name: + if fs["name"] == worker_name: slave = fs found_slave = True if not found_slave: - print("Cannot find slave %s" % slave_name) + print("Cannot find slave %s" % worker_name) sys.exit(1) if not "host" in slave: host = "local" else: host = slave["host"] - workerdir = "output/%s/%s" % (host, slave_name) + workerdir = "output/%s/%s" % (host, worker_name) dockcomposeymlpath = "output/%s/docker-compose.yml" % host fp = open(dockcomposeymlpath, "r") dockcomp = yaml.load(fp) fp.close() device_path = "%s/devices/" % workerdir - devices_path = "%s/devices/%s" % (workerdir, slave_name) + devices_path = "%s/devices/%s" % (workerdir, worker_name) devicetype = board["type"] device_line = template_device.substitute(devicetype=devicetype) if "pdu_generic" in board: |