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
=== added directory 'queue/lava-panda'
=== added directory 'queue/lava-panda-mock'
=== added file 'queue/lava-panda-mock/hosts.txt'
--- queue/lava-panda-mock/hosts.txt 1970-01-01 00:00:00 +0000
+++ queue/lava-panda-mock/hosts.txt 2013-01-15 12:59:22 +0000
@@ -0,0 +1,1 @@
1lava
02
=== added file 'queue/lava-panda-mock/lava-job-template.json'
--- queue/lava-panda-mock/lava-job-template.json 1970-01-01 00:00:00 +0000
+++ queue/lava-panda-mock/lava-job-template.json 2013-01-15 12:59:22 +0000
@@ -0,0 +1,29 @@
1{
2 "timeout": 1800,
3 "job_name": "%(job)s",
4 "device_type": "panda",
5 "device_tags": ["usb-flash-drive"],
6 "actions": [
7 {
8 "command": "deploy_linaro_image",
9 "parameters": {
10 "rootfs": "http://releases.linaro.org/12.02/ubuntu/oneiric-images/nano/linaro-o-nano-tar-20120221-0.tar.gz",
11 "hwpack": "http://releases.linaro.org/12.02/ubuntu/oneiric-images/nano/hwpack_linaro-lt-panda_20120221-1_armel_supported.tar.gz"
12 }
13 },
14 {
15 "command": "lava_test_shell",
16 "parameters": {
17 "testdef_urls": ["http://%(SERVER_NAME)s:%(SERVER_PORT)s/helpers/scheduler/lava/testdef/%(queue)s/%(job)s"],
18 "timeout": 36000
19 }
20 },
21 {
22 "command": "submit_results",
23 "parameters": {
24 "stream": "/anonymous/cbuild/",
25 "server": "https://validation.linaro.org/lava-server/RPC2/"
26 }
27 }
28 ]
29}
030
=== added file 'queue/lava-panda-mock/lava-test-shell-template.yaml'
--- queue/lava-panda-mock/lava-test-shell-template.yaml 1970-01-01 00:00:00 +0000
+++ queue/lava-panda-mock/lava-test-shell-template.yaml 2013-01-15 12:59:22 +0000
@@ -0,0 +1,45 @@
1metadata:
2 format: "Lava-Test Test Definition 1.0"
3 name: "%(job)s"
4
5install:
6 deps:
7 - bzr
8 git-repos:
9 - git://git.linaro.org/people/davelong/lt_ti_lava.git
10 steps:
11 - echo In Install
12 - lt_ti_lava/utils/lava-usb-drive.sh /dev/sda
13 - mkdir -p cbuild-lava
14 - mount /dev/sda1 cbuild-lava
15 - df
16 - bzr branch --use-existing-dir lp:~linaro-infrastructure/cbuild/cbuild-lava2 cbuild-lava
17 - cd cbuild-lava/slaves/lava
18 #- Can't run workaround-multiarch.sh because we don't have gcc installed
19 #- ./workaround-multiarch.sh
20
21 #- Mock build core, download tarball of previously done build
22 #- and expand it to expected place.
23 - apt-get install -y wget
24 - if grep -q Beagle /proc/cpuinfo; then
25 - " # if it's supposed QEMU, download from local server"
26 - url="http://10.0.2.2/images/tmp/gcc-linaro-4.6-2012.09-results.tar.gz"
27 - else
28 - url="http://people.linaro.org/~pfalcon/cbuild-lava/gcc-linaro-4.6-2012.09-results.tar.gz"
29 - fi
30 - wget -q -O- $url | gzip -d -c | tar -x
31
32run:
33 steps:
34 - set -x
35 - echo In run
36 - cd cbuild-lava/slaves/lava
37 #- make -f ../../lib/build.mk final/gcc-linaro-4.6-2012.09.stamp
38 - echo CBuild make finished, attaching logs to LAVA results
39 - lava-test-case gcc-configure --result pass
40 - lava-test-case gcc-build --result pass
41 - lava-test-case gcc-install --result pass
42 - lava-test-case cbuild-global --result pass
43 - tar -cf cbuild-global.tar.gz -z --atime-preserve -C results/build/*/logs/* .
44 - lava-test-case-attach cbuild-global cbuild-global.tar.gz
45 - echo Attaching logs done
046
=== added file 'queue/lava-panda/hosts.txt'
--- queue/lava-panda/hosts.txt 1970-01-01 00:00:00 +0000
+++ queue/lava-panda/hosts.txt 2013-01-15 12:59:22 +0000
@@ -0,0 +1,1 @@
1lava
02
=== added symlink 'queue/lava-panda/lava-job-template.json'
=== target is u'lava-job-template_tcwg-image.json'
=== added file 'queue/lava-panda/lava-job-template_hwpack.json'
--- queue/lava-panda/lava-job-template_hwpack.json 1970-01-01 00:00:00 +0000
+++ queue/lava-panda/lava-job-template_hwpack.json 2013-01-15 12:59:22 +0000
@@ -0,0 +1,29 @@
1{
2 "timeout": 1800,
3 "job_name": "%(job)s",
4 "device_type": "panda",
5 "device_tags": ["usb-flash-drive"],
6 "actions": [
7 {
8 "command": "deploy_linaro_image",
9 "parameters": {
10 "rootfs": "http://releases.linaro.org/12.02/ubuntu/oneiric-images/nano/linaro-o-nano-tar-20120221-0.tar.gz",
11 "hwpack": "http://releases.linaro.org/12.02/ubuntu/oneiric-images/nano/hwpack_linaro-lt-panda_20120221-1_armel_supported.tar.gz"
12 }
13 },
14 {
15 "command": "lava_test_shell",
16 "parameters": {
17 "testdef_urls": ["http://%(SERVER_NAME)s:%(SERVER_PORT)s/helpers/scheduler/lava/testdef/%(queue)s/%(job)s"],
18 "timeout": 36000
19 }
20 },
21 {
22 "command": "submit_results",
23 "parameters": {
24 "stream": "/anonymous/cbuild/",
25 "server": "https://validation.linaro.org/lava-server/RPC2/"
26 }
27 }
28 ]
29}
030
=== added file 'queue/lava-panda/lava-job-template_tcwg-image.json'
--- queue/lava-panda/lava-job-template_tcwg-image.json 1970-01-01 00:00:00 +0000
+++ queue/lava-panda/lava-job-template_tcwg-image.json 2013-01-15 12:59:22 +0000
@@ -0,0 +1,28 @@
1{
2 "timeout": 1800,
3 "job_name": "%(job)s",
4 "device_type": "panda-es",
5 "device_tags": [],
6 "actions": [
7 {
8 "command": "deploy_linaro_image",
9 "parameters": {
10 "image": "http://people.linaro.org/~pfalcon/cbuild-lava/cbuild-auto-build-precise-r1-ascii.img.gz"
11 }
12 },
13 {
14 "command": "lava_test_shell",
15 "parameters": {
16 "testdef_urls": ["http://%(SERVER_NAME)s:%(SERVER_PORT)s/helpers/scheduler/lava/testdef/%(queue)s/%(job)s"],
17 "timeout": 36000
18 }
19 },
20 {
21 "command": "submit_results",
22 "parameters": {
23 "stream": "/anonymous/cbuild/",
24 "server": "https://validation.linaro.org/lava-server/RPC2/"
25 }
26 }
27 ]
28}
029
=== added file 'queue/lava-panda/lava-test-shell-template.yaml'
--- queue/lava-panda/lava-test-shell-template.yaml 1970-01-01 00:00:00 +0000
+++ queue/lava-panda/lava-test-shell-template.yaml 2013-01-15 12:59:22 +0000
@@ -0,0 +1,52 @@
1metadata:
2 format: "Lava-Test Test Definition 1.0"
3 name: "%(job)s"
4
5install:
6 deps:
7 - bzr
8 git-repos:
9 - git://git.linaro.org/people/davelong/lt_ti_lava.git
10 steps:
11 - echo In Install
12 - apt-get update
13 # LAVA lab doesn't have panda-es with usb-flash-drive currently
14 #- lt_ti_lava/utils/lava-usb-drive.sh /dev/sda
15 #- mkdir -p cbuild-lava
16 #- mount /dev/sda1 cbuild-lava
17 #- df
18
19 # LAVA Debugging
20 #- apt-get install -y openssh-server
21
22 #- Fetch build script first for "fail fast" approach
23 - bzr branch --use-existing-dir lp:~linaro-infrastructure/cbuild/cbuild-lava2 cbuild-lava
24 - cd cbuild-lava/slaves/lava
25 - ./workaround-multiarch.sh
26
27 #- Install build dependencies
28 #- 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
29 - apt-get install -y build-essential gdb lsb-release time wget coreutils bzr xz-utils unzip openssh-client
30 #- apt-get build-dep -y gcc gcc-4.5 gdb eglibc
31 - apt-get build-dep -y gcc gcc-4.5
32
33run:
34 steps:
35 - set -x
36 - echo In Run
37 - cd cbuild-lava/slaves/lava
38 - make -f ../../lib/build.mk final/%(job)s.stamp
39 - echo CBuild make finished, attaching logs to LAVA results
40 - lava-test-case gcc-configure --result pass
41 - lava-test-case gcc-build --result pass
42 - lava-test-case gcc-install --result pass
43 - lava-test-case cbuild-global --result pass
44 - lava-test-case-attach gcc-configure results/build/*/logs/*/gcc-configure.txt
45 - lava-test-case-attach gcc-build results/build/*/logs/*/gcc-build.txt
46 - lava-test-case-attach gcc-install results/build/*/logs/*/gcc-install.txt
47 - lava-test-case-attach cbuild-global results/build/*/logs/*/gcc-build.time
48 - lava-test-case-attach cbuild-global results/build/*/logs/*/gcc-archive.time
49 - lava-test-case-attach cbuild-global results/build/*/logs/*/host.txt
50 - lava-test-case-attach cbuild-global results/build/*/logs/*/md5sums.txt
51 - lava-test-case-attach cbuild-global results/build/*/logs/*/finished.txt
52 - echo Attaching logs done
053
=== added directory 'queue/lava-qemu-minimal'
=== added file 'queue/lava-qemu-minimal/hosts.txt'
--- queue/lava-qemu-minimal/hosts.txt 1970-01-01 00:00:00 +0000
+++ queue/lava-qemu-minimal/hosts.txt 2013-01-15 12:59:22 +0000
@@ -0,0 +1,1 @@
1lava
02
=== added file 'queue/lava-qemu-minimal/lava-job-template.json'
--- queue/lava-qemu-minimal/lava-job-template.json 1970-01-01 00:00:00 +0000
+++ queue/lava-qemu-minimal/lava-job-template.json 2013-01-15 12:59:22 +0000
@@ -0,0 +1,27 @@
1{
2 "timeout": 1800,
3 "job_name": "%(job)s",
4 "device_type": "qemu",
5 "actions": [
6 {
7 "command": "deploy_linaro_image",
8 "parameters": {
9 "image": "file:///tmp/lava/beagle-nano.img.gz"
10 }
11 },
12 {
13 "command": "lava_test_shell",
14 "parameters": {
15 "testdef_urls": ["http://%(SERVER_NAME)s:%(SERVER_PORT)s/helpers/scheduler/lava/testdef/%(queue)s/%(job)s"],
16 "timeout": 36000
17 }
18 },
19 {
20 "command": "submit_results",
21 "parameters": {
22 "stream": "/anonymous/cbuild/",
23 "server": "http://localhost/cbuild/RPC2/"
24 }
25 }
26 ]
27}
028
=== added file 'queue/lava-qemu-minimal/lava-test-shell-template.yaml'
--- queue/lava-qemu-minimal/lava-test-shell-template.yaml 1970-01-01 00:00:00 +0000
+++ queue/lava-qemu-minimal/lava-test-shell-template.yaml 2013-01-15 12:59:22 +0000
@@ -0,0 +1,12 @@
1metadata:
2 format: "Lava-Test Test Definition 1.0"
3 name: "%(job)s"
4
5install:
6 bzr-repos:
7 - lp:~linaro-infrastructure/cbuild/cbuild-lava2
8 steps:
9 - echo In Install for job %(job)s
10run:
11 steps:
12 - echo In run for job %(job)s
013
=== added directory 'spawn/lava-test'
=== added symlink 'spawn/lava-test/lava-qemu-minimal'
=== target is u'../../queue/lava-qemu-minimal'

Subscribers

People subscribed via source and target branches