New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add capability to cache lxc images used for starting lxc containers #1205
Conversation
61895f5
to
b382437
Compare
7984449
to
67a3ce4
Compare
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
Build failed: Does not match ['fixes-1402826'] |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
Build failed: Generating tarball failed |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
Build failed: Does not match ['fixes-1403546', 'fixes-1403596'] |
67a3ce4
to
134c8df
Compare
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
Build failed: Tests failed |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
Build failed: Tests failed |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
Build failed: Tests failed |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
Add capability to cache lxc images used for starting lxc containers LXC image blobs are now cached in the state server blob store. These changes do 2 things: 1. Faster container initialisation on all machines since each time a new node is created, the container image needs to be fetched. 2. Better expiry/replacement of old images. Because image requests come through Juju, Juju can decide to fetch a more recent image if the currently cached one is deemed too old. There's a few new moving parts to make this work: 1. Image storage facility in state/imagestorage This writes the image blobs and metadata to state storage. 2. HTTP service used to GET image blobs in apiserver This serves image blobs from the state blob store. 3. LXC container creation changes The -T parameter is used to instruct lxc-create to fetch the image blob from the state server rather than https://cloud-images.com When the lxc-create script asks the state server for an image blob, if it is not yet in the database, the state server will fetch it from https://cloud-images, cache it in the blob store, and hand it back to lxc-create. When stored in the state server, the metadata includes the time at which the image was cached. A similar workflow is already used to handle tools tarballs. (Review request: http://reviews.vapour.ws/r/515/)
LXC image blobs are now cached in the state server blob store.
These changes do 2 things:
There's a few new moving parts to make this work:
This writes the image blobs and metadata to state storage.
This serves image blobs from the state blob store.
The -T parameter is used to instruct lxc-create to fetch the image blob from the state server rather than https://cloud-images.com
When the lxc-create script asks the state server for an image blob, if it is not yet in the database, the state server will fetch it from https://cloud-images, cache it in the blob store, and hand it back to lxc-create. When stored in the state server, the metadata includes the time at which the image was cached.
A similar workflow is already used to handle tools tarballs.
(Review request: http://reviews.vapour.ws/r/515/)