Skip to content

Implement logs streaming option when starting a build#1197

Merged
openshift-bot merged 1 commit intoopenshift:masterfrom
0xmichalis:stream-logs
Mar 5, 2015
Merged

Implement logs streaming option when starting a build#1197
openshift-bot merged 1 commit intoopenshift:masterfrom
0xmichalis:stream-logs

Conversation

@0xmichalis
Copy link
Contributor

(cc: @bparees @jhadvig @mfojtik )

Closes #645

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we only support streaming build-logs for a single build at a time, for a given buildconfig?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bparees as far as I'm aware we do

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that seems problematic.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bparees yes, if you take a look at the code behind osc build-logs, it's the same as the methods I have invoked here ie. specify a build or a buildConfig and stream its logs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bparees on a side note, this pr is relevant since it wraps all the methods above.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there shouldn't be, which is why i'm so confused..your pastebin implied this was working, but i'm not sure how :)

the terminology is a bit wonky, but you use a buildconfig to create a build, so if you start the same buildconfig twice, you'll get two unique build objects created (note the distinction of buildconfig vs build), each with their own pod, own logs, etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am familiar with the distinction between builds and buildconfigs, just getting around them. Since every build will be in its own pod i guess you will see the same logs twice. I will test it tomorrow.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bparees now that it's morning here and I can function normally: the reason the pastebin I posted seems like working is because when running with --from-build specified, it's essentially re-running a previous build so buildName is the name of a build in that particular case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: By the time I redirect buildLogs as it is right now, there is no newBuild.Name set.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: By the time I redirect buildLogs as it is right now, there is no newBuild.Name set.

Which means that this code is incorrect as is. If I am going this way, I should kick off the goroutine after I have the newBuild created so I can access its name.

@0xmichalis 0xmichalis changed the title Implement logs streaming option when starting a build [WIP] Implement logs streaming option when starting a build Mar 3, 2015
@0xmichalis
Copy link
Contributor Author

Not sure if I am on the right track here, though these latest changes seem much more correct than the initial code of this pr.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why can't you just do this before you start the follow logic, rather than using a channel to send newBuild.Name in later?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking that the watcher would be already setup watching for builds by the time we started the build but in the end I think you are right. I 'll investigate it more and probably change to what you suggest.

@0xmichalis
Copy link
Contributor Author

@bparees refactored as per your suggestion. Turns out the code is simpler and I like that. Now I am hitting Internal Error: container "sti-build" is not ready. which as you already know is an upstream problem. I guess after the latest Kube rebase, this will work.

@0xmichalis
Copy link
Contributor Author

After the latest Kube rebase:

🎉 http://pastebin.com/J56uFUZJ 🎉 http://pastebin.com/xeQdWs3a 🎉

@bparees
Copy link
Contributor

bparees commented Mar 4, 2015

lgtm...squash and we can merge after you confirm it's working post-rebase.

@0xmichalis 0xmichalis changed the title [WIP] Implement logs streaming option when starting a build Implement logs streaming option when starting a build Mar 4, 2015
@jhadvig
Copy link
Member

jhadvig commented Mar 4, 2015

LGTM
good job 👍

@0xmichalis
Copy link
Contributor Author

@bparees squashed and rebased on top of current master. Everything works normally. Can someone else test this as well? @jhadvig ?

@bparees
Copy link
Contributor

bparees commented Mar 5, 2015

tested. passed. [merge]d.

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_requests_openshift3/1123/) (Image: devenv-fedora_982)

@openshift-bot
Copy link
Contributor

Evaluated for origin up to 50f134e

openshift-bot pushed a commit that referenced this pull request Mar 5, 2015
@openshift-bot openshift-bot merged commit a9fd1ec into openshift:master Mar 5, 2015
@0xmichalis 0xmichalis deleted the stream-logs branch March 6, 2015 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

An option to start log streaming after starting a build manually

6 participants