Merge lp:~deeptik/linaro-ci/fix-bug1013611 into lp:linaro-ci

Proposed by Deepti B. Kalakeri
Status: Merged
Approved by: Milo Casagrande
Approved revision: 73
Merged at revision: 72
Proposed branch: lp:~deeptik/linaro-ci/fix-bug1013611
Merge into: lp:linaro-ci
Diff against target: 222 lines (+192/-0)
6 files modified
node/init-fifo (+19/-0)
node/setup-natty-node (+23/-0)
node/setup-oneiric-node (+32/-0)
node/setup-precise-node (+38/-0)
node/setup_lib (+59/-0)
node/userdata-fifo (+21/-0)
To merge this branch: bzr merge lp:~deeptik/linaro-ci/fix-bug1013611
Reviewer Review Type Date Requested Status
Paul Sokolovsky Approve
Milo Casagrande (community) Approve
Review via email: mp+110740@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Milo Casagrande (milo) wrote :

Hello Deepti,

thanks for working on this!
Merge proposal looks good to me, the only thing I will add is or a README file with a little bit of docs/description of the various scripts, or small comments per script that describe the script intents (even if they are not that complex, at least it will be easier for other to pick up faster what has been done).

Also, I see that two files have license headers, others do not: what is the policy in these cases? Should all source code files have a license header?

Another thing, but definitely minor: files use underscores or dashes in their names. There are file names with the latter and other with the former. Should we use just one?

review: Needs Fixing
lp:~deeptik/linaro-ci/fix-bug1013611 updated
73. By Deepti B. Kalakeri

Address review comments, added comments in every script, modified script names

Revision history for this message
Deepti B. Kalakeri (deeptik) wrote :

On Mon, Jun 18, 2012 at 2:47 PM, Milo Casagrande
<email address hidden>wrote:

> Review: Needs Fixing
>
> Hello Deepti,
>
> thanks for working on this!
> Merge proposal looks good to me, the only thing I will add is or a README
> file with a little bit of docs/description of the various scripts, or small
> comments per script that describe the script intents (even if they are not
> that complex, at least it will be easier for other to pick up faster what
> has been done).
>
> Thanks for the quick review.
I included lines in each of the scripts as its more easy to understand the
usage of the scripts.

> Also, I see that two files have license headers, others do not: what is
> the policy in these cases? Should all source code files have a license
> header?
>

The license header is for 2011 I will remove it for now, and would speak
with Danilo and the whole team on what is the appropriate header to be
included in the scripts.

>
> Another thing, but definitely minor: files use underscores or dashes in
> their names. There are file names with the latter and other with the
> former. Should we use just one?
>

AFAIK, there is no particular naming convention that I came across in
various tools in infrastructure.

>
> --
> https://code.launchpad.net/~deeptik/linaro-ci/fix-bug1013611/+merge/110740<https://code.launchpad.net/%7Edeeptik/linaro-ci/fix-bug1013611/+merge/110740>
> You are the owner of lp:~deeptik/linaro-ci/fix-bug1013611.
>

--
Thanks and Regards,
Deepti

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

Hello Deepti,

thanks for adding some descriptions to the scritp!
As discussed on IRC, we can merge and in case fix later the other bits that need to be discussed.

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

This is definitely looks good, and thanks for quick turnaround! For custom AMI BP, we with Stevan might need to do further tweaks, but having this will allow us to concentrate on our code first of all instead of spreading thin.

