Merge lp:~linaro-infrastructure/cbuild/cbuild-scheduler_cbuild-lava into lp:~linaro-toolchain-dev/cbuild/scheduler

Proposed by Stevan Radaković
Status: Superseded
Proposed branch: lp:~linaro-infrastructure/cbuild/cbuild-scheduler_cbuild-lava
Merge into: lp:~linaro-toolchain-dev/cbuild/scheduler
Diff against target: 283 lines (+225/-0)
10 files modified
queue/lava-panda-mock/hosts.txt (+1/-0)
queue/lava-panda-mock/lava-job-template.json (+29/-0)
queue/lava-panda-mock/lava-test-shell-template.yaml (+45/-0)
queue/lava-panda/hosts.txt (+1/-0)
queue/lava-panda/lava-job-template_hwpack.json (+29/-0)
queue/lava-panda/lava-job-template_tcwg-image.json (+28/-0)
queue/lava-panda/lava-test-shell-template.yaml (+52/-0)
queue/lava-qemu-minimal/hosts.txt (+1/-0)
queue/lava-qemu-minimal/lava-job-template.json (+27/-0)
queue/lava-qemu-minimal/lava-test-shell-template.yaml (+12/-0)
To merge this branch: bzr merge lp:~linaro-infrastructure/cbuild/cbuild-scheduler_cbuild-lava
Reviewer Review Type Date Requested Status
Linaro Infrastructure Pending
Review via email: mp+142353@code.launchpad.net

Description of the change

This branch include changes in the CBuild scheduler configuration.
Not all of these are viable for merge yet, waiting for infra team review.

To post a comment you must log in.
Revision history for this message
Milo Casagrande (milo) wrote :

Only comment I have is for lines like these:

64 + - apt-get install -y wget
65 + - if grep -q Beagle /proc/cpuinfo; then
66 + - " # if it's supposed QEMU, download from local server"
67 + - url="http://10.0.2.2/images/tmp/gcc-linaro-4.6-2012.09-results.tar.gz"
68 + - else
69 + - url="http://people.linaro.org/~pfalcon/cbuild-lava/gcc-linaro-4.6-2012.09-results.tar.gz"
70 + - fi

I see that there is a mix of syntax: some steps are quoted, some are not. It definitely will work on both cases, it is more from a consistency point of view. Was puzzled actually by how the yaml parser will handle that, but it handles them correctly anyway.

The other thing is including if-else bash structures in the yaml file: can we have a separate bash script and run that one? Or do we need to do other things before it is possible to achieve that: like sending the file to lava, etc. I know it's a couple of lines and is just the template... (oddily we might even move all the steps in a bash script and just execute that one).

Revision history for this message
Stevan Radaković (stevanr) wrote :

> Only comment I have is for lines like these:
>
> 64 + - apt-get install -y wget
> 65 + - if grep -q Beagle /proc/cpuinfo; then
> 66 + - " # if it's supposed QEMU, download from local server"
> 67 + - url="http://10.0.2.2/images/tmp/gcc-
> linaro-4.6-2012.09-results.tar.gz"
> 68 + - else
> 69 + - url="http://people.linaro.org/~pfalcon/cbuild-lava/gcc-
> linaro-4.6-2012.09-results.tar.gz"
> 70 + - fi
>
> I see that there is a mix of syntax: some steps are quoted, some are not. It
> definitely will work on both cases, it is more from a consistency point of
> view. Was puzzled actually by how the yaml parser will handle that, but it
> handles them correctly anyway.

Yes, quoted and unquoted lines are parsed in the same way it seems. It may be logical to remove the quotes from that one line we have for consistency reasons.

>
> The other thing is including if-else bash structures in the yaml file: can we
> have a separate bash script and run that one? Or do we need to do other things
> before it is possible to achieve that: like sending the file to lava, etc. I
> know it's a couple of lines and is just the template... (oddily we might even
> move all the steps in a bash script and just execute that one).

I'm not sure if this can be done, but anyway I fail to see the difference between the current approach and the one you described. Only if we can extract some piece of shell code that would be used in multiple templates scripts would this make sense. But if it makes sense to try and play around with this approach we can certainly do so.

Revision history for this message
Milo Casagrande (milo) wrote :

On Wed, Jan 9, 2013 at 4:41 PM, Stevan Radaković
<email address hidden> wrote:
>> The other thing is including if-else bash structures in the yaml file: can we
>> have a separate bash script and run that one? Or do we need to do other things
>> before it is possible to achieve that: like sending the file to lava, etc. I
>> know it's a couple of lines and is just the template... (oddily we might even
>> move all the steps in a bash script and just execute that one).
>
> I'm not sure if this can be done, but anyway I fail to see the difference between the current approach and the one you described. Only if we can extract some piece of shell code that would be used in multiple templates scripts would this make sense. But if it makes sense to try and play around with this approach we can certainly do so.

Basically, it changes nothing, apart from the re-use point of view.
The only difference I could see is that it looks clumsy to write
multiple lines of bash shell in a yaml-like syntax (that gets
converted into a shell script anyway after that).

--
Milo Casagrande | Infrastructure Team
Linaro.org <www.linaro.org> │ Open source software for ARM SoCs

Revision history for this message
Paul Sokolovsky (pfalcon) wrote :

> I see that there is a mix of syntax: some steps are quoted, some are not. It definitely will work on both cases, it is more from a consistency point of view. Was puzzled actually by how the yaml parser will handle that, but it handles them correctly anyway.

In YAML, string quotes can be omitted, if it can be parsed unambiguously. Yes, to be on safe side (and be consistent) we can quote everything. But that's just character noise which affects readability. So, I'd personally not quoted unless really required (that would be less consistently-looking, but see better than arrays of stray quotes imho). Current content may not adhere to the above is it was cut&pasted originally. If you agree with that idea (quote only if needed), let's fix it.

Revision history for this message
Paul Sokolovsky (pfalcon) wrote :

> The other thing is including if-else bash structures in the yaml file: can we have a separate bash script and run that one?

As oftentimes happens, a viable solution, IMHO, lies somewhere between these these two extremes: 1) put everything in YAML, and 2) host everything in separate repo(s) and pull it from YAML. If we host somewhere elsewhere, there're number of questions to consider: 1) where to host it; 2) how easy it will be to find/change it; 3) how easy to pull it where needed (for example, we could put each small script into own repo, but fetch dozen of repos is boring when doing local test). When there were good answers to those questions, I put it outside, for example "./workaround-multiarch.sh" which is standalone, reusable script. But setup/wrapper code is best in YAML, imho.

