Merge lp:~lazypower/charms/trusty/docker/i-hate-bzr into lp:charms/trusty/docker

Proposed by Charles Butler
Status: Work in progress
Proposed branch: lp:~lazypower/charms/trusty/docker/i-hate-bzr
Merge into: lp:charms/trusty/docker
Diff against target: 200 lines (+74/-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 (+13/-2)
To merge this branch: bzr merge lp:~lazypower/charms/trusty/docker/i-hate-bzr
Reviewer Review Type Date Requested Status
Matt Bruzek (community) Needs Fixing
Review via email: mp+265462@code.launchpad.net

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.

To post a comment you must log in.
8. By Charles Butler

Removes local charm from test

Revision history for this message
Matt Bruzek (mbruzek) wrote :

This branch seems to merge successfully, I think you have mastered bzr.

I like the changes in made in this pull request, but the tests do not pass on bundletester on azure or kvm.

Issue #1: There may be something wrong with the way you install charm-tools. Running "make lint" fails with "SyntaxError: invalid syntax". I created a bug about this problem: https://bugs.launchpad.net/charm-tools/+bug/1477194

This error may be related to your use of tox or how you install charm-tools. I was able to "pip install charm-tools" in another virtualenv WITHOUT any Syntax errors.

Issue #2: The docker daemon does not start on the unit. At the end of the tests I expect to see the docker daemon running on the unit and it is not.

Issue #3: I believe the test that checks for version 1.7.0 needs a sleep after the wait. I have created a merge proposal for this branch https://code.launchpad.net/~mbruzek/charms/trusty/docker/sleep5/+merge/265554 with my suggestion.

review: Needs Fixing

Unmerged revisions

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
=== modified file 'Makefile'
--- Makefile 2015-07-10 20:52:16 +0000
+++ Makefile 2015-07-21 21:47:33 +0000
@@ -6,7 +6,7 @@
6/usr/bin/tox:6/usr/bin/tox:
7 sudo apt-get install -y python-tox python-dev python-virtualenv7 sudo apt-get install -y python-tox python-dev python-virtualenv
88
9lint: /usr/bin/tox 9lint: /usr/bin/tox
10 tox -e lint10 tox -e lint
1111
1212
1313
=== modified file 'README.md'
--- README.md 2015-07-17 13:22:34 +0000
+++ README.md 2015-07-21 21:47:33 +0000
@@ -22,7 +22,7 @@
2222
23Step by step instructions on using the docker charm:23Step by step instructions on using the docker charm:
2424
25 juju deploy cs:trusty/docker25 juju deploy cs:~lazypower/trusty/docker
2626
27## Scale out Usage27## Scale out Usage
2828
@@ -47,6 +47,15 @@
47 leverage a yaml file to spin up and manage multiple containers that47 leverage a yaml file to spin up and manage multiple containers that
48 comprise a single application stack.48 comprise a single application stack.
4949
50- aufs : **new as of v0.1.6** Defaults the backend storage driver to AUFS. The
51 older option of device mapper was horribly broken in most setups, and has
52 been completely depreciated by the Docker foundation. Disable to keep the
53 DeviceMapper backend. - Not recommended. **note** this will break existing
54 containers if you upgrade existing setups. Ensure you account for this when
55 upgrading your docker clusters that are previously deployed with this charm.
56
57 > See blurb under Known Issues for migration instructions.
58
50## Known Limitations and Issues59## Known Limitations and Issues
5160
5261
@@ -86,7 +95,16 @@
86There is however [a bug](https://github.com/chuckbutler/docker-charm/issues/13) to track the95There is however [a bug](https://github.com/chuckbutler/docker-charm/issues/13) to track the
87progress of this feature.96progress of this feature.
8897
8998#### AUFS Upgrade Stopped my containers from working
99
100If you have older containers deployed and running, you will need to pause them
101and export. Once the tarballs of the containers have been exported - upgrade
102your cluster and reimport following the CLI instructions below as a guide
103
104 docker export <<container id>> > mycontainer-latest.tgz
105 # upgrade
106 docker import -i mycontainer-latest - mycontainer:latest
107 docker run <<options>> mycontainer:latest
90108
91109
92# Contact Information110# Contact Information
93111
=== modified file 'config.yaml'
--- config.yaml 2015-07-10 20:52:16 +0000
+++ config.yaml 2015-07-21 21:47:33 +0000
@@ -16,4 +16,12 @@
16 default: true16 default: true
17 description: |17 description: |
18 Install docker compose, the formation launch utility18 Install docker compose, the formation launch utility
1919 aufs:
20 type: boolean
21 default: true
22 description: |
23 Change the backend storage driver from devicemapper to AUFS.
24 The device mapper storage engine is known to be problematic, and AUFS
25 is not enabled by default in Ubuntu. This will install AUFS support and
26 swap the backend. **NOTE** It is not recommended to reconfigure this post
27 deployment. You may incur dataloss.
2028
=== removed file 'hooks/setup.py'
--- hooks/setup.py 2015-07-17 13:22:34 +0000
+++ hooks/setup.py 1970-01-01 00:00:00 +0000
@@ -1,22 +0,0 @@
1import subprocess
2import sys
3import os
4
5
6def pre_install():
7 """
8 Do any setup required before the install hook.
9 """
10 try:
11 import charmhelpers # noqa
12 import ansiblecharm # noqa
13 from path import path # noqa
14 except ImportError:
15 subprocess.check_call(['hooks/setup.sh'])
16 subprocess.check_call("pip install -r hooks/python-pkgs.txt",
17 shell=True)
18
19 from path import path
20
21 pth = str(path(os.environ['CHARM_DIR']) / 'src/ansiblecharm')
22 sys.path.append(pth)
230
=== removed file 'hooks/setup.sh'
--- hooks/setup.sh 2015-06-10 20:39:25 +0000
+++ hooks/setup.sh 1970-01-01 00:00:00 +0000
@@ -1,9 +0,0 @@
1#!/bin/bash
2set -e
3
4apt-get install -y \
5 python-dev \
6 python-pip \
7 git
8
9easy_install -U pip
100
=== modified file 'playbooks/config-changed.yaml'
--- playbooks/config-changed.yaml 2015-06-10 20:39:25 +0000
+++ playbooks/config-changed.yaml 2015-07-21 21:47:33 +0000
@@ -13,6 +13,36 @@
13 service_label: "service={{ service_name }}"13 service_label: "service={{ service_name }}"
14 unit_label: "unit={{ local_unit }}"14 unit_label: "unit={{ local_unit }}"
1515
16- name: grab release info
17 shell: uname -r
18 register: rel
19 when: aufs == true
20
21- set_fact:
22 thisrel: "{{ rel.stdout }}"
23 when: aufs == true
24
25- name: Install AUFS backend supporting packages
26 apt: name={{item}} state=present
27 with_items:
28 - "linux-image-extra-{{thisrel}}"
29 - aufs-tools
30 when: aufs == true
31
32- name: stop docker to remove device mapper
33 service: "name={{docker_version_name}} state=stopped"
34 when: aufs == true
35
36- name: Remove Devicemapper backend if present
37 file: path=/var/lib/docker/devicemapper state=absent
38 when: aufs == true
39
40- name: Register AUFS option
41 docker_opts: action=add
42 key="storage-driver" val="aufs"
43 yaml="{{ opts_yaml }}"
44 when: aufs == true
45
16- name: set service name as a label46- name: set service name as a label
17 docker_opts: action=add47 docker_opts: action=add
18 key=label val="{{ service_label }}"48 key=label val="{{ service_label }}"
@@ -28,6 +58,7 @@
28 notify:58 notify:
29 - calculate docker opts59 - calculate docker opts
30 - render docker defaults60 - render docker defaults
61 - restart docker
3162
32- name: Install docker compose63- name: Install docker compose
33 include: install-compose.yaml64 include: install-compose.yaml
3465
=== modified file 'tests/10-deploy-test'
--- tests/10-deploy-test 2015-06-02 17:33:17 +0000
+++ tests/10-deploy-test 2015-07-21 21:47:33 +0000
@@ -66,9 +66,9 @@
66 def test_latest_config_option(self):66 def test_latest_config_option(self):
67 """ Set config option to latest and verify docker is installed """67 """ Set config option to latest and verify docker is installed """
68 self.deployment.configure('docker', {'latest': True,68 self.deployment.configure('docker', {'latest': True,
69 'version': '1.5.0'})69 'version': '1.7.0'})
70 self.deployment.sentry.wait()70 self.deployment.sentry.wait()
71 command = 'dpkg -l lxc-docker-1.5.0'71 command = 'dpkg -l lxc-docker-1.7.0'
72 output, code = self.docker_unit.run(command)72 output, code = self.docker_unit.run(command)
73 print(output)73 print(output)
74 if output.find('ii') == -1:74 if output.find('ii') == -1:
@@ -81,5 +81,16 @@
81 message = "Leftover docker.io package found"81 message = "Leftover docker.io package found"
82 amulet.raise_status(amulet.Fail, msg=message)82 amulet.raise_status(amulet.Fail, msg=message)
8383
84 def test_latest_config_aufs_enabled(self):
85 '''
86 This test has a byproduct of actually checking to make sure
87 we are cleaning up the broken devicemapper leftovers. Which
88 is totally cool
89 '''
90 command = "docker info"
91 output, code = self.docker_unit.run(command)
92 print(output)
93 assert "aufs" in output
94
84if __name__ == '__main__':95if __name__ == '__main__':
85 unittest.main()96 unittest.main()

Subscribers

People subscribed via source and target branches

to all changes: