Merge lp:~lazypower/charms/trusty/docker/trunk into lp:charms/trusty/docker
- Trusty Tahr (14.04)
- trunk
- Merge into trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 7 | ||||
Proposed branch: | lp:~lazypower/charms/trusty/docker/trunk | ||||
Merge into: | lp:charms/trusty/docker | ||||
Diff against target: |
401 lines (+115/-58) 13 files modified
Makefile (+4/-1) README.md (+27/-9) config.yaml (+10/-2) hooks/python-pkgs.txt (+1/-1) hooks/setup.py (+0/-22) hooks/setup.sh (+0/-9) metadata.yaml (+2/-2) playbooks/config-changed.yaml (+40/-0) playbooks/latest-docker.yaml (+9/-4) playbooks/network-relation-changed.yaml (+2/-0) playbooks/site.yaml (+2/-2) tests/10-deploy-test (+18/-5) tests/tests.yaml (+0/-1) |
||||
To merge this branch: | bzr merge lp:~lazypower/charms/trusty/docker/trunk | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Matt Bruzek (community) | Approve | ||
charmers | Pending | ||
Review via email: mp+265205@code.launchpad.net |
Commit message
Description of the change
Updates to v0.1.6 of the docker charm, which adds AUFS backend storage support.
The existing charm deploys device mapper, leaving this enabled by default is not desireable as Docker Inc has depreciated support for this storage engine. Its possible to upgrade existing clusters, however the upgrade path takes some manual intervention of exporting and re-importing the containers.
This has potential side-effects for data-containers, and existing services which will prevent them from starting. Full export and recovery instructions are included in the README along with validation of AUFS storage driver from a devicemapper upgrade have been included in the test suite.
Charles Butler (lazypower) wrote : | # |
I've cleaned up the tree, refactored the tests and I'm getting greens in charmbox. I think we're ready for another round of reviews on this branch.
Matt Bruzek (mbruzek) wrote : | # |
Nice work here Chuck. I was able to deploy and pull an image. Passes bundletester PASS: 4 Total: 4 (711.994322 sec). I know this aufs change fixes storage problems in the charm.
+1 LGTM
- 7. By Matt Bruzek
-
[lazypower] Updates to v0.1.6 of the docker charm, which adds AUFS backend storage support.
Preview Diff
1 | === modified file 'Makefile' | |||
2 | --- Makefile 2015-07-10 20:52:16 +0000 | |||
3 | +++ Makefile 2015-09-14 21:25:51 +0000 | |||
4 | @@ -2,11 +2,14 @@ | |||
5 | 2 | 2 | ||
6 | 3 | build: tox lint test | 3 | build: tox lint test |
7 | 4 | 4 | ||
8 | 5 | virtualenv: | ||
9 | 6 | virtualenv .venv | ||
10 | 7 | |||
11 | 5 | tox: | 8 | tox: |
12 | 6 | /usr/bin/tox: | 9 | /usr/bin/tox: |
13 | 7 | sudo apt-get install -y python-tox python-dev python-virtualenv | 10 | sudo apt-get install -y python-tox python-dev python-virtualenv |
14 | 8 | 11 | ||
16 | 9 | lint: /usr/bin/tox | 12 | lint: /usr/bin/tox |
17 | 10 | tox -e lint | 13 | tox -e lint |
18 | 11 | 14 | ||
19 | 12 | 15 | ||
20 | 13 | 16 | ||
21 | === modified file 'README.md' | |||
22 | --- README.md 2015-07-17 13:22:34 +0000 | |||
23 | +++ README.md 2015-09-14 21:25:51 +0000 | |||
24 | @@ -1,4 +1,4 @@ | |||
26 | 1 | # Docker ![](https://d3oypxn00j2a10.cloudfront.net/0.12.10/img/nav/docker-logo-loggedout.png) | 1 | # Docker Charm |
27 | 2 | 2 | ||
28 | 3 | [![Build Status](http://drone.dasroot.net/api/badge/github.com/chuckbutler/docker-charm/status.svg?branch=master)](http://drone.dasroot.net/github.com/chuckbutler/docker-charm) | 3 | [![Build Status](http://drone.dasroot.net/api/badge/github.com/chuckbutler/docker-charm/status.svg?branch=master)](http://drone.dasroot.net/github.com/chuckbutler/docker-charm) |
29 | 4 | 4 | ||
30 | @@ -20,20 +20,20 @@ | |||
31 | 20 | 20 | ||
32 | 21 | # Using the Docker Charm | 21 | # Using the Docker Charm |
33 | 22 | 22 | ||
35 | 23 | Step by step instructions on using the docker charm: | 23 | Step by step instructions on using the Docker charm: |
36 | 24 | 24 | ||
38 | 25 | juju deploy cs:trusty/docker | 25 | juju deploy cs:~lazypower/trusty/docker |
39 | 26 | 26 | ||
40 | 27 | ## Scale out Usage | 27 | ## Scale out Usage |
41 | 28 | 28 | ||
43 | 29 | Scaling out the docker service is as simple as adding additional docker units | 29 | Scaling out the Docker service is as simple as adding additional Docker units |
44 | 30 | to expand your cluster. However, you will need an SDN solution to provide cross | 30 | to expand your cluster. However, you will need an SDN solution to provide cross |
45 | 31 | host networking. See the Known Limitations and issues about this. | 31 | host networking. See the Known Limitations and issues about this. |
46 | 32 | 32 | ||
47 | 33 | # Configuration | 33 | # Configuration |
48 | 34 | 34 | ||
49 | 35 | - latest : By default the charm assumes installation from the ubuntu | 35 | - latest : By default the charm assumes installation from the ubuntu |
51 | 36 | repositories. If you wish to deploy the latest upstream docker runtime enable | 36 | repositories. If you wish to deploy the latest upstream Docker runtime enable |
52 | 37 | this option. | 37 | this option. |
53 | 38 | 38 | ||
54 | 39 | - version : String representation of the version you wish to deploy. This helps | 39 | - version : String representation of the version you wish to deploy. This helps |
55 | @@ -47,13 +47,22 @@ | |||
56 | 47 | leverage a yaml file to spin up and manage multiple containers that | 47 | leverage a yaml file to spin up and manage multiple containers that |
57 | 48 | comprise a single application stack. | 48 | comprise a single application stack. |
58 | 49 | 49 | ||
59 | 50 | - aufs : **new as of v0.1.6** Defaults the backend storage driver to AUFS. The | ||
60 | 51 | older option of device mapper was horribly broken in most setups, and has | ||
61 | 52 | been completely depreciated by the Docker foundation. Disable to keep the | ||
62 | 53 | DeviceMapper backend. - Not recommended. **note** this will break existing | ||
63 | 54 | containers if you upgrade existing setups. Ensure you account for this when | ||
64 | 55 | upgrading your Docker clusters that are previously deployed with this charm. | ||
65 | 56 | |||
66 | 57 | > See blurb under Known Issues for migration instructions. | ||
67 | 58 | |||
68 | 50 | ## Known Limitations and Issues | 59 | ## Known Limitations and Issues |
69 | 51 | 60 | ||
70 | 52 | 61 | ||
71 | 53 | #### AWS t1.micro | 62 | #### AWS t1.micro |
72 | 54 | 63 | ||
73 | 55 | Performance will suffer on an AWS t1.micro unit - as it has such a limited amount of ram. Between | 64 | Performance will suffer on an AWS t1.micro unit - as it has such a limited amount of ram. Between |
75 | 56 | the juju unit-agent, and the docker daemon + workloads - you will only be able to run the smallest | 65 | the juju unit-agent, and the Docker daemon + workloads - you will only be able to run the smallest |
76 | 57 | of deployments on them. Thus it is not recommended. | 66 | of deployments on them. Thus it is not recommended. |
77 | 58 | 67 | ||
78 | 59 | #### Local Provider Blockers | 68 | #### Local Provider Blockers |
79 | @@ -71,7 +80,7 @@ | |||
80 | 71 | 80 | ||
81 | 72 | #### Host Only Networking | 81 | #### Host Only Networking |
82 | 73 | 82 | ||
84 | 74 | By default, docker deploys a host-only bridge adapter. Containers are able to communicate with one | 83 | By default, Docker deploys a host-only bridge adapter. Containers are able to communicate with one |
85 | 75 | another if you forward host ports to the containers using the `-p` option. More on this in the | 84 | another if you forward host ports to the containers using the `-p` option. More on this in the |
86 | 76 | [Deploying Containers]({{site.url}}/user/deploying-containers.html) docpage. | 85 | [Deploying Containers]({{site.url}}/user/deploying-containers.html) docpage. |
87 | 77 | 86 | ||
88 | @@ -81,12 +90,21 @@ | |||
89 | 81 | 90 | ||
90 | 82 | #### Offline Environments | 91 | #### Offline Environments |
91 | 83 | 92 | ||
93 | 84 | There is no support for installation of the docker service in | 93 | There is no support for installation of the Docker service in |
94 | 85 | [offline environments](https://jujucharms.com/docs/howto-offline-charms). | 94 | [offline environments](https://jujucharms.com/docs/howto-offline-charms). |
95 | 86 | There is however [a bug](https://github.com/chuckbutler/docker-charm/issues/13) to track the | 95 | There is however [a bug](https://github.com/chuckbutler/docker-charm/issues/13) to track the |
96 | 87 | progress of this feature. | 96 | progress of this feature. |
97 | 88 | 97 | ||
99 | 89 | 98 | #### AUFS Upgrade Stopped my containers from working | |
100 | 99 | |||
101 | 100 | If you have older containers deployed and running, you will need to pause them | ||
102 | 101 | and export. Once the tarballs of the containers have been exported - upgrade | ||
103 | 102 | your cluster and reimport following the CLI instructions below as a guide | ||
104 | 103 | |||
105 | 104 | docker export <<container id>> > mycontainer-latest.tgz | ||
106 | 105 | # upgrade | ||
107 | 106 | docker import -i mycontainer-latest - mycontainer:latest | ||
108 | 107 | docker run <<options>> mycontainer:latest | ||
109 | 90 | 108 | ||
110 | 91 | 109 | ||
111 | 92 | # Contact Information | 110 | # Contact Information |
112 | 93 | 111 | ||
113 | === modified file 'config.yaml' | |||
114 | --- config.yaml 2015-07-10 20:52:16 +0000 | |||
115 | +++ config.yaml 2015-09-14 21:25:51 +0000 | |||
116 | @@ -7,7 +7,7 @@ | |||
117 | 7 | installs docker.io from the Ubuntu package archive." | 7 | installs docker.io from the Ubuntu package archive." |
118 | 8 | version: | 8 | version: |
119 | 9 | type: string | 9 | type: string |
121 | 10 | default: 1.7.0 | 10 | default: 1.8.1-0~trusty |
122 | 11 | description: | | 11 | description: | |
123 | 12 | When latest = true, specify the version to install from the PPA. | 12 | When latest = true, specify the version to install from the PPA. |
124 | 13 | latest = false will always assume use the current stable in distro. | 13 | latest = false will always assume use the current stable in distro. |
125 | @@ -16,4 +16,12 @@ | |||
126 | 16 | default: true | 16 | default: true |
127 | 17 | description: | | 17 | description: | |
128 | 18 | Install docker compose, the formation launch utility | 18 | Install docker compose, the formation launch utility |
130 | 19 | 19 | aufs: | |
131 | 20 | type: boolean | ||
132 | 21 | default: true | ||
133 | 22 | description: | | ||
134 | 23 | Change the backend storage driver from devicemapper to AUFS. | ||
135 | 24 | The device mapper storage engine is known to be problematic, and AUFS | ||
136 | 25 | is not enabled by default in Ubuntu. This will install AUFS support and | ||
137 | 26 | swap the backend. **NOTE** It is not recommended to reconfigure this post | ||
138 | 27 | deployment. You may incur dataloss. | ||
139 | 20 | 28 | ||
140 | === modified file 'hooks/python-pkgs.txt' | |||
141 | --- hooks/python-pkgs.txt 2015-06-02 17:33:17 +0000 | |||
142 | +++ hooks/python-pkgs.txt 2015-09-14 21:25:51 +0000 | |||
143 | @@ -1,5 +1,5 @@ | |||
144 | 1 | -e git+https://github.com/whitmo/ansible-charm.git#egg=AnsibleCharm | 1 | -e git+https://github.com/whitmo/ansible-charm.git#egg=AnsibleCharm |
145 | 2 | charmhelpers | 2 | charmhelpers |
146 | 3 | ansible | 3 | ansible |
148 | 4 | path.py | 4 | path.py <= 7.7.1 |
149 | 5 | docker-py | 5 | docker-py |
150 | 6 | 6 | ||
151 | === removed file 'hooks/setup.py' | |||
152 | --- hooks/setup.py 2015-07-17 13:22:34 +0000 | |||
153 | +++ hooks/setup.py 1970-01-01 00:00:00 +0000 | |||
154 | @@ -1,22 +0,0 @@ | |||
155 | 1 | import subprocess | ||
156 | 2 | import sys | ||
157 | 3 | import os | ||
158 | 4 | |||
159 | 5 | |||
160 | 6 | def pre_install(): | ||
161 | 7 | """ | ||
162 | 8 | Do any setup required before the install hook. | ||
163 | 9 | """ | ||
164 | 10 | try: | ||
165 | 11 | import charmhelpers # noqa | ||
166 | 12 | import ansiblecharm # noqa | ||
167 | 13 | from path import path # noqa | ||
168 | 14 | except ImportError: | ||
169 | 15 | subprocess.check_call(['hooks/setup.sh']) | ||
170 | 16 | subprocess.check_call("pip install -r hooks/python-pkgs.txt", | ||
171 | 17 | shell=True) | ||
172 | 18 | |||
173 | 19 | from path import path | ||
174 | 20 | |||
175 | 21 | pth = str(path(os.environ['CHARM_DIR']) / 'src/ansiblecharm') | ||
176 | 22 | sys.path.append(pth) | ||
177 | 23 | 0 | ||
178 | === removed file 'hooks/setup.sh' | |||
179 | --- hooks/setup.sh 2015-06-10 20:39:25 +0000 | |||
180 | +++ hooks/setup.sh 1970-01-01 00:00:00 +0000 | |||
181 | @@ -1,9 +0,0 @@ | |||
182 | 1 | #!/bin/bash | ||
183 | 2 | set -e | ||
184 | 3 | |||
185 | 4 | apt-get install -y \ | ||
186 | 5 | python-dev \ | ||
187 | 6 | python-pip \ | ||
188 | 7 | git | ||
189 | 8 | |||
190 | 9 | easy_install -U pip | ||
191 | 10 | 0 | ||
192 | === modified file 'metadata.yaml' | |||
193 | --- metadata.yaml 2015-07-10 20:52:16 +0000 | |||
194 | +++ metadata.yaml 2015-09-14 21:25:51 +0000 | |||
195 | @@ -10,8 +10,8 @@ | |||
196 | 10 | provides: | 10 | provides: |
197 | 11 | docker-containers: | 11 | docker-containers: |
198 | 12 | interface: containers | 12 | interface: containers |
201 | 13 | # events: | 13 | events: |
202 | 14 | # interface: docker-socket | 14 | interface: docker-socket |
203 | 15 | requires: | 15 | requires: |
204 | 16 | network: | 16 | network: |
205 | 17 | interface: overlay-network | 17 | interface: overlay-network |
206 | 18 | 18 | ||
207 | === added file 'modules/__init__.py' | |||
208 | === modified file 'playbooks/config-changed.yaml' | |||
209 | --- playbooks/config-changed.yaml 2015-06-10 20:39:25 +0000 | |||
210 | +++ playbooks/config-changed.yaml 2015-09-14 21:25:51 +0000 | |||
211 | @@ -13,21 +13,61 @@ | |||
212 | 13 | service_label: "service={{ service_name }}" | 13 | service_label: "service={{ service_name }}" |
213 | 14 | unit_label: "unit={{ local_unit }}" | 14 | unit_label: "unit={{ local_unit }}" |
214 | 15 | 15 | ||
215 | 16 | - name: grab release info | ||
216 | 17 | shell: uname -r | ||
217 | 18 | register: rel | ||
218 | 19 | when: aufs == true | ||
219 | 20 | |||
220 | 21 | - set_fact: | ||
221 | 22 | thisrel: "{{ rel.stdout }}" | ||
222 | 23 | when: aufs == true | ||
223 | 24 | |||
224 | 25 | - name: Install AUFS backend supporting packages | ||
225 | 26 | apt: name={{item}} state=present | ||
226 | 27 | with_items: | ||
227 | 28 | - "linux-image-extra-{{thisrel}}" | ||
228 | 29 | - aufs-tools | ||
229 | 30 | when: aufs == true | ||
230 | 31 | |||
231 | 32 | - name: stop docker to remove device mapper | ||
232 | 33 | service: "name={{docker_version_name}} state=stopped" | ||
233 | 34 | when: aufs == true and latest == true | ||
234 | 35 | notify: | ||
235 | 36 | - restart docker | ||
236 | 37 | |||
237 | 38 | - name: Remove Devicemapper backend if present | ||
238 | 39 | file: path=/var/lib/docker/devicemapper state=absent | ||
239 | 40 | when: aufs == true and latest == true | ||
240 | 41 | |||
241 | 42 | - name: Register AUFS option | ||
242 | 43 | docker_opts: action=add | ||
243 | 44 | key="storage-driver" val="aufs" | ||
244 | 45 | yaml="{{ opts_yaml }}" | ||
245 | 46 | when: aufs == true and latest == true | ||
246 | 47 | notify: | ||
247 | 48 | - calculate docker opts | ||
248 | 49 | - render docker defaults | ||
249 | 50 | - restart docker | ||
250 | 51 | |||
251 | 16 | - name: set service name as a label | 52 | - name: set service name as a label |
252 | 17 | docker_opts: action=add | 53 | docker_opts: action=add |
253 | 18 | key=label val="{{ service_label }}" | 54 | key=label val="{{ service_label }}" |
254 | 19 | yaml="{{ opts_yaml }}" | 55 | yaml="{{ opts_yaml }}" |
255 | 56 | when: latest == true | ||
256 | 20 | notify: | 57 | notify: |
257 | 21 | - calculate docker opts | 58 | - calculate docker opts |
258 | 22 | - render docker defaults | 59 | - render docker defaults |
259 | 60 | - restart docker | ||
260 | 23 | 61 | ||
261 | 24 | - name: set unit as a label | 62 | - name: set unit as a label |
262 | 25 | docker_opts: action=add | 63 | docker_opts: action=add |
263 | 26 | key=label val="{{ unit_label }}" | 64 | key=label val="{{ unit_label }}" |
264 | 27 | yaml="{{ opts_yaml }}" | 65 | yaml="{{ opts_yaml }}" |
265 | 66 | when: latest == true | ||
266 | 28 | notify: | 67 | notify: |
267 | 29 | - calculate docker opts | 68 | - calculate docker opts |
268 | 30 | - render docker defaults | 69 | - render docker defaults |
269 | 70 | - restart docker | ||
270 | 31 | 71 | ||
271 | 32 | - name: Install docker compose | 72 | - name: Install docker compose |
272 | 33 | include: install-compose.yaml | 73 | include: install-compose.yaml |
273 | 34 | 74 | ||
274 | === modified file 'playbooks/latest-docker.yaml' | |||
275 | --- playbooks/latest-docker.yaml 2015-06-03 17:16:46 +0000 | |||
276 | +++ playbooks/latest-docker.yaml 2015-09-14 21:25:51 +0000 | |||
277 | @@ -4,15 +4,20 @@ | |||
278 | 4 | when: universe_installed | 4 | when: universe_installed |
279 | 5 | 5 | ||
280 | 6 | - name: Add upstream apt key | 6 | - name: Add upstream apt key |
282 | 7 | apt_key: id=36A1D7869245C8950F966E92D8576A8BA88D21E9 keyserver=keyserver.ubuntu.com | 7 | apt_key: id=58118E89F3A912897C070ADBF76221572C52609D keyserver=keyserver.ubuntu.com |
283 | 8 | 8 | ||
284 | 9 | - name: Add Upstream apt repository | 9 | - name: Add Upstream apt repository |
286 | 10 | apt_repository: repo='deb https://get.docker.com/ubuntu docker main' state=present | 10 | apt_repository: repo='deb https://apt.dockerproject.org/repo ubuntu-trusty main' state=present |
287 | 11 | 11 | ||
288 | 12 | - debug: msg="Installing latest" | 12 | - debug: msg="Installing latest" |
289 | 13 | 13 | ||
290 | 14 | - name: Install required packages. | 14 | - name: Install required packages. |
292 | 15 | apt: name=lxc-docker-{{ version }} state=present update_cache=yes | 15 | apt: name=docker-engine={{version}} state=present update_cache=yes |
293 | 16 | when: version != "" | ||
294 | 17 | |||
295 | 18 | - name: Install docker-engine metapackage | ||
296 | 19 | apt: name=docker-engine state=present update_cache=yes | ||
297 | 20 | when: version == "" | ||
298 | 16 | 21 | ||
299 | 17 | - set_fact: | 22 | - set_fact: |
300 | 18 | docker_version_name: docker | ||
301 | 19 | \ No newline at end of file | 23 | \ No newline at end of file |
302 | 24 | docker_version_name: docker | ||
303 | 20 | 25 | ||
304 | === modified file 'playbooks/network-relation-changed.yaml' | |||
305 | --- playbooks/network-relation-changed.yaml 2015-06-03 17:16:46 +0000 | |||
306 | +++ playbooks/network-relation-changed.yaml 2015-09-14 21:25:51 +0000 | |||
307 | @@ -32,6 +32,7 @@ | |||
308 | 32 | notify: | 32 | notify: |
309 | 33 | - calculate docker opts | 33 | - calculate docker opts |
310 | 34 | - render docker defaults | 34 | - render docker defaults |
311 | 35 | - restart docker | ||
312 | 35 | 36 | ||
313 | 36 | - name: set subnet daemon option | 37 | - name: set subnet daemon option |
314 | 37 | docker_opts: action=set key=mtu val="{{ flannel_mtu }}" yaml="{{opts_yaml}}" | 38 | docker_opts: action=set key=mtu val="{{ flannel_mtu }}" yaml="{{opts_yaml}}" |
315 | @@ -39,6 +40,7 @@ | |||
316 | 39 | notify: | 40 | notify: |
317 | 40 | - calculate docker opts | 41 | - calculate docker opts |
318 | 41 | - render docker defaults | 42 | - render docker defaults |
319 | 43 | - restart docker | ||
320 | 42 | 44 | ||
321 | 43 | - name: Halt docker service | 45 | - name: Halt docker service |
322 | 44 | service: name={{docker_version_name}} state=stopped | 46 | service: name={{docker_version_name}} state=stopped |
323 | 45 | 47 | ||
324 | === modified file 'playbooks/site.yaml' | |||
325 | --- playbooks/site.yaml 2015-06-03 17:16:46 +0000 | |||
326 | +++ playbooks/site.yaml 2015-09-14 21:25:51 +0000 | |||
327 | @@ -3,12 +3,12 @@ | |||
328 | 3 | opts_yaml: /etc/ansible/docker-opts.yaml | 3 | opts_yaml: /etc/ansible/docker-opts.yaml |
329 | 4 | docker_version_name: false | 4 | docker_version_name: false |
330 | 5 | handlers: | 5 | handlers: |
331 | 6 | - name: restart docker | ||
332 | 7 | service: "name={{docker_version_name}} state=restarted" | ||
333 | 8 | - name: calculate docker opts | 6 | - name: calculate docker opts |
334 | 9 | docker_opts: "action=read yaml={{opts_yaml}}" | 7 | docker_opts: "action=read yaml={{opts_yaml}}" |
335 | 10 | - name: render docker defaults | 8 | - name: render docker defaults |
336 | 11 | template: "src=templates/docker-defaults dest=/etc/default/{{docker_version_name}}" | 9 | template: "src=templates/docker-defaults dest=/etc/default/{{docker_version_name}}" |
337 | 10 | - name: restart docker | ||
338 | 11 | service: "name={{docker_version_name}} state=restarted" | ||
339 | 12 | tasks: | 12 | tasks: |
340 | 13 | - name: Check Installation Status | 13 | - name: Check Installation Status |
341 | 14 | include: installation-status.yaml | 14 | include: installation-status.yaml |
342 | 15 | 15 | ||
343 | === modified file 'tests/10-deploy-test' | |||
344 | --- tests/10-deploy-test 2015-06-02 17:33:17 +0000 | |||
345 | +++ tests/10-deploy-test 2015-09-14 21:25:51 +0000 | |||
346 | @@ -15,7 +15,7 @@ | |||
347 | 15 | """ This method is run once at class creation. """ | 15 | """ This method is run once at class creation. """ |
348 | 16 | self.deployment = amulet.Deployment(series='trusty') | 16 | self.deployment = amulet.Deployment(series='trusty') |
349 | 17 | 17 | ||
351 | 18 | self.deployment.add('docker') | 18 | self.deployment.add('docker', 'local:trusty/docker') |
352 | 19 | 19 | ||
353 | 20 | try: | 20 | try: |
354 | 21 | self.deployment.setup(timeout=seconds) | 21 | self.deployment.setup(timeout=seconds) |
355 | @@ -66,20 +66,33 @@ | |||
356 | 66 | def test_latest_config_option(self): | 66 | def test_latest_config_option(self): |
357 | 67 | """ Set config option to latest and verify docker is installed """ | 67 | """ Set config option to latest and verify docker is installed """ |
358 | 68 | self.deployment.configure('docker', {'latest': True, | 68 | self.deployment.configure('docker', {'latest': True, |
360 | 69 | 'version': '1.5.0'}) | 69 | 'version': '1.8.1-0~trusty'}) |
361 | 70 | self.deployment.sentry.wait() | 70 | self.deployment.sentry.wait() |
363 | 71 | command = 'dpkg -l lxc-docker-1.5.0' | 71 | import time |
364 | 72 | print("sleeping 15 seconds because reasons") | ||
365 | 73 | time.sleep(15) | ||
366 | 74 | command = 'dpkg -l docker-engine' | ||
367 | 72 | output, code = self.docker_unit.run(command) | 75 | output, code = self.docker_unit.run(command) |
368 | 73 | print(output) | ||
369 | 74 | if output.find('ii') == -1: | 76 | if output.find('ii') == -1: |
370 | 75 | message = 'Could not upgrade docker to latest!' | 77 | message = 'Could not upgrade docker to latest!' |
371 | 76 | amulet.raise_status(amulet.FAIL, msg=message) | 78 | amulet.raise_status(amulet.FAIL, msg=message) |
372 | 77 | command = 'dpkg -l docker.io' | 79 | command = 'dpkg -l docker.io' |
373 | 78 | output, code = self.docker_unit.run(command) | 80 | output, code = self.docker_unit.run(command) |
374 | 79 | print(output) | ||
375 | 80 | if output.find('ii') != -1: | 81 | if output.find('ii') != -1: |
376 | 81 | message = "Leftover docker.io package found" | 82 | message = "Leftover docker.io package found" |
377 | 82 | amulet.raise_status(amulet.Fail, msg=message) | 83 | amulet.raise_status(amulet.Fail, msg=message) |
378 | 83 | 84 | ||
379 | 85 | def test_latest_config_option_aufs_enabled(self): | ||
380 | 86 | ''' | ||
381 | 87 | This test has a byproduct of actually checking to make sure | ||
382 | 88 | we are cleaning up the broken devicemapper leftovers. Which | ||
383 | 89 | is totally cool | ||
384 | 90 | ''' | ||
385 | 91 | # Random failures that require a sleep... so remove the sleep | ||
386 | 92 | # and recycle the service a second time. | ||
387 | 93 | command = "docker info" | ||
388 | 94 | output, code = self.docker_unit.run(command) | ||
389 | 95 | assert "aufs" in output | ||
390 | 96 | |||
391 | 84 | if __name__ == '__main__': | 97 | if __name__ == '__main__': |
392 | 85 | unittest.main() | 98 | unittest.main() |
393 | 86 | 99 | ||
394 | === modified file 'tests/tests.yaml' | |||
395 | --- tests/tests.yaml 2015-07-10 20:52:16 +0000 | |||
396 | +++ tests/tests.yaml 2015-09-14 21:25:51 +0000 | |||
397 | @@ -1,4 +1,3 @@ | |||
398 | 1 | virtualenv: false | 1 | virtualenv: false |
399 | 2 | makefile: | 2 | makefile: |
400 | 3 | - lint | 3 | - lint |
401 | 4 | - unit_test |
Hey Chuck,
Thanks for this update to the docker charm. As we discussed over IRC this branch does not merge cleanly with the trusty/docker that is in the store.
Please fix the branch and resubmit. Thank you.