Btw, that if you quoted can be removed now - it remnant from previous work (I originally wanted to make a common YAML testdef for all builds, but for flexibility, now they're per queue, and something live in "panda" queue is not supposed to run qemu).

Revision history for this message
Paul Sokolovsky (pfalcon) wrote :

Another semantical (non-cleanup) thing: this waits for Stevan's feedback that build log layout structure as made by lava-panda-mock/lava-test-shell-template.yaml is ok to deal with in cronjob fetcher. If so, it should be propagated into lava-panda/*. In either case, those 2 should be consistent regarding log attaching steps.

Revision history for this message
Milo Casagrande (milo) wrote :

On Thu, Jan 10, 2013 at 2:52 PM, Paul Sokolovsky
<email address hidden> wrote:
> If you agree with that idea (quote only if needed), let's fix it.

For me it's OK.

--
Milo Casagrande | Infrastructure Team
Linaro.org <www.linaro.org> │ Open source software for ARM SoCs

15. By Paul Sokolovsky

Update to use cleaned up build scripts branch.

16. By Paul Sokolovsky

Switch back to known good image, use symlinks for switching.

17. By Paul Sokolovsky

Call workaround-multiarch.sh to simulate production build better.

18. By Paul Sokolovsky

Try empty line in YAML.

19. By Paul Sokolovsky

Update lava build dir and further cleanup.

20. By Paul Sokolovsky

Cannot have empty list elements in YAML shell script after all.

21. By Paul Sokolovsky

Try TCWG image on panda-es.

22. By Paul Sokolovsky

LAVA lab doesn't have panda-es with usb-flash-drive currently, so try w/o.

23. By Paul Sokolovsky

Record logs for real build.

24. By Paul Sokolovsky

Add set -x and explicit start marker.

25. By Milo Casagrande

Create tarball and send it as an attachment.

26. By Paul Sokolovsky

Bump timeout to 15h, as it seems to trigger in testsuite.

27. By Paul Sokolovsky

Re-enable "usb-flash-drive" device tag.

28. By Paul Sokolovsky

Use single log tarball, propagate from lava-panda-mock.

29. By Paul Sokolovsky

Create separate queue for PandaES with Usb Drive.

There's currently one such machine, and if it hangs, the testing blocked.

30. By Paul Sokolovsky

Add hosts.txt for lava-pandaes-usbdrive.

31. By Paul Sokolovsky

Don't tie LAVA testcase names to GCC.

32. By Paul Sokolovsky

Create toplevel.txt the same way as native CBuild does.

33. By Paul Sokolovsky

We also need to pass job content down to builder, as it contains extra config.

34. By Paul Sokolovsky

Debug what's inside .job file produced on build slave.

35. By Paul Sokolovsky

Use dynamic lava_test_shell timeout as calculated by webapp.

36. By Paul Sokolovsky

Cut down global job timeout too.

TODO: Figure out what it actually means.

37. By Paul Sokolovsky

Actually enable USB drive in lava-pandaes-usbdrive.

38. By Paul Sokolovsky

dash strikes again, try to use /bin/echo

39. By Paul Sokolovsky

Settle on using /bin/echo which support -e switch.

40. By Paul Sokolovsky

Record actual build status in lava.

41. By Paul Sokolovsky

Add lava-panda-usbdrive config while lava-pandaes-usbdrive is down.

42. By Paul Sokolovsky

Use standard rootfs/hwpack for lava-panda-usbdrive

43. By Paul Sokolovsky

workaround-multiarch.sh should run after host gcc and libs were installed.

44. By Paul Sokolovsky

Propagate cbuild-global build result handling.

45. By Paul Sokolovsky

Don't create fake configure/build/install test cases for now.

46. By Paul Sokolovsky

Add extra output to debug result outpit dir for LAVA builds.

47. By Paul Sokolovsky

File was renamed. Also, dump hostname early.

48. By Paul Sokolovsky

Rsync is a must.

But how did it work before?

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'queue/lava-panda'
2=== added directory 'queue/lava-panda-mock'
3=== added file 'queue/lava-panda-mock/hosts.txt'
4--- queue/lava-panda-mock/hosts.txt 1970-01-01 00:00:00 +0000
5+++ queue/lava-panda-mock/hosts.txt 2013-01-15 12:59:22 +0000
6@@ -0,0 +1,1 @@
7+lava
8
9=== added file 'queue/lava-panda-mock/lava-job-template.json'
10--- queue/lava-panda-mock/lava-job-template.json 1970-01-01 00:00:00 +0000
11+++ queue/lava-panda-mock/lava-job-template.json 2013-01-15 12:59:22 +0000
12@@ -0,0 +1,29 @@
13+{
14+ "timeout": 1800,
15+ "job_name": "%(job)s",
16+ "device_type": "panda",
17+ "device_tags": ["usb-flash-drive"],
18+ "actions": [
19+ {
20+ "command": "deploy_linaro_image",
21+ "parameters": {
22+ "rootfs": "http://releases.linaro.org/12.02/ubuntu/oneiric-images/nano/linaro-o-nano-tar-20120221-0.tar.gz",
23+ "hwpack": "http://releases.linaro.org/12.02/ubuntu/oneiric-images/nano/hwpack_linaro-lt-panda_20120221-1_armel_supported.tar.gz"
24+ }
25+ },
26+ {
27+ "command": "lava_test_shell",
28+ "parameters": {
29+ "testdef_urls": ["http://%(SERVER_NAME)s:%(SERVER_PORT)s/helpers/scheduler/lava/testdef/%(queue)s/%(job)s"],
30+ "timeout": 36000
31+ }
32+ },
33+ {
34+ "command": "submit_results",
35+ "parameters": {
36+ "stream": "/anonymous/cbuild/",
37+ "server": "https://validation.linaro.org/lava-server/RPC2/"
38+ }
39+ }
40+ ]
41+}
42
43=== added file 'queue/lava-panda-mock/lava-test-shell-template.yaml'
44--- queue/lava-panda-mock/lava-test-shell-template.yaml 1970-01-01 00:00:00 +0000
45+++ queue/lava-panda-mock/lava-test-shell-template.yaml 2013-01-15 12:59:22 +0000
46@@ -0,0 +1,45 @@
47+metadata:
48+ format: "Lava-Test Test Definition 1.0"
49+ name: "%(job)s"
50+
51+install:
52+ deps:
53+ - bzr
54+ git-repos:
55+ - git://git.linaro.org/people/davelong/lt_ti_lava.git
56+ steps:
57+ - echo In Install
58+ - lt_ti_lava/utils/lava-usb-drive.sh /dev/sda
59+ - mkdir -p cbuild-lava
60+ - mount /dev/sda1 cbuild-lava
61+ - df
62+ - bzr branch --use-existing-dir lp:~linaro-infrastructure/cbuild/cbuild-lava2 cbuild-lava
63+ - cd cbuild-lava/slaves/lava
64+ #- Can't run workaround-multiarch.sh because we don't have gcc installed
65+ #- ./workaround-multiarch.sh
66+
67+ #- Mock build core, download tarball of previously done build
68+ #- and expand it to expected place.
69+ - apt-get install -y wget
70+ - if grep -q Beagle /proc/cpuinfo; then
71+ - " # if it's supposed QEMU, download from local server"
72+ - url="http://10.0.2.2/images/tmp/gcc-linaro-4.6-2012.09-results.tar.gz"
73+ - else
74+ - url="http://people.linaro.org/~pfalcon/cbuild-lava/gcc-linaro-4.6-2012.09-results.tar.gz"
75+ - fi
76+ - wget -q -O- $url | gzip -d -c | tar -x
77+
78+run:
79+ steps:
80+ - set -x
81+ - echo In run
82+ - cd cbuild-lava/slaves/lava
83+ #- make -f ../../lib/build.mk final/gcc-linaro-4.6-2012.09.stamp
84+ - echo CBuild make finished, attaching logs to LAVA results
85+ - lava-test-case gcc-configure --result pass
86+ - lava-test-case gcc-build --result pass
87+ - lava-test-case gcc-install --result pass
88+ - lava-test-case cbuild-global --result pass
89+ - tar -cf cbuild-global.tar.gz -z --atime-preserve -C results/build/*/logs/* .
90+ - lava-test-case-attach cbuild-global cbuild-global.tar.gz
91+ - echo Attaching logs done
92
93=== added file 'queue/lava-panda/hosts.txt'
94--- queue/lava-panda/hosts.txt 1970-01-01 00:00:00 +0000
95+++ queue/lava-panda/hosts.txt 2013-01-15 12:59:22 +0000
96@@ -0,0 +1,1 @@
97+lava
98
99=== added symlink 'queue/lava-panda/lava-job-template.json'
100=== target is u'lava-job-template_tcwg-image.json'
101=== added file 'queue/lava-panda/lava-job-template_hwpack.json'
102--- queue/lava-panda/lava-job-template_hwpack.json 1970-01-01 00:00:00 +0000
103+++ queue/lava-panda/lava-job-template_hwpack.json 2013-01-15 12:59:22 +0000
104@@ -0,0 +1,29 @@
105+{
106+ "timeout": 1800,
107+ "job_name": "%(job)s",
108+ "device_type": "panda",
109+ "device_tags": ["usb-flash-drive"],
110+ "actions": [
111+ {
112+ "command": "deploy_linaro_image",
113+ "parameters": {
114+ "rootfs": "http://releases.linaro.org/12.02/ubuntu/oneiric-images/nano/linaro-o-nano-tar-20120221-0.tar.gz",
115+ "hwpack": "http://releases.linaro.org/12.02/ubuntu/oneiric-images/nano/hwpack_linaro-lt-panda_20120221-1_armel_supported.tar.gz"
116+ }
117+ },
118+ {
119+ "command": "lava_test_shell",
120+ "parameters": {
121+ "testdef_urls": ["http://%(SERVER_NAME)s:%(SERVER_PORT)s/helpers/scheduler/lava/testdef/%(queue)s/%(job)s"],
122+ "timeout": 36000
123+ }
124+ },
125+ {
126+ "command": "submit_results",
127+ "parameters": {
128+ "stream": "/anonymous/cbuild/",
129+ "server": "https://validation.linaro.org/lava-server/RPC2/"
130+ }
131+ }
132+ ]
133+}
134
135=== added file 'queue/lava-panda/lava-job-template_tcwg-image.json'
136--- queue/lava-panda/lava-job-template_tcwg-image.json 1970-01-01 00:00:00 +0000
137+++ queue/lava-panda/lava-job-template_tcwg-image.json 2013-01-15 12:59:22 +0000
138@@ -0,0 +1,28 @@
139+{
140+ "timeout": 1800,
141+ "job_name": "%(job)s",
142+ "device_type": "panda-es",
143+ "device_tags": [],
144+ "actions": [
145+ {
146+ "command": "deploy_linaro_image",
147+ "parameters": {
148+ "image": "http://people.linaro.org/~pfalcon/cbuild-lava/cbuild-auto-build-precise-r1-ascii.img.gz"
149+ }
150+ },
151+ {
152+ "command": "lava_test_shell",
153+ "parameters": {
154+ "testdef_urls": ["http://%(SERVER_NAME)s:%(SERVER_PORT)s/helpers/scheduler/lava/testdef/%(queue)s/%(job)s"],
155+ "timeout": 36000
156+ }
157+ },
158+ {
159+ "command": "submit_results",
160+ "parameters": {
161+ "stream": "/anonymous/cbuild/",
162+ "server": "https://validation.linaro.org/lava-server/RPC2/"
163+ }
164+ }
165+ ]
166+}
167
168=== added file 'queue/lava-panda/lava-test-shell-template.yaml'
169--- queue/lava-panda/lava-test-shell-template.yaml 1970-01-01 00:00:00 +0000
170+++ queue/lava-panda/lava-test-shell-template.yaml 2013-01-15 12:59:22 +0000
171@@ -0,0 +1,52 @@
172+metadata:
173+ format: "Lava-Test Test Definition 1.0"
174+ name: "%(job)s"
175+
176+install:
177+ deps:
178+ - bzr
179+ git-repos:
180+ - git://git.linaro.org/people/davelong/lt_ti_lava.git
181+ steps:
182+ - echo In Install
183+ - apt-get update
184+ # LAVA lab doesn't have panda-es with usb-flash-drive currently
185+ #- lt_ti_lava/utils/lava-usb-drive.sh /dev/sda
186+ #- mkdir -p cbuild-lava
187+ #- mount /dev/sda1 cbuild-lava
188+ #- df
189+
190+ # LAVA Debugging
191+ #- apt-get install -y openssh-server
192+
193+ #- Fetch build script first for "fail fast" approach
194+ - bzr branch --use-existing-dir lp:~linaro-infrastructure/cbuild/cbuild-lava2 cbuild-lava
195+ - cd cbuild-lava/slaves/lava
196+ - ./workaround-multiarch.sh
197+
198+ #- Install build dependencies
199+ #- apt-get install -y build-essential gdb lsb-release time python-irclib wget gnupg ccrypt rsync coreutils sendemail bzr xdelta3 xz-utils unzip openssh-client libio-socket-ssl-perl libnet-ssleay-perl
200+ - apt-get install -y build-essential gdb lsb-release time wget coreutils bzr xz-utils unzip openssh-client
201+ #- apt-get build-dep -y gcc gcc-4.5 gdb eglibc
202+ - apt-get build-dep -y gcc gcc-4.5
203+
204+run:
205+ steps:
206+ - set -x
207+ - echo In Run
208+ - cd cbuild-lava/slaves/lava
209+ - make -f ../../lib/build.mk final/%(job)s.stamp
210+ - echo CBuild make finished, attaching logs to LAVA results
211+ - lava-test-case gcc-configure --result pass
212+ - lava-test-case gcc-build --result pass
213+ - lava-test-case gcc-install --result pass
214+ - lava-test-case cbuild-global --result pass
215+ - lava-test-case-attach gcc-configure results/build/*/logs/*/gcc-configure.txt
216+ - lava-test-case-attach gcc-build results/build/*/logs/*/gcc-build.txt
217+ - lava-test-case-attach gcc-install results/build/*/logs/*/gcc-install.txt
218+ - lava-test-case-attach cbuild-global results/build/*/logs/*/gcc-build.time
219+ - lava-test-case-attach cbuild-global results/build/*/logs/*/gcc-archive.time
220+ - lava-test-case-attach cbuild-global results/build/*/logs/*/host.txt
221+ - lava-test-case-attach cbuild-global results/build/*/logs/*/md5sums.txt
222+ - lava-test-case-attach cbuild-global results/build/*/logs/*/finished.txt
223+ - echo Attaching logs done
224
225=== added directory 'queue/lava-qemu-minimal'
226=== added file 'queue/lava-qemu-minimal/hosts.txt'
227--- queue/lava-qemu-minimal/hosts.txt 1970-01-01 00:00:00 +0000
228+++ queue/lava-qemu-minimal/hosts.txt 2013-01-15 12:59:22 +0000
229@@ -0,0 +1,1 @@
230+lava
231
232=== added file 'queue/lava-qemu-minimal/lava-job-template.json'
233--- queue/lava-qemu-minimal/lava-job-template.json 1970-01-01 00:00:00 +0000
234+++ queue/lava-qemu-minimal/lava-job-template.json 2013-01-15 12:59:22 +0000
235@@ -0,0 +1,27 @@
236+{
237+ "timeout": 1800,
238+ "job_name": "%(job)s",
239+ "device_type": "qemu",
240+ "actions": [
241+ {
242+ "command": "deploy_linaro_image",
243+ "parameters": {
244+ "image": "file:///tmp/lava/beagle-nano.img.gz"
245+ }
246+ },
247+ {
248+ "command": "lava_test_shell",
249+ "parameters": {
250+ "testdef_urls": ["http://%(SERVER_NAME)s:%(SERVER_PORT)s/helpers/scheduler/lava/testdef/%(queue)s/%(job)s"],
251+ "timeout": 36000
252+ }
253+ },
254+ {
255+ "command": "submit_results",
256+ "parameters": {
257+ "stream": "/anonymous/cbuild/",
258+ "server": "http://localhost/cbuild/RPC2/"
259+ }
260+ }
261+ ]
262+}
263
264=== added file 'queue/lava-qemu-minimal/lava-test-shell-template.yaml'
265--- queue/lava-qemu-minimal/lava-test-shell-template.yaml 1970-01-01 00:00:00 +0000
266+++ queue/lava-qemu-minimal/lava-test-shell-template.yaml 2013-01-15 12:59:22 +0000
267@@ -0,0 +1,12 @@
268+metadata:
269+ format: "Lava-Test Test Definition 1.0"
270+ name: "%(job)s"
271+
272+install:
273+ bzr-repos:
274+ - lp:~linaro-infrastructure/cbuild/cbuild-lava2
275+ steps:
276+ - echo In Install for job %(job)s
277+run:
278+ steps:
279+ - echo In run for job %(job)s
280
281=== added directory 'spawn/lava-test'
282=== added symlink 'spawn/lava-test/lava-qemu-minimal'
283=== target is u'../../queue/lava-qemu-minimal'

Subscribers

People subscribed via source and target branches