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
=== added directory 'node'
=== added file 'node/init-fifo'
--- node/init-fifo 1970-01-01 00:00:00 +0000
+++ node/init-fifo 2012-06-18 11:17:42 +0000
@@ -0,0 +1,19 @@
1#! /bin/sh
2
3# This script creates and acquires a fifo.
4# This needs to be called in the slave init script
5# before calling any of the setup-*-node scripts
6
7set -x
8
9if ! test -e /tmp/fifo2; then
10 mkfifo /tmp/fifo2 || true
11fi
12if ! test -e /tmp/fifo3; then
13 mkfifo /tmp/fifo3 || true
14fi
15
16echo 'Acquire::http::Proxy "http://ci.linaro.org:3128";' > /etc/apt/apt.conf.d/ci_linaro_org_http_proxy
17
18echo "acquiring fifo lock"
19echo "start init" > /tmp/fifo2
020
=== added file 'node/setup-natty-node'
--- node/setup-natty-node 1970-01-01 00:00:00 +0000
+++ node/setup-natty-node 2012-06-18 11:17:42 +0000
@@ -0,0 +1,23 @@
1#!/bin/sh
2
3# This script contains the configurations required specific to the
4# Natty node, which is mainly used by kernel builds on ci.linaro.org
5
6set -xe
7
8. ./setup_lib
9
10export DEBIAN_FRONTEND=noninteractive
11
12# Install packages
13# ia32-libs is required to be able to run 32 bit gcc4.7 on 64 bit OS
14apt-get-retry install -y build-essential \
15 default-jre \
16 git \
17 gcc-arm-linux-gnueabi \
18 uboot-mkimage \
19 python-beautifulsoup \
20 python-html2text \
21 ia32-libs
22
23git_config
024
=== added file 'node/setup-oneiric-node'
--- node/setup-oneiric-node 1970-01-01 00:00:00 +0000
+++ node/setup-oneiric-node 2012-06-18 11:17:42 +0000
@@ -0,0 +1,32 @@
1#!/bin/sh
2
3# This script contains the configurations required specific to the
4# Oneiric node, which is mainly used by oneiric hwpack/image builds on ci.linaro.org
5
6set -xe
7
8. ./setup_lib
9
10export DEBIAN_FRONTEND=noninteractive
11
12# Install packages
13apt-get-retry install -y build-essential \
14 debootstrap \
15 schroot \
16 default-jre \
17 eatmydata \
18 git \
19 gcc-arm-linux-gnueabi \
20 linaro-image-tools \
21 qemu-user-static \
22 uboot-mkimage
23
24live_build_install
25git_config
26
27
28if test -e /tmp/fifo3; then
29 echo "end init" > /tmp/fifo3
30fi
31
32fifo_cleanup
033
=== added file 'node/setup-precise-node'
--- node/setup-precise-node 1970-01-01 00:00:00 +0000
+++ node/setup-precise-node 2012-06-18 11:17:42 +0000
@@ -0,0 +1,38 @@
1#!/bin/sh
2
3# This script contains the configurations required specific to the
4# Precise node, which is mainly used by precise hwpack/image and
5# kernel builds on ci.linaro.org
6
7set -xe
8
9. ./setup_lib
10apt-get-retry install -y python-software-properties
11add-apt-repository 'deb http://us.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe'
12apt-get-retry --non-fatal update
13
14export DEBIAN_FRONTEND=noninteractive
15
16# Install packages
17apt-get-retry install -y --target-release precise-backports debootstrap
18apt-get-retry install -y build-essential \
19 git \
20 schroot \
21 default-jre \
22 eatmydata \
23 gcc-arm-linux-gnueabi \
24 linaro-image-tools \
25 qemu-user-static \
26 uboot-mkimage \
27 python-beautifulsoup \
28 python-html2text \
29 gcc-arm-linux-gnueabihf
30
31live_build_install
32git_config
33
34if test -e /tmp/fifo3; then
35 echo "end init" > /tmp/fifo3
36fi
37
38fifo_cleanup
039
=== added file 'node/setup_lib'
--- node/setup_lib 1970-01-01 00:00:00 +0000
+++ node/setup_lib 2012-06-18 11:17:42 +0000
@@ -0,0 +1,59 @@
1#!/bin/sh
2
3# This file contains all the common routines that are used across
4# different node setup.
5
6# Stubborn apt-get, retrying on errors
7apt-get-retry ()
8{
9 local fatal="yes";
10 if [ "$1" == "--non-fatal" ]; then
11 fatal=""
12 shift
13 fi
14 local delay=1;
15 while [ $delay -lt 100 ]; do
16 if apt-get "$@"; then
17 return
18 fi
19 echo "apt-get failed, sleeping ${delay}s before retrying"
20 sleep $delay
21 delay=$((delay * 2))
22 done
23 if [ -n "$fatal" ]; then
24 echo "apt-get failed after several attempts, aborting"
25 exit 1
26 fi
27}
28
29#fix_bug_932088()
30#{
31 # Adding the s3 mirror to use instead to over come the 404, 403 errors reported in bug 932088
32 #sed -i.bk 's,^\(.*://[^.]*.ec2.archive.ubuntu.com\)/,\1.s3.amazonaws.com/,' /etc/apt/sources.list
33 #apt-get-retry --non-fatal update
34#}
35
36live_build_install()
37{
38 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
39 dpkg -i live-build_3.0~a45-1_all.deb
40}
41
42git_config()
43{
44 git config --system --unset-all http.proxy || true
45 git config --system http.proxy http://ci.linaro.org:3128
46}
47
48
49
50fifo_cleanup()
51{
52 if test -e /tmp/fifo3 ; then
53 rm -f /tmp/fifo3
54 fi
55
56 if test -e /tmp/fifo2 ; then
57 rm -f /tmp/fifo2
58 fi
59}
060
=== added file 'node/userdata-fifo'
--- node/userdata-fifo 1970-01-01 00:00:00 +0000
+++ node/userdata-fifo 2012-06-18 11:17:42 +0000
@@ -0,0 +1,21 @@
1#! /bin/sh
2
3# This script waits for the slave init script to finish execution
4# This script needs to be called from the UserData part of the slave init
5
6set -x
7
8if ! test -e /tmp/fifo2; then
9 mkfifo /tmp/fifo2 || true
10fi
11if ! test -e /tmp/fifo3; then
12 mkfifo /tmp/fifo3 || true
13fi
14
15echo "waiting for init script to start"
16cat /tmp/fifo2 > /dev/null
17echo "init script running"
18
19# wait for init script to signal "finish"
20cat /tmp/fifo3 > /dev/null
21echo "init script ended ... continuing with cloud-init"

Subscribers

People subscribed via source and target branches