Merge lp:~townsend/libertine/use-lxc-exec into lp:libertine

Proposed by Christopher Townsend
Status: Merged
Approved by: Larry Price
Approved revision: 381
Merged at revision: 381
Proposed branch: lp:~townsend/libertine/use-lxc-exec
Merge into: lp:libertine
Diff against target: 31 lines (+5/-3)
1 file modified
python/libertine/LxdContainer.py (+5/-3)
To merge this branch: bzr merge lp:~townsend/libertine/use-lxc-exec
Reviewer Review Type Date Requested Status
Libertine CI Bot continuous-integration Approve
Larry Price Approve
Review via email: mp+315158@code.launchpad.net

Commit message

Replace all pylxd execute()'s with calls to 'lxc exec' as pylxd has performance issues in execute().

To post a comment you must log in.
Revision history for this message
Libertine CI Bot (libertine-ci-bot) wrote :

PASSED: Continuous integration, rev:380
https://jenkins.canonical.com/libertine/job/lp-libertine-ci/338/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/libertine/job/build/665
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=default/545
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=zesty,testname=default/545
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=xenial+overlay,testname=default/545
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=zesty,testname=default/545
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-0-fetch/675
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/656
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/656/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=zesty/656
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=zesty/656/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/656
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/656/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=zesty/656
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=zesty/656/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/libertine/job/lp-libertine-ci/338/rebuild

review: Approve (continuous-integration)
Revision history for this message
Larry Price (larryprice) wrote :

one inline

review: Needs Information
lp:~townsend/libertine/use-lxc-exec updated
381. By Christopher Townsend

Update based on review.

Revision history for this message
Larry Price (larryprice) wrote :

lgtm

review: Approve
Revision history for this message
Libertine CI Bot (libertine-ci-bot) wrote :

PASSED: Continuous integration, rev:381
https://jenkins.canonical.com/libertine/job/lp-libertine-ci/339/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/libertine/job/build/666
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=default/546
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=zesty,testname=default/546
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=xenial+overlay,testname=default/546
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=zesty,testname=default/546
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-0-fetch/676
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/657
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/657/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=zesty/657
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=zesty/657/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/657
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/657/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=zesty/657
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=zesty/657/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/libertine/job/lp-libertine-ci/339/rebuild

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'python/libertine/LxdContainer.py'
2--- python/libertine/LxdContainer.py 2017-01-19 15:01:38 +0000
3+++ python/libertine/LxdContainer.py 2017-01-19 19:14:27 +0000
4@@ -117,7 +117,7 @@
5 [ -n /dev/video0 ] && chgrp video /dev/video0
6 '''[1:-1]
7 container.files.put('/usr/bin/libertine-lxd-mount-update', script.format(uid=uid, username=username).encode('utf-8'))
8- container.execute(shlex.split('chmod 755 /usr/bin/libertine-lxd-mount-update'))
9+ subprocess.Popen(shlex.split("lxc exec {} -- chmod 755 /usr/bin/libertine-lxd-mount-update".format(container.name)))
10
11
12 def lxd_container(client, container_id):
13@@ -129,7 +129,9 @@
14
15 def _wait_for_network(container):
16 for retries in range(0, 10):
17- out, err = container.execute(shlex.split('ping -c 1 ubuntu.com'))
18+ ping = subprocess.Popen(shlex.split("lxc exec {} -- ping -c 1 ubuntu.com".format(container.name)),
19+ stdout=subprocess.PIPE, stderr=subprocess.PIPE)
20+ out, err = ping.communicate()
21 if out:
22 utils.get_logger().info("Network connection active")
23 return True
24@@ -483,7 +485,7 @@
25 return False
26
27 if requires_remount:
28- self._container.execute(shlex.split('/usr/bin/libertine-lxd-mount-update'))
29+ self.run_in_container("/usr/bin/libertine-lxd-mount-update")
30
31 args = self._lxc_args("sudo -E -u {} env PATH={}".format(environ['USER'], environ['PATH']), environ)
32

Subscribers

People subscribed via source and target branches