aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xlava/dispatcher/build.sh44
-rwxr-xr-xlava/dispatcher/entrypoint.sh (renamed from lava/dispatcher/production/stretch-amd64/entrypoint.sh)18
-rw-r--r--lava/dispatcher/production/stretch-amd64/Dockerfile6
-rwxr-xr-xlava/dispatcher/production/stretch-amd64/build.sh19
-rw-r--r--lava/dispatcher/staging/stretch-amd64/Dockerfile46
5 files changed, 97 insertions, 36 deletions
diff --git a/lava/dispatcher/build.sh b/lava/dispatcher/build.sh
new file mode 100755
index 00000000..50cab78e
--- /dev/null
+++ b/lava/dispatcher/build.sh
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+# An example invocation of this script would be:
+#
+# ./build.sh -r production -d stretch -a amd64
+
+set -e
+
+export LANG=C
+
+while getopts "r:d:a:" opt; do
+ case $opt in
+ r)
+ REPO="$OPTARG"
+ ;;
+ d)
+ DISTRIBUTION="$OPTARG"
+ ;;
+ a)
+ ARCH="$OPTARG"
+ ;;
+ ?)
+ echo "Usage:"
+ echo "-r - repository such as production or staging"
+ echo "-d - distribution such as stretch"
+ echo "-a - architecture such as amd64"
+ exit 1
+ ;;
+ esac
+done
+
+if [ "$REPO" = staging ]; then
+ VERSION="latest"
+else
+ # Get version by parsing Packages file from respective repo.
+ VERSION=$(wget -qO - http://images.validation.linaro.org/${REPO}-repo/dists/${DISTRIBUTION}-backports/main/binary-${ARCH}/Packages \
+ | grep -A5 '^Package: lava-dispatcher' | grep '^Version: ' \
+ | awk '{ print $2 }' \
+ | sed 's/[~|+].*//')
+fi
+
+image=linaro/lava-dispatcher-${REPO}-${DISTRIBUTION}-${ARCH}:${VERSION}
+docker build --no-cache --pull --tag=$image -f ${REPO}/${DISTRIBUTION}-${ARCH}/Dockerfile .
+echo $image > .docker-tag
diff --git a/lava/dispatcher/production/stretch-amd64/entrypoint.sh b/lava/dispatcher/entrypoint.sh
index 74bc9c7e..490f236e 100755
--- a/lava/dispatcher/production/stretch-amd64/entrypoint.sh
+++ b/lava/dispatcher/entrypoint.sh
@@ -23,9 +23,6 @@
# LOG_LEVEL Log level (DEBUG, ERROR, INFO, WARN); default to INFO
# Example: LOG_LEVEL='DEBUG'
#
-# TIMEOUT Socket connection timeout in seconds; default to 5
-# Example: TIMEOUT=10
-#
# IPV6 Enable IPv6
# Example: IPV6=True
#
@@ -69,11 +66,6 @@ then
LOG_LEVEL='INFO'
fi
-if [ -z "${TIMEOUT}" ]
-then
- TIMEOUT=5
-fi
-
if [ -z "${ENCRYPT}" ]
then
ENCRYPT=''
@@ -104,12 +96,10 @@ fi
echo "Starting lava-slave with the following command:"
-echo "/usr/bin/python /usr/bin/lava-slave --hostname ${HOSTNAME} \
+echo "/usr/bin/python3 /usr/bin/lava-slave --hostname ${HOSTNAME} \
--master ${MASTER} --socket-addr ${SOCKET_ADDR} ${LOG_FILE} \
---level ${LOG_LEVEL} --timeout ${TIMEOUT} ${ENCRYPT} ${IPV6} \
-${MASTER_CERT} ${SLAVE_CERT}"
+--level ${LOG_LEVEL} ${ENCRYPT} ${IPV6} ${MASTER_CERT} ${SLAVE_CERT}"
-/usr/bin/python /usr/bin/lava-slave --hostname ${HOSTNAME} \
+/usr/bin/python3 /usr/bin/lava-slave --hostname ${HOSTNAME} \
--master ${MASTER} --socket-addr ${SOCKET_ADDR} ${LOG_FILE} \
---level ${LOG_LEVEL} --timeout ${TIMEOUT} ${ENCRYPT} ${IPV6} \
-${MASTER_CERT} ${SLAVE_CERT}
+--level ${LOG_LEVEL} ${ENCRYPT} ${IPV6} ${MASTER_CERT} ${SLAVE_CERT}
diff --git a/lava/dispatcher/production/stretch-amd64/Dockerfile b/lava/dispatcher/production/stretch-amd64/Dockerfile
index c555a9b8..4fc9110f 100644
--- a/lava/dispatcher/production/stretch-amd64/Dockerfile
+++ b/lava/dispatcher/production/stretch-amd64/Dockerfile
@@ -2,7 +2,7 @@ FROM debian:stretch
# Docker image for LAVA dispatcher with production release.
-MAINTAINER Senthil Kumaran S <senthil.kumaran@linaro.org>
+LABEL maintainer="senthil.kumaran@linaro.org"
# Install the required dependencies
RUN echo 'locales locales/locales_to_be_generated multiselect C.UTF-8 UTF-8, en_US.UTF-8 UTF-8 ' | debconf-set-selections && \
@@ -25,7 +25,7 @@ RUN echo 'locales locales/locales_to_be_generated multiselect C.UTF-8 UTF-8, en_
export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get -y upgrade && \
- apt-get -y -t stretch-backports install lava-dispatcher \
+ apt-get -y -t stretch-backports install lava-common lava-dispatcher \
lava-lxc-mocker && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
@@ -34,7 +34,7 @@ RUN echo 'locales locales/locales_to_be_generated multiselect C.UTF-8 UTF-8, en_
EXPOSE 22
# Set entrypoint script
-COPY entrypoint.sh /entrypoint.sh
+COPY ./entrypoint.sh /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]
# Following is a sample docker run command to use this image
diff --git a/lava/dispatcher/production/stretch-amd64/build.sh b/lava/dispatcher/production/stretch-amd64/build.sh
deleted file mode 100755
index d7f69b33..00000000
--- a/lava/dispatcher/production/stretch-amd64/build.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-
-set -e
-
-export LANG=C
-
-DISTRIBUTION=$(basename ${PWD} | cut -f1 -d '-')
-ARCHITECTURE=$(basename ${PWD} | cut -f2 -d '-')
-REPO=$(basename $(dirname ${PWD}))
-
-# Get version by parsing Packages file from respective repo.
-VERSION=$(wget -qO - http://images.validation.linaro.org/${REPO}-repo/dists/${DISTRIBUTION}-backports/main/binary-${ARCHITECTURE}/Packages \
- | grep -A5 '^Package: lava-dispatcher' | grep '^Version: ' \
- | awk '{ print $2 }' \
- | sed 's/[~|+].*//')
-
-image=linaro/lava-dispatcher-debian-${DISTRIBUTION}-${ARCHITECTURE}:${VERSION}
-docker build --no-cache --pull --tag=$image .
-echo $image > .docker-tag
diff --git a/lava/dispatcher/staging/stretch-amd64/Dockerfile b/lava/dispatcher/staging/stretch-amd64/Dockerfile
new file mode 100644
index 00000000..f3108f3a
--- /dev/null
+++ b/lava/dispatcher/staging/stretch-amd64/Dockerfile
@@ -0,0 +1,46 @@
+FROM debian:stretch
+
+# Docker image for LAVA dispatcher with master branch, built daily.
+
+LABEL maintainer="senthil.kumaran@linaro.org"
+
+# Install the required dependencies
+RUN 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 && \
+ export DEBIAN_FRONTEND=noninteractive && \
+ apt-get update && \
+ apt-get -y upgrade && \
+ apt-get -y install ntp git tftpd-hpa openbsd-inetd ser2net qemu-kvm \
+ qemu-system-x86 qemu-system-arm qemu-user-static libguestfs-tools \
+ nfs-kernel-server rpcbind u-boot-tools unzip xz-utils debootstrap \
+ bridge-utils dfu-util img2simg emacs-nox vim gnupg2 sed expect grep wget \
+ openssh-server
+
+# Add LAVA stretch-backports production repo
+RUN wget -qO - http://images.validation.linaro.org/production-repo/production-repo.key.asc | apt-key add - && \
+ echo "deb http://images.validation.linaro.org/production-repo stretch-backports main" >/etc/apt/sources.list.d/linaro.list
+
+RUN 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 && \
+ export DEBIAN_FRONTEND=noninteractive && \
+ apt-get update && \
+ apt-get -y upgrade && \
+ apt-get -y -t stretch-backports install lava-common lava-dispatcher \
+ lava-lxc-mocker && \
+ apt-get clean && \
+ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
+
+# Expose services ports
+EXPOSE 22
+
+# Set entrypoint script
+COPY ./entrypoint.sh /entrypoint.sh
+ENTRYPOINT [ "/entrypoint.sh" ]
+
+# Following is a sample docker run command to use this image
+#
+# sudo docker run -v /boot:/boot -v /lib/modules:/lib/modules \
+# -v /var/run/docker.sock:/var/run/docker.sock -itd -e HOSTNAME='worker-1' \
+# -e MASTER='tcp://192.168.1.2:5556' -e SOCKET_ADDR='tcp://192.168.1.2:5555' \
+# -e LOG_LEVEL='DEBUG' -p 2222:22 --privileged \
+# --name ld-2017.12 stylesen/lava-dispatcher:2017.12