summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md27
-rwxr-xr-xlavalab-gen.py34
2 files changed, 60 insertions, 1 deletions
diff --git a/README.md b/README.md
index 7002c57..de78d7b 100644
--- a/README.md
+++ b/README.md
@@ -265,6 +265,8 @@ slaves:
remote_proto: http(default) or https
default_slave: Does this slave is the default slave where to add boards (default: lab-slave-0)
bind_dev: Bind /dev from host to slave. This is needed when using some HID PDU
+ use_nfs: Does the LAVA dispatcher will run NFS jobs
+ arch: The arch of the worker (if not x86_64), only accept arm64
expose_ser2net: Do ser2net ports need to be available on host
expose_ports: Expose port p1 on the host to p2 on the worker slave.
- p1:p2
@@ -273,6 +275,12 @@ slaves:
env:
- line1 A list of line to set as environment (See /etc/lava-server/env.yaml for examples)
- line2
+ devices: A list of devices which need UDEV rules
+ - name: The name of the device
+ vendorid: The VID of the UART (Formated as 0xXXXX)
+ productid: the PID of the UART (Formated as 0xXXXX)
+ serial: The serial number of the device if the device got one
+ devpath: The UDEV devpath to this device if more than one is present
boards:
- name: devicename Each board must be named by their device-type as "device-type-XX" (where XX is a number)
@@ -405,6 +413,12 @@ For building an arm64 lava-docker, some little trick are necesssary:
For building lava-xxx-base images
- replace "bitnami/minideb" by "arm64v8/debian" on lava-master-base/lava-slave-base dockerfiles.
+# How to ran NFS jobs
+You need to se use_nfs: True on slave that will ran NFS jobs.
+A working NFS server must be working on the host.
+Furthermore, you must create a /var/lib/lava/dispatcher/tmp directory on the host and export it like:
+/var/lib/lava/dispatcher/tmp 192.168.66.0/24(no_root_squash,rw,no_subtree_check)
+
## How to add custom LAVA patchs
You can add custom or backported LAVA patchs in lava-master/lava-patch
Doing the same for lava-slave will be done later.
@@ -422,6 +436,19 @@ slave:
env:
- "http_proxy: http://dns:port"
+## How to use a board which uses PXE ?
+All boards which uses PXE, could be used with LAVA via grub.
+But you need to add a configuration in your DHCP server for that board.
+This configuration need tell to the PXE to get GRUB for the dispatcher TFTP.
+EXample for an upsquare and a dispatcher availlable at 192.168.66.1:
+```
+ host upsquare {
+ hardware ethernet 00:07:32:54:41:bb;
+ filename "/boot/grub/x86_64-efi/core.efi";
+ next-server 192.168.66.1;
+ }
+```
+
## Bugs, Contact
The prefered way to submit bugs are via the github issue tracker
You can also contact us on #lava-docker on the freenode IRC network
diff --git a/lavalab-gen.py b/lavalab-gen.py
index d1a78e2..366c141 100755
--- a/lavalab-gen.py
+++ b/lavalab-gen.py
@@ -281,7 +281,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", "loglevel" ]
+ 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", "use_nfs", "arch", "devices" ]
for keyword in slave:
if not keyword in keywords_slaves:
print("WARNING: unknown keyword %s" % keyword)
@@ -329,6 +329,13 @@ def main():
worker = slave
worker_name = name
slave_master = None
+ if "arch" in worker:
+ if worker["arch"] == 'arm64':
+ dockerfile = open("%s/Dockerfile" % workerdir, "r+")
+ dockerfilec = dockerfile.read().replace("lava-slave-base", "lava-slave-base-arm64")
+ dockerfile.seek(0)
+ dockerfile.write(dockerfilec)
+ dockerfile.close()
#NOTE remote_master is on slave
if not "remote_master" in worker:
remote_master = "lava-master"
@@ -413,6 +420,31 @@ def main():
fp.write("\n")
fp.close()
os.chmod("%s/scripts/extra_actions" % workerdir, 0o755)
+
+ if "devices" in worker:
+ if not os.path.isdir("output/%s/udev" % host):
+ os.mkdir("output/%s/udev" % host)
+ for udev_dev in worker["devices"]:
+ udev_line = 'SUBSYSTEM=="tty", ATTRS{idVendor}=="%04x", ATTRS{idProduct}=="%04x",' % (udev_dev["idvendor"], udev_dev["idproduct"])
+ if "serial" in udev_dev:
+ udev_line += 'ATTRS{serial}=="%s", ' % udev_dev["serial"]
+ if "devpath" in udev_dev:
+ udev_line += 'ATTRS{devpath}=="%s", ' % udev_dev["devpath"]
+ udev_line += 'MODE="0664", OWNER="uucp", SYMLINK+="%s"\n' % udev_dev["name"]
+ fudev = open("output/%s/udev/99-lavaworker-udev.rules" % host, "a")
+ fudev.write(udev_line)
+ fudev.close()
+ if not "bind_dev" in slave:
+ dockcomp_add_device(dockcomp, worker_name, "/dev/%s:/dev/%s" % (udev_dev["name"], udev_dev["name"]))
+ use_nfs = False
+ if "use_nfs" in worker:
+ use_nfs = worker["use_nfs"]
+ if use_nfs:
+ dockcomp["services"][worker_name]["volumes"].append("/var/lib/lava/dispatcher/tmp:/var/lib/lava/dispatcher/tmp")
+ fp = open("%s/scripts/extra_actions" % workerdir, "a")
+ fp.write("apt-get -y install nfs-kernel-server\n")
+ fp.close()
+ os.chmod("%s/scripts/extra_actions" % workerdir, 0o755)
if "loglevel" in worker:
for component in worker["loglevel"]:
if component != "lava-slave":