Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Show progress for kvm containers #7122
Conversation
jameinel
added some commits
Mar 19, 2017
|
Note, the minimal fix for https://bugs.launchpad.net/juju/+bug/1674074 could be done by just adding the one line that sets the container status to Running. But this is a bit nicer as it can take a couple minutes to download the container image. I tested this live on a MAAS setup, since that is one of the few places that easily supports KVM instances. |
jameinel
added some commits
Mar 19, 2017
| // Sync updates the local cached images by reading the simplestreams data and | ||
| // caching if an image matching the contrainsts doesn't exist. It retrieves | ||
| // metadata information from Oner and updates local cache via Fetcher. | ||
| -func Sync(o Oner, f Fetcher) error { | ||
| +func Sync(o Oner, f Fetcher, progress ProgressCallback) error { |
| + | ||
| +var _ (io.Writer) = (*progressWriter)(nil) | ||
| + | ||
| +var modifiers = []string{"k", "M", "G"} |
axw
Mar 20, 2017
Member
FYI we already have dustin/go-humanize:
fmt.Sprintf("%s/s", humanize.IBytes(bytes))|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Generating tarball failed |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Generating tarball failed |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
jameinel commentedMar 19, 2017
•
Edited 1 time
-
jameinel
Mar 19, 2017
Description of change
KVM containers were only showing "Starting container, this might take a while". But not giving any sense for what it was actually doing. This makes it slightly better by giving a progress message (number of bytes copied, progress %) while the container is being started, and then changing the final message to indicate the machine is running.
QA steps
Without this patch, there would only be a message:
With this patch, you should see messages like:
And a final status of:
this matches the LXD container status. The progress message should be pretty close, and the final status is the same.
Documentation changes
This is user visible, but as it is informative, I don't think it needs documentation changes.
Bug reference
lp:1674074