I also appreciate flexibility on Milo's side - it's true that our codebases lack on consistency side quite a bunch, but fixing that in adhoc manner oftentimes only complicates and procrastinates functional work. What I dream of is of us getting a blueprint "Clean up our codebases consistently", settle on extra rules we currently miss (like '_' vs '-' dichotomy) have a good swipe over all our projects, and they maintain them on that level.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'node'
2=== added file 'node/init-fifo'
3--- node/init-fifo 1970-01-01 00:00:00 +0000
4+++ node/init-fifo 2012-06-18 11:17:42 +0000
5@@ -0,0 +1,19 @@
6+#! /bin/sh
7+
8+# This script creates and acquires a fifo.
9+# This needs to be called in the slave init script
10+# before calling any of the setup-*-node scripts
11+
12+set -x
13+
14+if ! test -e /tmp/fifo2; then
15+ mkfifo /tmp/fifo2 || true
16+fi
17+if ! test -e /tmp/fifo3; then
18+ mkfifo /tmp/fifo3 || true
19+fi
20+
21+echo 'Acquire::http::Proxy "http://ci.linaro.org:3128";' > /etc/apt/apt.conf.d/ci_linaro_org_http_proxy
22+
23+echo "acquiring fifo lock"
24+echo "start init" > /tmp/fifo2
25
26=== added file 'node/setup-natty-node'
27--- node/setup-natty-node 1970-01-01 00:00:00 +0000
28+++ node/setup-natty-node 2012-06-18 11:17:42 +0000
29@@ -0,0 +1,23 @@
30+#!/bin/sh
31+
32+# This script contains the configurations required specific to the
33+# Natty node, which is mainly used by kernel builds on ci.linaro.org
34+
35+set -xe
36+
37+. ./setup_lib
38+
39+export DEBIAN_FRONTEND=noninteractive
40+
41+# Install packages
42+# ia32-libs is required to be able to run 32 bit gcc4.7 on 64 bit OS
43+apt-get-retry install -y build-essential \
44+ default-jre \
45+ git \
46+ gcc-arm-linux-gnueabi \
47+ uboot-mkimage \
48+ python-beautifulsoup \
49+ python-html2text \
50+ ia32-libs
51+
52+git_config
53
54=== added file 'node/setup-oneiric-node'
55--- node/setup-oneiric-node 1970-01-01 00:00:00 +0000
56+++ node/setup-oneiric-node 2012-06-18 11:17:42 +0000
57@@ -0,0 +1,32 @@
58+#!/bin/sh
59+
60+# This script contains the configurations required specific to the
61+# Oneiric node, which is mainly used by oneiric hwpack/image builds on ci.linaro.org
62+
63+set -xe
64+
65+. ./setup_lib
66+
67+export DEBIAN_FRONTEND=noninteractive
68+
69+# Install packages
70+apt-get-retry install -y build-essential \
71+ debootstrap \
72+ schroot \
73+ default-jre \
74+ eatmydata \
75+ git \
76+ gcc-arm-linux-gnueabi \
77+ linaro-image-tools \
78+ qemu-user-static \
79+ uboot-mkimage
80+
81+live_build_install
82+git_config
83+
84+
85+if test -e /tmp/fifo3; then
86+ echo "end init" > /tmp/fifo3
87+fi
88+
89+fifo_cleanup
90
91=== added file 'node/setup-precise-node'
92--- node/setup-precise-node 1970-01-01 00:00:00 +0000
93+++ node/setup-precise-node 2012-06-18 11:17:42 +0000
94@@ -0,0 +1,38 @@
95+#!/bin/sh
96+
97+# This script contains the configurations required specific to the
98+# Precise node, which is mainly used by precise hwpack/image and
99+# kernel builds on ci.linaro.org
100+
101+set -xe
102+
103+. ./setup_lib
104+apt-get-retry install -y python-software-properties
105+add-apt-repository 'deb http://us.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe'
106+apt-get-retry --non-fatal update
107+
108+export DEBIAN_FRONTEND=noninteractive
109+
110+# Install packages
111+apt-get-retry install -y --target-release precise-backports debootstrap
112+apt-get-retry install -y build-essential \
113+ git \
114+ schroot \
115+ default-jre \
116+ eatmydata \
117+ gcc-arm-linux-gnueabi \
118+ linaro-image-tools \
119+ qemu-user-static \
120+ uboot-mkimage \
121+ python-beautifulsoup \
122+ python-html2text \
123+ gcc-arm-linux-gnueabihf
124+
125+live_build_install
126+git_config
127+
128+if test -e /tmp/fifo3; then
129+ echo "end init" > /tmp/fifo3
130+fi
131+
132+fifo_cleanup
133
134=== added file 'node/setup_lib'
135--- node/setup_lib 1970-01-01 00:00:00 +0000
136+++ node/setup_lib 2012-06-18 11:17:42 +0000
137@@ -0,0 +1,59 @@
138+#!/bin/sh
139+
140+# This file contains all the common routines that are used across
141+# different node setup.
142+
143+# Stubborn apt-get, retrying on errors
144+apt-get-retry ()
145+{
146+ local fatal="yes";
147+ if [ "$1" == "--non-fatal" ]; then
148+ fatal=""
149+ shift
150+ fi
151+ local delay=1;
152+ while [ $delay -lt 100 ]; do
153+ if apt-get "$@"; then
154+ return
155+ fi
156+ echo "apt-get failed, sleeping ${delay}s before retrying"
157+ sleep $delay
158+ delay=$((delay * 2))
159+ done
160+ if [ -n "$fatal" ]; then
161+ echo "apt-get failed after several attempts, aborting"
162+ exit 1
163+ fi
164+}
165+
166+#fix_bug_932088()
167+#{
168+ # Adding the s3 mirror to use instead to over come the 404, 403 errors reported in bug 932088
169+ #sed -i.bk 's,^\(.*://[^.]*.ec2.archive.ubuntu.com\)/,\1.s3.amazonaws.com/,' /etc/apt/sources.list
170+ #apt-get-retry --non-fatal update
171+#}
172+
173+live_build_install()
174+{
175+ wget "http://git.linaro.org/gitweb?p=ubuntu/ubuntu-build-service.git;a=blob_plain;f=packages/live-build_3.0~a45-1_all.deb" -O live-build_3.0~a45-1_all.deb
176+ dpkg -i live-build_3.0~a45-1_all.deb
177+}
178+
179+git_config()
180+{
181+ git config --system --unset-all http.proxy || true
182+ git config --system http.proxy http://ci.linaro.org:3128
183+}
184+
185+
186+
187+fifo_cleanup()
188+{
189+ if test -e /tmp/fifo3 ; then
190+ rm -f /tmp/fifo3
191+ fi
192+
193+ if test -e /tmp/fifo2 ; then
194+ rm -f /tmp/fifo2
195+ fi
196+}
197
198=== added file 'node/userdata-fifo'
199--- node/userdata-fifo 1970-01-01 00:00:00 +0000
200+++ node/userdata-fifo 2012-06-18 11:17:42 +0000
201@@ -0,0 +1,21 @@
202+#! /bin/sh
203+
204+# This script waits for the slave init script to finish execution
205+# This script needs to be called from the UserData part of the slave init
206+
207+set -x
208+
209+if ! test -e /tmp/fifo2; then
210+ mkfifo /tmp/fifo2 || true
211+fi
212+if ! test -e /tmp/fifo3; then
213+ mkfifo /tmp/fifo3 || true
214+fi
215+
216+echo "waiting for init script to start"
217+cat /tmp/fifo2 > /dev/null
218+echo "init script running"
219+
220+# wait for init script to signal "finish"
221+cat /tmp/fifo3 > /dev/null
222+echo "init script ended ... continuing with cloud-init"

Subscribers

People subscribed via source and target branches