Merge lp:~mbruzek/charms/trusty/docker/sleep5 into lp:charms/trusty/docker

Proposed by Matt Bruzek
Status: Work in progress
Proposed branch: lp:~mbruzek/charms/trusty/docker/sleep5
Merge into: lp:charms/trusty/docker
Diff against target: 203 lines (+77/-37)
7 files modified
Makefile (+1/-1)
README.md (+20/-2)
config.yaml (+9/-1)
hooks/setup.py (+0/-22)
hooks/setup.sh (+0/-9)
playbooks/config-changed.yaml (+31/-0)
tests/10-deploy-test (+16/-2)
To merge this branch: bzr merge lp:~mbruzek/charms/trusty/docker/sleep5
Reviewer Review Type Date Requested Status
charmers Pending
Review via email: mp+265554@code.launchpad.net

Description of the change

Hey Chuck,

I think your 10-deploy-test needs a sleep for 5 seconds after the wait to run successfully.

Please consider my merge.

Thanks!

To post a comment you must log in.

Unmerged revisions

9. By Matt Bruzek

Adding a sleep for 5 seconds after the wait to give the system time to update.

8. By Charles Butler

Removes local charm from test

7. By Charles Butler

Fresh tree to deal with BZRs inconsistent lack of brain cells

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile'
2--- Makefile 2015-07-10 20:52:16 +0000
3+++ Makefile 2015-07-22 15:05:50 +0000
4@@ -6,7 +6,7 @@
5 /usr/bin/tox:
6 sudo apt-get install -y python-tox python-dev python-virtualenv
7
8-lint: /usr/bin/tox
9+lint: /usr/bin/tox
10 tox -e lint
11
12
13
14=== modified file 'README.md'
15--- README.md 2015-07-17 13:22:34 +0000
16+++ README.md 2015-07-22 15:05:50 +0000
17@@ -22,7 +22,7 @@
18
19 Step by step instructions on using the docker charm:
20
21- juju deploy cs:trusty/docker
22+ juju deploy cs:~lazypower/trusty/docker
23
24 ## Scale out Usage
25
26@@ -47,6 +47,15 @@
27 leverage a yaml file to spin up and manage multiple containers that
28 comprise a single application stack.
29
30+- aufs : **new as of v0.1.6** Defaults the backend storage driver to AUFS. The
31+ older option of device mapper was horribly broken in most setups, and has
32+ been completely depreciated by the Docker foundation. Disable to keep the
33+ DeviceMapper backend. - Not recommended. **note** this will break existing
34+ containers if you upgrade existing setups. Ensure you account for this when
35+ upgrading your docker clusters that are previously deployed with this charm.
36+
37+ > See blurb under Known Issues for migration instructions.
38+
39 ## Known Limitations and Issues
40
41
42@@ -86,7 +95,16 @@
43 There is however [a bug](https://github.com/chuckbutler/docker-charm/issues/13) to track the
44 progress of this feature.
45
46-
47+#### AUFS Upgrade Stopped my containers from working
48+
49+If you have older containers deployed and running, you will need to pause them
50+and export. Once the tarballs of the containers have been exported - upgrade
51+your cluster and reimport following the CLI instructions below as a guide
52+
53+ docker export <<container id>> > mycontainer-latest.tgz
54+ # upgrade
55+ docker import -i mycontainer-latest - mycontainer:latest
56+ docker run <<options>> mycontainer:latest
57
58
59 # Contact Information
60
61=== modified file 'config.yaml'
62--- config.yaml 2015-07-10 20:52:16 +0000
63+++ config.yaml 2015-07-22 15:05:50 +0000
64@@ -16,4 +16,12 @@
65 default: true
66 description: |
67 Install docker compose, the formation launch utility
68-
69+ aufs:
70+ type: boolean
71+ default: true
72+ description: |
73+ Change the backend storage driver from devicemapper to AUFS.
74+ The device mapper storage engine is known to be problematic, and AUFS
75+ is not enabled by default in Ubuntu. This will install AUFS support and
76+ swap the backend. **NOTE** It is not recommended to reconfigure this post
77+ deployment. You may incur dataloss.
78
79=== removed file 'hooks/setup.py'
80--- hooks/setup.py 2015-07-17 13:22:34 +0000
81+++ hooks/setup.py 1970-01-01 00:00:00 +0000
82@@ -1,22 +0,0 @@
83-import subprocess
84-import sys
85-import os
86-
87-
88-def pre_install():
89- """
90- Do any setup required before the install hook.
91- """
92- try:
93- import charmhelpers # noqa
94- import ansiblecharm # noqa
95- from path import path # noqa
96- except ImportError:
97- subprocess.check_call(['hooks/setup.sh'])
98- subprocess.check_call("pip install -r hooks/python-pkgs.txt",
99- shell=True)
100-
101- from path import path
102-
103- pth = str(path(os.environ['CHARM_DIR']) / 'src/ansiblecharm')
104- sys.path.append(pth)
105
106=== removed file 'hooks/setup.sh'
107--- hooks/setup.sh 2015-06-10 20:39:25 +0000
108+++ hooks/setup.sh 1970-01-01 00:00:00 +0000
109@@ -1,9 +0,0 @@
110-#!/bin/bash
111-set -e
112-
113-apt-get install -y \
114- python-dev \
115- python-pip \
116- git
117-
118-easy_install -U pip
119
120=== modified file 'playbooks/config-changed.yaml'
121--- playbooks/config-changed.yaml 2015-06-10 20:39:25 +0000
122+++ playbooks/config-changed.yaml 2015-07-22 15:05:50 +0000
123@@ -13,6 +13,36 @@
124 service_label: "service={{ service_name }}"
125 unit_label: "unit={{ local_unit }}"
126
127+- name: grab release info
128+ shell: uname -r
129+ register: rel
130+ when: aufs == true
131+
132+- set_fact:
133+ thisrel: "{{ rel.stdout }}"
134+ when: aufs == true
135+
136+- name: Install AUFS backend supporting packages
137+ apt: name={{item}} state=present
138+ with_items:
139+ - "linux-image-extra-{{thisrel}}"
140+ - aufs-tools
141+ when: aufs == true
142+
143+- name: stop docker to remove device mapper
144+ service: "name={{docker_version_name}} state=stopped"
145+ when: aufs == true
146+
147+- name: Remove Devicemapper backend if present
148+ file: path=/var/lib/docker/devicemapper state=absent
149+ when: aufs == true
150+
151+- name: Register AUFS option
152+ docker_opts: action=add
153+ key="storage-driver" val="aufs"
154+ yaml="{{ opts_yaml }}"
155+ when: aufs == true
156+
157 - name: set service name as a label
158 docker_opts: action=add
159 key=label val="{{ service_label }}"
160@@ -28,6 +58,7 @@
161 notify:
162 - calculate docker opts
163 - render docker defaults
164+ - restart docker
165
166 - name: Install docker compose
167 include: install-compose.yaml
168
169=== modified file 'tests/10-deploy-test'
170--- tests/10-deploy-test 2015-06-02 17:33:17 +0000
171+++ tests/10-deploy-test 2015-07-22 15:05:50 +0000
172@@ -66,9 +66,12 @@
173 def test_latest_config_option(self):
174 """ Set config option to latest and verify docker is installed """
175 self.deployment.configure('docker', {'latest': True,
176- 'version': '1.5.0'})
177+ 'version': '1.7.0'})
178 self.deployment.sentry.wait()
179- command = 'dpkg -l lxc-docker-1.5.0'
180+ # The deployment needs a few more seconds before running the dkpg command.
181+ import time
182+ time.sleep(5)
183+ command = 'dpkg -l lxc-docker-1.7.0'
184 output, code = self.docker_unit.run(command)
185 print(output)
186 if output.find('ii') == -1:
187@@ -81,5 +84,16 @@
188 message = "Leftover docker.io package found"
189 amulet.raise_status(amulet.Fail, msg=message)
190
191+ def test_latest_config_aufs_enabled(self):
192+ '''
193+ This test has a byproduct of actually checking to make sure
194+ we are cleaning up the broken devicemapper leftovers. Which
195+ is totally cool
196+ '''
197+ command = "docker info"
198+ output, code = self.docker_unit.run(command)
199+ print(output)
200+ assert "aufs" in output
201+
202 if __name__ == '__main__':
203 unittest.main()

Subscribers

People subscribed via source and target branches

to all changes: