Skip to content
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

Merged
merged 9 commits into from Dec 18, 2014

Conversation

wallyworld
Copy link
Member

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/)

@wallyworld
Copy link
Member Author

$$merge$$

@jujubot
Copy link
Collaborator

jujubot commented Dec 16, 2014

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

@jujubot
Copy link
Collaborator

jujubot commented Dec 16, 2014

Build failed: Does not match ['fixes-1402826']
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/1610

@wallyworld
Copy link
Member Author

$$merge$$

@jujubot
Copy link
Collaborator

jujubot commented Dec 17, 2014

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

@jujubot
Copy link
Collaborator

jujubot commented Dec 17, 2014

Build failed: Generating tarball failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/1661

@wallyworld
Copy link
Member Author

$$merge$$

@jujubot
Copy link
Collaborator

jujubot commented Dec 17, 2014

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

@jujubot
Copy link
Collaborator

jujubot commented Dec 17, 2014

Build failed: Does not match ['fixes-1403546', 'fixes-1403596']
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/1667

@wallyworld
Copy link
Member Author

$$merge$$

@jujubot
Copy link
Collaborator

jujubot commented Dec 18, 2014

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

@jujubot
Copy link
Collaborator

jujubot commented Dec 18, 2014

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/1672

@wallyworld
Copy link
Member Author

$$merge$$

@jujubot
Copy link
Collaborator

jujubot commented Dec 18, 2014

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

@jujubot
Copy link
Collaborator

jujubot commented Dec 18, 2014

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/1677

@wallyworld
Copy link
Member Author

$$merge$$

@jujubot
Copy link
Collaborator

jujubot commented Dec 18, 2014

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

@jujubot
Copy link
Collaborator

jujubot commented Dec 18, 2014

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/1679

@wallyworld
Copy link
Member Author

$$merge$$

@jujubot
Copy link
Collaborator

jujubot commented Dec 18, 2014

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

jujubot added a commit that referenced this pull request Dec 18, 2014
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/)
@jujubot jujubot merged commit 3b3bf2f into juju:master Dec 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants