aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan-Simon Möller <dl9pf@gmx.de>2016-07-15 16:19:46 +0200
committerJan-Simon Möller <dl9pf@gmx.de>2016-07-24 17:47:13 +0200
commit26053f2f2243fdbefaccb3ee500388ad1d9b594a (patch)
treead6e52747893251d5108f2bae4aa6253e76ffc39
parent4a10cbfb1bf676e77b938371f5cfd2d5c4869030 (diff)
WIP integrate lava-boot for CIAT.lava_deploy.snapshots/jansimon/ciatsandbox/jsmoeller/lava
Change-Id: I46801ddd7baec6f23fcaaf2036e094289f94896a Signed-off-by: Jan-Simon Möller <dl9pf@gmx.de>
-rw-r--r--Dockerfile22
-rw-r--r--userdata/conf/.lava.yaml0
-rw-r--r--userdata/conf/boardready.py59
3 files changed, 78 insertions, 3 deletions
diff --git a/Dockerfile b/Dockerfile
index cdb592f..3ac5613 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -19,12 +19,15 @@ RUN dpkg --add-architecture i386
#RUN echo deb http://mirrors.163.com/debian/ jessie-updates main non-free >> /etc/apt/sources.list
RUN echo deb http://ftp.us.debian.org/debian jessie main non-free >> /etc/apt/sources.list
RUN echo deb http://ftp.us.debian.org/debian jessie-updates main non-free >> /etc/apt/sources.list
-RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get -yV install apt-utils daemon gcc make python-paramiko python-lxml python-simplejson python-matplotlib libtool xmlstarlet autoconf automake rsync openjdk-7-jre openjdk-7-jdk iperf netperf netpipe-tcp texlive-latex-base sshpass wget git sudo net-tools vim openssh-server curl bzip2
+RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get -yV install apt-utils daemon gcc make python-paramiko python-lxml python-simplejson python-matplotlib libtool xmlstarlet autoconf automake rsync openjdk-7-jre openjdk-7-jdk iperf netperf netpipe-tcp texlive-latex-base sshpass wget git sudo net-tools vim openssh-server curl bzip2 wget
+RUN wget -q -O - http://pkg.jenkins.io/debian/jenkins.io.key | apt-key add -
+RUN echo deb http://pkg.jenkins.io/debian binary/ >> /etc/apt/sources.list
+RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get -yV install jenkins
RUN /bin/bash -c 'echo "dash dash/sh boolean false" | debconf-set-selections ; DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash'
#COPY frontend-install/jenkins_1.509.2_all.deb /jta-install/
#RUN dpkg -i /jta-install/jenkins_1.509.2_all.deb
-COPY frontend-install/jenkins_1.642.4_all.deb /jta-install/
-RUN dpkg -i /jta-install/jenkins_1.642.4_all.deb
+#COPY frontend-install/jenkins_1.642.4_all.deb /jta-install/
+#RUN dpkg -i /jta-install/jenkins_1.642.4_all.deb
RUN /bin/bash -c 'wget -nv "http://downloads.sourceforge.net/project/getfo/texml/texml-2.0.2/texml-2.0.2.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fgetfo%2F&ts=1398789654&use_mirror=sunet" -O texml.tar.gz ; tar xvf texml.tar.gz; cd texml-2.0.2 ; python setup.py install; cd -'
# ==============================================================================
@@ -44,6 +47,19 @@ COPY frontend-install/jenkins.cfg /etc/default/jenkins
COPY docs $INST_JTA_FRONTEND_PATH/userContent/docs/
# ==============================================================================
+# get LAVA-boot via git
+# ==============================================================================
+
+RUN mkdir -p $INST_JTA_ENGINE_PATH
+RUN git clone https://git.linaro.org/people/riku.voipio/lava-boot.git $INST_JTA_ENGINE_PATH/lava-boot
+RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get -yV install python-requests python-yaml
+#COPY .lava.yaml template
+RUN ln -s /userdata/conf/.lava.yaml $INST_JTA_ENGINE_PATH/.lava.yaml
+#COPY boardready.py
+RUN ln -s /userdata/conf/boardready.py $INST_JTA_ENGINE_PATH/boardready.py
+
+
+# ==============================================================================
# Init userdata
# ==============================================================================
diff --git a/userdata/conf/.lava.yaml b/userdata/conf/.lava.yaml
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/userdata/conf/.lava.yaml
diff --git a/userdata/conf/boardready.py b/userdata/conf/boardready.py
new file mode 100644
index 0000000..ad3ddf5
--- /dev/null
+++ b/userdata/conf/boardready.py
@@ -0,0 +1,59 @@
+#!/usr/bin/python
+
+import xmlrpclib
+import ssl
+import sys
+import time
+# bug, ssl chain cannot be verified (letsencrypt)
+ssl._create_default_https_context = ssl._create_unverified_context
+
+#server = xmlrpclib.ServerProxy("https://porter.agl.homelinux.org/RPC2")
+
+print "Starting ..."
+sys.stdout.flush()
+
+arg = None
+
+if len(sys.argv) > 1:
+ arg = sys.argv[1]
+
+if arg == None:
+ print("No argument, need lava jobnumber as argument.")
+ sys.exit(1)
+
+username = "FILL-IN-USERNAME"
+token = "FILL-IN-TOKEN"
+hostname = "porter.agl.homelinux.org"
+
+server = xmlrpclib.ServerProxy("https://%s:%s@%s/RPC2" % (username, token, hostname))
+
+#print(arg)
+#sys.stdout.flush()
+
+# Poll loop
+while True:
+ try:
+ x = server.scheduler.job_status(arg)['job_status']
+ except:
+ print("Error, quitting.")
+ sys.stdout.flush()
+ break
+ if 'Submitted' in x:
+ print("Job submitted - pending")
+ sys.stdout.flush()
+ time.sleep(20)
+ continue
+ if 'Running' in x:
+ print("Job Running now.")
+ print("Remote boot takes around 6 minutes to complete ...")
+ sys.stdout.flush()
+ time.sleep(360)
+ y = server.scheduler.job_status(arg)['job_status']
+ if 'Running' in y:
+ break
+ else:
+ continue
+ break
+ break
+
+# end \ No newline at end of file