summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md34
-rw-r--r--lava-master-base/99-stretch-backports4
-rw-r--r--lava-master-base/Dockerfile12
-rw-r--r--lava-master/Dockerfile12
-rwxr-xr-xlava-master/scripts/setup.sh4
-rw-r--r--lava-slave-base/Dockerfile14
-rw-r--r--lava-slave/Dockerfile19
-rw-r--r--lava-slave/grub.cfg1
-rw-r--r--lava-slave/lava-coordinator/.empty0
-rwxr-xr-xlava-slave/scripts/setup.sh4
-rwxr-xr-xlavalab-gen.py83
11 files changed, 154 insertions, 33 deletions
diff --git a/README.md b/README.md
index 177667a..942fc99 100644
--- a/README.md
+++ b/README.md
@@ -219,8 +219,12 @@ masters:
zmq_auth_key: optional path to a public ZMQ key
zmq_auth_key_secret: optional path to a private ZMQ key
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.
+ lava-coordinator: Does the master should ran a lava-coordinator and export its port
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.
+ allowed_hosts: A list of FQDN used to access the LAVA master
+ - "fqdn1"
+ - "fqdn2"
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)
@@ -262,6 +266,10 @@ 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
+ use_tap: Does TAP netdevices could be used
+ arch: The arch of the worker (if not x86_64), only accept arm64
+ lava-coordinator: Does the slave should ran a lava-coordinator
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
@@ -270,13 +278,18 @@ 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)
type: the LAVA device-type of this device
slave: (optional) Name of the slave managing this device. Default to first slave found or default_slave if set.
kvm: (For qemu only) Does the qemu could use KVM (default: no)
- tap: (For qemu only) Does the qemu could use TAP devices (default: no)
uboot_ipaddr: (optional) a static IP to set in uboot
uboot_macaddr: (Optional) the MAC address to set in uboot
custom_option: (optional) All following strings will be directly append to devicefile
@@ -402,6 +415,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.
@@ -419,6 +438,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/lava-master-base/99-stretch-backports b/lava-master-base/99-stretch-backports
index cfd4832..02491b1 100644
--- a/lava-master-base/99-stretch-backports
+++ b/lava-master-base/99-stretch-backports
@@ -37,3 +37,7 @@ Pin-Priority: 500
Package: lavacli
Pin: release n=stretch-backports
Pin-Priority: 500
+
+Package: python3-junit.xml
+Pin: release n=stretch-backports
+Pin-Priority: 500
diff --git a/lava-master-base/Dockerfile b/lava-master-base/Dockerfile
index 03b634f..ee7d47f 100644
--- a/lava-master-base/Dockerfile
+++ b/lava-master-base/Dockerfile
@@ -12,6 +12,8 @@ RUN echo 'lava-server lava-server/instance-name string lava-docker-instance' |
&& echo 'locales locales/locales_to_be_generated multiselect C.UTF-8 UTF-8, en_US.UTF-8 UTF-8 ' | debconf-set-selections \
&& echo 'locales locales/default_environment_locale select en_US.UTF-8' | debconf-set-selections
+RUN echo "APT::Install-Recommends false;" > /etc/apt/apt.conf.d/01norecommands
+
# e2fsprogs is for libguestfs
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install \
locales \
@@ -20,16 +22,18 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get -y install \
sudo \
wget \
e2fsprogs \
+ letsencrypt \
+ apt-transport-https \
gnupg \
vim
-RUN wget http://images.validation.linaro.org/production-repo/production-repo.key.asc \
- && apt-key add production-repo.key.asc \
- && echo 'deb http://images.validation.linaro.org/production-repo/ stretch-backports main' > /etc/apt/sources.list.d/lava.list \
+RUN wget https://apt.lavasoftware.org/lavasoftware.key.asc \
+ && apt-key add lavasoftware.key.asc \
+ && echo 'deb https://apt.lavasoftware.org/release stretch-backports main' > /etc/apt/sources.list.d/lava.list \
&& apt-get clean && apt-get update && apt-get -y upgrade
RUN service postgresql start \
- && DEBIAN_FRONTEND=noninteractive apt-get -y install lava \
+ && DEBIAN_FRONTEND=noninteractive apt-get -y install lava lava-server \
&& sudo -u postgres psql lavaserver -c "DELETE FROM lava_scheduler_app_worker WHERE lava_scheduler_app_worker.hostname = 'example.com';" \
&& service postgresql stop
diff --git a/lava-master/Dockerfile b/lava-master/Dockerfile
index 5d2a119..9b56be8 100644
--- a/lava-master/Dockerfile
+++ b/lava-master/Dockerfile
@@ -1,4 +1,4 @@
-FROM baylibre/lava-master-base:2018.11-1_bpo9_1
+FROM baylibre/lava-master-base:2019.03_stretch
COPY backup /root/backup/
@@ -20,11 +20,13 @@ COPY scripts/setup.sh /
COPY settings.conf /etc/lava-server/
-COPY device-types-patch/ /root/device-types-patch/
-RUN cd /etc/lava-server/dispatcher-config/device-types/ && for patch in $(ls /root/device-types-patch/*patch) ; do sed -i 's,lava_scheduler_app/tests/device-types/,,' $patch && patch < $patch || exit $?; done
-
COPY lava-patch/ /root/lava-patch
-RUN cd /usr/lib/python3/dist-packages && for patch in $(ls /root/lava-patch/*patch) ; do patch -p1 < $patch || exit $?;done
+RUN cd /usr/lib/python3/dist-packages && for patch in $(ls /root/lava-patch/*patch| sort) ; do echo $patch && patch -p1 < $patch || exit $?;done
+RUN rsync -avr /usr/lib/python3/dist-packages/lava_scheduler_app/tests/device-types/ /etc/lava-server/dispatcher-config/device-types/
+
+COPY device-types-patch/ /root/device-types-patch/
+RUN cd /etc/lava-server/dispatcher-config/device-types/ && for patch in $(ls /root/device-types-patch/*patch) ; do sed -i 's,lava_scheduler_app/tests/device-types/,,' $patch && echo $patch && patch < $patch || exit $?; done
+RUN chown -R lavaserver:lavaserver /etc/lava-server/dispatcher-config/device-types/
COPY zmq_auth/ /etc/lava-dispatcher/certificates.d/
diff --git a/lava-master/scripts/setup.sh b/lava-master/scripts/setup.sh
index c22a06f..489dd51 100755
--- a/lava-master/scripts/setup.sh
+++ b/lava-master/scripts/setup.sh
@@ -151,6 +151,10 @@ mkdir -p /root/.lavadocker/
if [ -e /root/device-types ];then
for i in $(ls /root/device-types/*jinja2)
do
+ if [ -e /etc/lava-server/dispatcher-config/device-types/$(basename $i) ];then
+ echo "WARNING: overwriting device-type $i"
+ diff -u "/etc/lava-server/dispatcher-config/device-types/$(basename $i)" $i
+ fi
cp $i /etc/lava-server/dispatcher-config/device-types/
devicetype=$(basename $i |sed 's,.jinja2,,')
lava-server manage device-types list | grep -q "[[:space:]]$devicetype[[:space:]]"
diff --git a/lava-slave-base/Dockerfile b/lava-slave-base/Dockerfile
index ec884cf..d7852a7 100644
--- a/lava-slave-base/Dockerfile
+++ b/lava-slave-base/Dockerfile
@@ -1,5 +1,7 @@
FROM bitnami/minideb:stretch
+RUN echo "APT::Install-Recommends false;" > /etc/apt/apt.conf.d/01norecommands
+
RUN apt-get update
# e2fsprogs is for libguestfs
@@ -10,6 +12,8 @@ RUN \
DEBIAN_FRONTEND=noninteractive apt-get -y install \
locales \
vim \
+ letsencrypt \
+ apt-transport-https \
sudo \
python-setproctitle \
tftpd-hpa \
@@ -24,11 +28,11 @@ RUN \
RUN if [ "$(uname -m)" = "x86_64" -o "$(uname -m)" = "x86" ] ;then apt-get -y install qemu-kvm ; fi
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install wget gnupg
-RUN wget http://images.validation.linaro.org/production-repo/production-repo.key.asc
-RUN apt-key add production-repo.key.asc
-RUN echo 'deb http://images.validation.linaro.org/production-repo/ stretch-backports main' > /etc/apt/sources.list.d/lava.list
-RUN echo "deb http://deb.debian.org/debian/ stretch-backports main" >> /etc/apt/sources.list
-RUN apt-get clean && apt-get update
+RUN wget https://apt.lavasoftware.org/lavasoftware.key.asc \
+ && apt-key add lavasoftware.key.asc \
+ && echo 'deb https://apt.lavasoftware.org/release stretch-backports main' > /etc/apt/sources.list.d/lava.list \
+ && echo "deb http://deb.debian.org/debian/ stretch-backports main" >> /etc/apt/sources.list \
+ && apt-get clean && apt-get update
COPY 99-stretch-backports /etc/apt/preferences.d/
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install lava-dispatcher
diff --git a/lava-slave/Dockerfile b/lava-slave/Dockerfile
index 32a76b0..d6375f2 100644
--- a/lava-slave/Dockerfile
+++ b/lava-slave/Dockerfile
@@ -1,8 +1,11 @@
-FROM baylibre/lava-slave-base:2018.11-1_bpo9_1
+FROM baylibre/lava-slave-base:2019.03_stretch
RUN apt-get update
-RUN DEBIAN_FRONTEND=noninteractive apt-get -y install cu conmux
+# cu conmux is for console via conmux
+# telnet is for using ser2net
+# git is necessary for checkout tests
+RUN DEBIAN_FRONTEND=noninteractive apt-get -y install cu conmux telnet git
COPY configs/lava-slave /etc/lava-dispatcher/lava-slave
@@ -35,7 +38,9 @@ RUN apt-get update
RUN apt-get -y install lavacli
# PXE stuff
-RUN apt-get -y install grub-efi-amd64-bin
+RUN if [ $(uname -m) != amd64 ]; then dpkg --add-architecture amd64 && apt-get update; fi
+RUN apt-get -y install grub-efi-amd64-bin:amd64
+RUN if [ $(uname -m) != amd64 ]; then dpkg --remove architecture amd64 && apt-get update; fi
RUN cd /var/lib/lava/dispatcher/tmp && grub-mknetdir --net-directory=.
COPY grub.cfg /var/lib/lava/dispatcher/tmp/boot/grub/
@@ -44,9 +49,17 @@ COPY default/* /etc/default/
COPY phyhostname /root/
COPY scripts/setup.sh .
+RUN apt-get -y install patch
COPY lava-patch/ /root/lava-patch
RUN cd /usr/lib/python3/dist-packages && for patch in $(ls /root/lava-patch/*patch) ; do patch -p1 < $patch || exit $?;done
+RUN mkdir /etc/lava-coordinator/
+COPY lava-coordinator/* /etc/lava-coordinator/
+RUN if [ -e /etc/lava-coordinator/lava-coordinator.cnf ]; then DEBIAN_FRONTEND=noninteractive apt-get -y install lava-coordinator && mv /etc/lava-coordinator/lava-coordinator.cnf /etc/lava-coordinator/lava-coordinator.conf ; fi
+
+# needed for lavacli identities
+RUN mkdir -p /root/.config
+
COPY devices/ /root/devices/
COPY tags/ /root/tags/
COPY deviceinfo/ /root/deviceinfo/
diff --git a/lava-slave/grub.cfg b/lava-slave/grub.cfg
index e133fed..d7074b3 100644
--- a/lava-slave/grub.cfg
+++ b/lava-slave/grub.cfg
@@ -5,7 +5,6 @@ insmod loopback
insmod iso9660
insmod all_video
insmod regexp
-insmod biosdisk
set pager=1
# This fake menu is necessary for letting LAVA see that grub is started
diff --git a/lava-slave/lava-coordinator/.empty b/lava-slave/lava-coordinator/.empty
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/lava-slave/lava-coordinator/.empty
diff --git a/lava-slave/scripts/setup.sh b/lava-slave/scripts/setup.sh
index e0e8322..fce01f8 100755
--- a/lava-slave/scripts/setup.sh
+++ b/lava-slave/scripts/setup.sh
@@ -10,6 +10,8 @@ if [ -z "$LAVA_MASTER_URI" ];then
exit 11
fi
+lavacli identities add --uri $LAVA_MASTER_BASEURI --token $LAVA_MASTER_TOKEN --username $LAVA_MASTER_USER default
+
echo "Dynamic slave for $LAVA_MASTER ($LAVA_MASTER_URI)"
LAVACLIOPTS="--uri $LAVA_MASTER_URI"
@@ -18,7 +20,7 @@ TIMEOUT=300
while [ $TIMEOUT -ge 1 ];
do
STEP=2
- lavacli $LAVACLIOPTS device-types list 2>/dev/null >/dev/null
+ lavacli $LAVACLIOPTS device-types list >/dev/null
if [ $? -eq 0 ];then
TIMEOUT=0
else
diff --git a/lavalab-gen.py b/lavalab-gen.py
index b0b58b4..6332284 100755
--- a/lavalab-gen.py
+++ b/lavalab-gen.py
@@ -14,6 +14,7 @@ tokens_yaml = "tokens.yaml"
baud_default = 115200
ser2net_port_start = 63001
ser2net_ports = {}
+allowed_hosts_list = [ '"127.0.0.1"' ]
template_conmux = string.Template("""#
# auto-generated by lavalab-gen.py for ${board}
@@ -60,12 +61,22 @@ template_settings_conf = string.Template("""
"HTTPS_XML_RPC": false,
"LOGIN_URL": "/accounts/login/",
"LOGIN_REDIRECT_URL": "/",
+ "ALLOWED_HOSTS": [ $allowed_hosts ],
"CSRF_TRUSTED_ORIGINS": ["$lava_http_fqdn"],
"CSRF_COOKIE_SECURE": $cookie_secure,
"SESSION_COOKIE_SECURE": $session_cookie_secure
}
""")
+template_lava_coordinator_conf = string.Template("""
+{
+ "port": 3079,
+ "blocksize": 4096,
+ "poll_delay": 3,
+ "coordinator_hostname": "$masterurl"
+}
+""")
+
def dockcomp_add_device(dockcomp, worker_name, devicemap):
if "devices" in dockcomp["services"][worker_name]:
dc_devices = dockcomp["services"][worker_name]["devices"]
@@ -94,7 +105,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", "loglevel" ]
+ 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", "allowed_hosts", "lava-coordinator" ]
for keyword in master:
if not keyword in keywords_master:
print("WARNING: unknown keyword %s" % keyword)
@@ -117,6 +128,8 @@ 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"]
@@ -149,13 +162,19 @@ def main():
session_cookie_secure = "false"
if "http_fqdn" in worker:
lava_http_fqdn = worker["http_fqdn"]
+ allowed_hosts_list.append('"%s"' % lava_http_fqdn)
else:
- lava_http_fqdn = "example.com"
+ lava_http_fqdn = "127.0.0.1"
+ allowed_hosts_list.append('"%s"' % name)
+ if "allowed_hosts" in worker:
+ for allow_host in worker["allowed_hosts"]:
+ allowed_hosts_list.append('"%s"' % allow_host)
+ allowed_hosts = ','.join(allowed_hosts_list)
f_fqdn = open("%s/lava_http_fqdn" % workerdir, 'w')
f_fqdn.write(lava_http_fqdn)
f_fqdn.close()
fsettings = open("%s/settings.conf" % workerdir, 'w')
- fsettings.write(template_settings_conf.substitute(cookie_secure=cookie_secure, session_cookie_secure=session_cookie_secure, lava_http_fqdn=lava_http_fqdn))
+ fsettings.write(template_settings_conf.substitute(cookie_secure=cookie_secure, session_cookie_secure=session_cookie_secure, lava_http_fqdn=lava_http_fqdn, allowed_hosts=allowed_hosts))
fsettings.close()
master_use_zmq_auth = False
if "zmq_auth" in worker:
@@ -273,7 +292,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", "lava-coordinator", "use_tap" ]
for keyword in slave:
if not keyword in keywords_slaves:
print("WARNING: unknown keyword %s" % keyword)
@@ -321,6 +340,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"
@@ -387,17 +413,26 @@ def main():
remote_proto = worker["remote_proto"]
remote_uri = "%s://%s:%s@%s:%s/RPC2" % (remote_proto, remote_user, remote_token, remote_address, remote_rpc_port)
dockcomp["services"][worker_name]["environment"]["LAVA_MASTER_URI"] = remote_uri
+ dockcomp["services"][worker_name]["environment"]["LAVA_MASTER_USER"] = remote_user
+ dockcomp["services"][worker_name]["environment"]["LAVA_MASTER_BASEURI"] = "%s://%s:%s/RPC2" % (remote_proto, remote_address, remote_rpc_port)
+ dockcomp["services"][worker_name]["environment"]["LAVA_MASTER_TOKEN"] = remote_token
+ if "lava-coordinator" in worker and worker["lava-coordinator"]:
+ fcoordinator = open("%s/lava-coordinator/lava-coordinator.cnf" % workerdir, 'w')
+ fcoordinator.write(template_lava_coordinator_conf.substitute(masterurl=remote_address))
+ fcoordinator.close()
if "dispatcher_ip" in worker:
dockcomp["services"][worker_name]["environment"]["LAVA_DISPATCHER_IP"] = worker["dispatcher_ip"]
if "expose_ports" in worker:
for eports in worker["expose_ports"]:
dockcomp["services"][name]["ports"].append("%s" % eports)
- if "bind_dev" in worker:
+ if "bind_dev" in worker and worker["bind_dev"]:
dockcomp["services"][worker_name]["volumes"].append("/dev:/dev")
dockcomp["services"][worker_name]["privileged"] = True
- with open(dockcomposeymlpath, 'w') as f:
- yaml.dump(dockcomp, f)
+ if "use_tap" in worker and worker["use_tap"]:
+ dockcomp_add_device(dockcomp, worker_name, "/dev/net/tun:/dev/net/tun")
+ dockcomp["services"][worker_name]["cap_add"] = []
+ dockcomp["services"][worker_name]["cap_add"].append("NET_ADMIN")
if "extra_actions" in worker:
fp = open("%s/scripts/extra_actions" % workerdir, "w")
for eaction in worker["extra_actions"]:
@@ -405,6 +440,33 @@ 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 or not slave["bind_dev"]:
+ 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)
+ with open(dockcomposeymlpath, 'w') as f:
+ yaml.dump(dockcomp, f)
if "loglevel" in worker:
for component in worker["loglevel"]:
if component != "lava-slave":
@@ -461,11 +523,6 @@ def main():
if use_kvm:
dockcomp_add_device(dockcomp, worker_name, "/dev/kvm:/dev/kvm")
# board specific hacks
- use_tap = False
- if "tap" in board:
- use_tap = board["tap"]
- if use_tap:
- dockcomp_add_device(dockcomp, worker_name, "/dev/net/tun:/dev/net/tun")
if devicetype == "qemu" and not use_kvm:
device_line += "{% set no_kvm = True %}\n"
if "uart" in board:
@@ -492,7 +549,7 @@ def main():
fp = open("output/%s/udev/99-lavaworker-udev.rules" % host, "a")
fp.write(udev_line)
fp.close()
- if not "bind_dev" in slave:
+ if not "bind_dev" in slave or not slave["bind_dev"]:
dockcomp_add_device(dockcomp, worker_name, "/dev/%s:/dev/%s" % (board_name, board_name))
use_conmux = False
use_ser2net = False