-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
builders: simplified image progress reporting #9212
Conversation
@bparees ptal |
this will make @johnkeck very happy. Can you put a sample of the output (at default log levels) in this PR? it looks like it'll fallback to the existing output behavior at higher log levels? (i think that's good). Also what are the odds of docker changing the json status format and completely breaking this? do they make any statements around the api stability of it? |
@@ -265,8 +267,8 @@ func (s *S2IBuilder) Build() error { | |||
} else { | |||
glog.V(2).Infof("No push secret provided") | |||
} | |||
glog.V(1).Infof("Pushing %s image ...", pushTag) | |||
if err := pushImage(s.dockerClient, pushTag, pushAuthConfig); err != nil { | |||
fmt.Fprintf(s.out, "Pushing %s image ...\n", pushTag) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this changing from glog? (which is not really glog anyway it's the wrapper glog clayton created)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because I want it to be printed regardless of the log level, given that image push progress is going to be written to the same output stream.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
V(0) should handle that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(even V(1) is always enabled unless someone did something weird)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool, will update
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
V(1) wasn't showing anything for me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't understand that, our default log level is "2" i believe, you should see any glog.V(2) and below messages.... what messages were you seeing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I start with no loglevel set ('oc cluster up'), I get this (no v(1) messages):
...
Copying built war files into /wildfly/standalone/deployments for later deployment...
...done
Waiting to push 12 layers
Pushing 4 layers ( 10%), 1 pending
Pushing 5 layers ( 16%)
Pushing 4 layers ( 24%)
Pushing 4 layers ( 50%)
Pushing 3 layers ( 49%)
Pushing 3 layers ( 77%)
Pushing 2 layers ( 73%)
Pushing 1 layer (100%)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so w/ existing master, if i do openshift start w/ no loglevel, i get this message:
Creating a new S2I builder with build config: blah blah blah.....
which is logged at level 2:
glog.V(2).Infof("Creating a new S2I builder with build config: %#v\n", describe.DescribeConfig(config))
yes
Not sure, there's no statement about its stability in the official API doc, but given that it hasn't changed since as far back as I know of (docker 1.4), I'd say it's pretty stable. |
Updated with comments so far.
At any given point, I have 3 counts of layers ... # pending, # being pushed, #completed. Should I also include the # of completed layers in the status? Also, the percent that I'm showing is the percent progress of layers actively being pushed (not total percent). Would it make more sense if I have something like:
|
does it work with docker1.10? if so i'm convinced since they broke everything else in 1.10 :) |
amazingly it does :) ... I've tried both 1.10 and 1.11 |
yes i like that second format that shows the count of layers in each status (waiting, complete, etc). what i'm still not clear on is what the percentage represents. percentage of the total data for layers that are currently being pushed? percentage of the total data including layers that are waiting? something else entirely? (percentage of the number of layers?) |
1 - percentage of the total data for layers that are currently being pushed |
@@ -116,11 +116,11 @@ func (d *DockerBuilder) Build() error { | |||
if authPresent { | |||
glog.V(4).Infof("Authenticating Docker push with user %q", pushAuthConfig.Username) | |||
} | |||
glog.V(1).Infof("Pushing image %s ...", pushTag) | |||
glog.V(0).Infof("Pushing image %s ...", pushTag) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not your fault but this message format and the message format in sti.go are different, can you sync them?
that means the percentage could go down as layers that were waiting enter the pushing(or pulling) state, right? that seems bad/confusing for a user. |
right, that's why I wanted to word it in a way that would be non-confusing. I could try to get a cumulative percent, but it's harder. I have no way of knowing the size of layers that are pending until they actually start pushing. |
if you know the number of layers up front, can you slice the 100% by number of layers, then slice each subsection by percentage of layer size? |
@liggitt that's a good idea ... I can try doing that. It would at least make it more understandable. |
udpated using @liggitt's suggestion and also updated the pull call in @smarterclayton's dockerfile builder. |
dockerbuild output:
oc cluster up output:
builder output:
|
[test] On Wed, Jun 8, 2016 at 2:37 PM, Cesar Wong [email protected] wrote:
|
@@ -17,6 +17,8 @@ import ( | |||
"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive" | |||
"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/fileutils" | |||
"github.com/golang/glog" | |||
|
|||
"github.com/openshift/origin/pkg/cmd/util/imageprogress" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately you can't take this dependency because we are going to move the builder out of our repo. You can put image progress as a sub package of this code though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, will move
Updating to new format suggested by @liggitt. I think I like it better:
|
One minor nit (because of your output) - we don't need to say where we On Wed, Jun 8, 2016 at 4:41 PM, Cesar Wong [email protected] wrote:
|
@@ -265,7 +265,7 @@ func (s *S2IBuilder) Build() error { | |||
} else { | |||
glog.V(2).Infof("No push secret provided") | |||
} | |||
glog.V(1).Infof("Pushing %s image ...", pushTag) | |||
glog.V(0).Infof("Pushing image %s ...", pushTag) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would like to see this loglevel issue sorted out before merging because ideally i'd like to reserve "0" for warnings/errors and "1" for info we always want to show.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll switch it back to 1 and open an issue to investigate "oc cluster up"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened issue #9247
Addressed comments, latest output, thx @liggitt for your suggestions: oc cluster up:
build:
dockerbuild:
|
@@ -118,31 +118,11 @@ func (h *Helper) CheckAndPull(image string, out io.Writer) error { | |||
} | |||
glog.V(5).Infof("Image %q not found. Pulling", image) | |||
fmt.Fprintf(out, "Pulling image %s\n", image) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when you go to resolve the logging issue in oc cluster up, you should change this to a glog call also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(and all the other fmt statements in this file)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The output stream in cluster up is doing indenting for me. I also don't want the output to be log-like output since it's just a regular cli cmd. Only if you turn up the loglevel you get the glog output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it
? |
So it's the % complete is calculated by taking the portion of completed layers + the percent progress of pulling/pushing layers. In this case, you likely have multiple layers that are getting actively pushed with various levels of progress. |
ok. lgtm. |
Evaluated for origin test up to 1497ef6 |
continuous-integration/openshift-jenkins/test ABORTED (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/4666/) |
[merge] |
1 similar comment
[merge] |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/4728/) (Image: devenv-rhel7_4349) |
[merge] On Fri, Jun 10, 2016 at 2:40 PM, OpenShift Bot [email protected]
|
Evaluated for origin merge up to 1497ef6 |
Refactors the pull progress writer from 'oc cluster up' to work with push as well.
Updates the output of s2i and docker builders to report push progress as part of the regular build output.
Fixes #9138