summaryrefslogtreecommitdiffstats
path: root/lava-master
diff options
context:
space:
mode:
Diffstat (limited to 'lava-master')
-rw-r--r--lava-master/Dockerfile18
-rwxr-xr-xlava-master/entrypoint.d/01_setup.sh (renamed from lava-master/scripts/setup.sh)1
-rwxr-xr-xlava-master/scripts/start.sh38
3 files changed, 15 insertions, 42 deletions
diff --git a/lava-master/Dockerfile b/lava-master/Dockerfile
index 80da8fb..625ebf1 100644
--- a/lava-master/Dockerfile
+++ b/lava-master/Dockerfile
@@ -1,4 +1,6 @@
-FROM baylibre/lava-master-base:2019.03_stretch
+FROM lavasoftware/lava-server:2019.07
+
+RUN apt-get update && apt-get -y install sudo lava-coordinator git
COPY backup /root/backup/
@@ -15,8 +17,7 @@ COPY device-types/ /root/device-types/
COPY users/ /root/lava-users/
COPY groups/ /root/lava-groups/
COPY tokens/ /root/lava-callback-tokens/
-COPY scripts/setup.sh /
-COPY scripts/start.sh /
+COPY entrypoint.d/*sh /root/entrypoint.d/
COPY settings.conf /etc/lava-server/
@@ -33,9 +34,18 @@ COPY zmq_auth/ /etc/lava-dispatcher/certificates.d/
COPY lava_http_fqdn /root/
COPY env/ /etc/lava-server/dispatcher.d/
+RUN chown -R lavaserver:lavaserver /etc/lava-server/dispatcher.d/
COPY apache2/ /etc/apache2/
+# Fixes 'postgresql ERROR: invalid locale name: "en_US.UTF-8"' when restoring a backup
+RUN echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen && locale-gen en_US.UTF-8
+
+# TODO: send this fix to upstream
+RUN sed -i 's,find /root/entrypoint.d/ -type f,find /root/entrypoint.d/ -type f | sort,' /root/entrypoint.sh
+# TODO: send this fix to upstream
+RUN sed -i 's,pidfile =.*,pidfile = "/run/lava-coordinator/lava-coordinator.pid",' /usr/bin/lava-coordinator
+
EXPOSE 3079 5555 5556
-CMD /start.sh && while [ true ];do sleep 365d; done
+CMD /root/entrypoint.sh && while [ true ];do sleep 365d; done
diff --git a/lava-master/scripts/setup.sh b/lava-master/entrypoint.d/01_setup.sh
index 489dd51..be950b7 100755
--- a/lava-master/scripts/setup.sh
+++ b/lava-master/entrypoint.d/01_setup.sh
@@ -156,6 +156,7 @@ if [ -e /root/device-types ];then
diff -u "/etc/lava-server/dispatcher-config/device-types/$(basename $i)" $i
fi
cp $i /etc/lava-server/dispatcher-config/device-types/
+ chown lavaserver:lavaserver /etc/lava-server/dispatcher-config/device-types/$(basename $i)
devicetype=$(basename $i |sed 's,.jinja2,,')
lava-server manage device-types list | grep -q "[[:space:]]$devicetype[[:space:]]"
if [ $? -eq 0 ];then
diff --git a/lava-master/scripts/start.sh b/lava-master/scripts/start.sh
deleted file mode 100755
index ce94c39..0000000
--- a/lava-master/scripts/start.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/bash
-
-postgres-ready () {
- echo "Waiting for lavaserver database to be active"
- while (( $(ps -ef | grep -v grep | grep postgres | grep lavaserver | wc -l) == 0 ))
- do
- echo -n "."
- sleep 1
- done
- echo
- echo "[ ok ] LAVA server ready"
-}
-
-start () {
- echo "Starting $1"
- if (( $(ps -ef | grep -v grep | grep -v add_device | grep -v dispatcher-config | grep "$1" | wc -l) > 0 ))
- then
- echo "$1 appears to be running"
- else
- service "$1" start
- fi
-}
-
-#remove lava-pid files incase the image is stored without first stopping the services
-rm -f /var/run/lava-*.pid 2> /dev/null
-
-/etc/init.d/postgresql start
-
-/setup.sh || exit $?
-
-start apache2 || exit $?
-start lava-logs || exit $?
-start lava-master || exit $?
-start lava-coordinator || exit $?
-start lava-server-gunicorn || exit $?
-
-postgres-ready
-service apache2 reload #added after the website not running a few times on boot