Merge lp:~ricardokirkner/locolander/explicit-dependencies into lp:locolander

Proposed by Ricardo Kirkner
Status: Merged
Approved by: Ricardo Kirkner
Approved revision: 28
Merged at revision: 27
Proposed branch: lp:~ricardokirkner/locolander/explicit-dependencies
Merge into: lp:locolander
Diff against target: 246 lines (+76/-26)
3 files modified
.locolander.yml (+53/-1)
ns2df.py (+7/-9)
tests/test_ns2df.py (+16/-16)
To merge this branch: bzr merge lp:~ricardokirkner/locolander/explicit-dependencies
Reviewer Review Type Date Requested Status
Facundo Batista Approve
Review via email: mp+177235@code.launchpad.net

Commit message

use explicit dependencies in locolander.yml file to improve build speed

streamline Dockerfile builder to cache as much as possible

To post a comment you must log in.
Revision history for this message
Facundo Batista (facundo) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.locolander.yml'
2--- .locolander.yml 2013-07-13 17:02:33 +0000
3+++ .locolander.yml 2013-07-27 00:07:31 +0000
4@@ -1,5 +1,57 @@
5 precise:
6- pip: -r requirements.txt
7+ apt:
8+ python-dev:
9+ libpq-dev:
10+ libxml2-dev:
11+ libxslt1-dev:
12+ pip:
13+ Django: 1.5.1
14+ PyYAML: 3.10.0
15+ South: 0.8.1
16+ amqp: 1.0.12
17+ anyjson: 0.3.3
18+ argparse: 1.2.1
19+ billiard: 2.7.3.31
20+ bzr: 2.6b2
21+ celery: 3.0.21
22+ cssselect: 0.8
23+ distribute: 0.6.34
24+ django-allauth: 0.12.0
25+ django-celery: 3.0.17
26+ flower: 0.5.2
27+ github3.py: 0.7.0
28+ gunicorn: 17.5
29+ httplib2: 0.8
30+ keyring: 1.5
31+ kombu: 2.5.12
32+ launchpadlib: 1.10.2
33+ lazr.authentication: 0.1.2
34+ lazr.restfulclient: 0.13.3
35+ lazr.uri: 1.0.3
36+ lxml: 3.2.1
37+ meld3: 0.6.10
38+ mock: 1.0.1
39+ oauth: 1.0.1
40+ oauthlib: 0.5.0
41+ pep8: 1.4.6
42+ psycopg2: 2.5.1
43+ pyflakes: 0.7.3
44+ pyquery: 1.2.4
45+ python-dateutil: 2.1
46+ python-openid: 2.2.5
47+ pytz: 2013b
48+ redis: 2.7.6
49+ requests: 1.2.3
50+ requests-oauthlib: 0.3.2
51+ simplejson: 3.3.0
52+ six: 1.3.0
53+ supervisor: 3.0b2
54+ testresources: 0.2.7
55+ tornado: 3.1
56+ wadllib: 1.3.2
57+ wsgi-intercept: 0.5.1
58+ wsgiref: 0.1.2
59+ zope.interface: 4.0.5
60
61 metadata:
62 test_script: ./run_tests.sh
63
64=== modified file 'ns2df.py'
65--- ns2df.py 2013-07-09 18:41:19 +0000
66+++ ns2df.py 2013-07-27 00:07:31 +0000
67@@ -15,13 +15,13 @@
68 will be converted to
69
70 from locolander:precise
71- run apt-get -q -y install apache2=3.3-4
72- run apt-get -q -y install bzr
73+ run apt-get -q -y install apache2=3.3-4 bzr
74 run pip install --download=/tmp/pipcache --no-install foobar
75 run ip link set dev eth0 down
76 run pip install --find-links=file:///tmp/pipcache --no-index foobar
77+ cmd cd /srv/locolander/project && timeout 300 ./test
78
79-and also the system will use "./test" as script
80+(provided the project name used is 'project')
81 """
82
83 import os.path
84@@ -59,9 +59,7 @@
85
86 def _get_code(config, **params):
87 return ['run mkdir -p {target_path}'.format(**params),
88- 'add . {target_path}'.format(**params),
89- 'run chown -R locolander.locolander {target_path}'.format(
90- **params)]
91+ 'add . {target_path}'.format(**params)]
92
93
94 def _get_depends_prev(config, **params):
95@@ -89,7 +87,7 @@
96 packages = _get_pip_packages(items)
97 pip_cache_dir = params['pip_cache_dir']
98 dependencies.append(
99- 'run cd {target_path} && pip install --download={pip_cache_dir} '
100+ 'run pip install --download={pip_cache_dir} '
101 '--no-install {packages}'.format(
102 pip_cache_dir=pip_cache_dir, packages=packages,
103 target_path=params['target_path']))
104@@ -112,7 +110,7 @@
105 packages = _get_pip_packages(items)
106 pip_cache_dir = params['pip_cache_dir']
107 dependencies.append(
108- 'run cd {target_path} && pip install '
109+ 'run pip install '
110 '--find-links=file://{pip_cache_dir} --no-index '
111 '{packages}'.format(pip_cache_dir=pip_cache_dir,
112 packages=packages,
113@@ -140,10 +138,10 @@
114 # the order for calling these functions is VERY important
115 functions = [
116 _get_base,
117- _get_code,
118 _get_depends_prev,
119 _get_secure,
120 _get_depends_post,
121+ _get_code,
122 _get_rest,
123 ]
124 data = []
125
126=== modified file 'tests/test_ns2df.py'
127--- tests/test_ns2df.py 2013-07-09 18:41:19 +0000
128+++ tests/test_ns2df.py 2013-07-27 00:07:31 +0000
129@@ -52,7 +52,7 @@
130 })
131 res = ns2df._get_depends_prev(config, **self.params)
132 self.assertEqual(res, [
133- "run cd /srv/locolander/project && pip install --download=/tmp/pipcache --no-install foo",
134+ "run pip install --download=/tmp/pipcache --no-install foo",
135 ])
136
137 def test_pip_prev_several(self):
138@@ -61,7 +61,7 @@
139 })
140 res = ns2df._get_depends_prev(config, **self.params)
141 self.assertEqual(res, [
142- "run cd /srv/locolander/project && pip install --download=/tmp/pipcache --no-install bar foo",
143+ "run pip install --download=/tmp/pipcache --no-install bar foo",
144 ])
145
146 def test_pip_prev_versions(self):
147@@ -70,7 +70,7 @@
148 })
149 res = ns2df._get_depends_prev(config, **self.params)
150 self.assertEqual(res, [
151- ("run cd /srv/locolander/project && pip install --download=/tmp/pipcache --no-install "
152+ ("run pip install --download=/tmp/pipcache --no-install "
153 "bar==2.1 foo"),
154 ])
155
156@@ -80,7 +80,7 @@
157 })
158 res = ns2df._get_depends_prev(config, **self.params)
159 self.assertEqual(res, [
160- ("run cd /srv/locolander/project && pip install --download=/tmp/pipcache --no-install "
161+ ("run pip install --download=/tmp/pipcache --no-install "
162 "-r requirements.txt"),
163 ])
164
165@@ -90,7 +90,7 @@
166 })
167 res = ns2df._get_depends_post(config, **self.params)
168 self.assertEqual(res, [
169- "run cd /srv/locolander/project && pip install --find-links=file:///tmp/pipcache --no-index foo"
170+ "run pip install --find-links=file:///tmp/pipcache --no-index foo"
171 ])
172
173 def test_pip_post_several(self):
174@@ -99,7 +99,7 @@
175 })
176 res = ns2df._get_depends_post(config, **self.params)
177 self.assertEqual(res, [
178- ("run cd /srv/locolander/project && pip install --find-links=file:///tmp/pipcache --no-index "
179+ ("run pip install --find-links=file:///tmp/pipcache --no-index "
180 "bar foo"),
181 ])
182
183@@ -109,7 +109,7 @@
184 })
185 res = ns2df._get_depends_post(config, **self.params)
186 self.assertEqual(res, [
187- ("run cd /srv/locolander/project && pip install --find-links=file:///tmp/pipcache --no-index "
188+ ("run pip install --find-links=file:///tmp/pipcache --no-index "
189 "bar==2.1 foo"),
190 ])
191
192@@ -119,7 +119,7 @@
193 })
194 res = ns2df._get_depends_post(config, **self.params)
195 self.assertEqual(res, [
196- ("run cd /srv/locolander/project && pip install --find-links=file:///tmp/pipcache --no-index "
197+ ("run pip install --find-links=file:///tmp/pipcache --no-index "
198 "-r requirements.txt"),
199 ])
200
201@@ -131,7 +131,7 @@
202 res = ns2df._get_depends_prev(config, **self.params)
203 self.assertEqual(res, [
204 "run apt-get -q -y install apache2=3.3-4 bzr",
205- "run cd /srv/locolander/project && pip install --download=/tmp/pipcache --no-install bar foo",
206+ "run pip install --download=/tmp/pipcache --no-install bar foo",
207 ])
208
209 def test_mixed_post(self):
210@@ -141,7 +141,7 @@
211 })
212 res = ns2df._get_depends_post(config, **self.params)
213 self.assertEqual(res, [
214- ("run cd /srv/locolander/project && pip install --find-links=file:///tmp/pipcache --no-index "
215+ ("run pip install --find-links=file:///tmp/pipcache --no-index "
216 "bar foo"),
217 ])
218
219@@ -166,7 +166,8 @@
220 res = ns2df._get_rest({},
221 target_path='/srv/locolander',
222 test_cmd='./run_tests.sh')
223- self.assertEqual(res, ["cmd cd /srv/locolander && timeout 300 ./run_tests.sh"])
224+ self.assertEqual(
225+ res, ["cmd cd /srv/locolander && timeout 300 ./run_tests.sh"])
226
227 def test_all_mixed(self):
228 config_text = """
229@@ -182,13 +183,12 @@
230 docker = ns2df.parse(config_text, "/tmp/pipcache", 'project')
231 self.assertEqual(docker,
232 "from locolander:precise\n"
233- "run mkdir -p /srv/locolander/project\n"
234- "add . /srv/locolander/project\n"
235- "run chown -R locolander.locolander /srv/locolander/project\n"
236 "run apt-get -q -y install apache2=3.3-4 bzr\n"
237- "run cd /srv/locolander/project && pip install --download=/tmp/pipcache --no-install foobar\n"
238+ "run pip install --download=/tmp/pipcache --no-install foobar\n"
239 "run ip link set dev eth0 down\n"
240- "run cd /srv/locolander/project && pip install --find-links=file:///tmp/pipcache "
241+ "run pip install --find-links=file:///tmp/pipcache "
242 "--no-index foobar\n"
243+ "run mkdir -p /srv/locolander/project\n"
244+ "add . /srv/locolander/project\n"
245 "cmd cd /srv/locolander/project && timeout 300 foo"
246 )

Subscribers

People subscribed via source and target branches

to all changes: