Repository navigation
Refactor build API and controller - #335
Conversation
Refactor the build API and validation. Refactor the build controller to use the upstream cache package where possible. Use watches wherever possible.
Add test coverage for refactored builds.
|
[test] |
|
Will add a commit to this PR to update existing example JSON for builds. |
|
[test] again with updated examples. |
There was a problem hiding this comment.
Please note that this is required due to the fact that pods aren't updated in storage to stay in sync with container states, so the only way to get events for container state updates right now is to poll. To retain queue semantics, we're populating the FIFO with a cache.Poller.
There was a problem hiding this comment.
@smarterclayton Would something like cadvisor help here? We really need the pod status to stay in sync with their container states to avoid polling here and in the CustomPod controller for deployments.
There was a problem hiding this comment.
Did you get your answer here? This is a hard problem and I'm not sure we can do anything better than polling.
On Nov 4, 2014, at 3:34 PM, Dan Mace [email protected] wrote:
In pkg/build/controller/factory/factory.go:
+type BuildControllerFactory struct {
- Client *osclient.Client
- KubeClient *kclient.Client
- DockerBuildStrategy *strategy.DockerBuildStrategy
- STIBuildStrategy *strategy.STIBuildStrategy
+}
+func (factory *BuildControllerFactory) Create() *controller.BuildController {
- buildStore := cache.NewStore()
- cache.NewReflector(&buildLW{client: factory.Client}, &buildapi.Build{}, buildStore).Run()
- buildQueue := cache.NewFIFO()
- cache.NewReflector(&buildLW{client: factory.Client}, &buildapi.Build{}, buildQueue).Run()
- podQueue := cache.NewFIFO()
- cache.NewPoller(factory.pollPods, 10*time.Second, podQueue).Run()
@smarterclayton Would something like cadvisor help here? We really need the pod status to stay in sync with their container states to avoid polling here and in the CustomPod controller for deployments.—
Reply to this email directly or view it on GitHub.
There was a problem hiding this comment.
@smarterclayton I got a referral to Dawn Chen. I'll follow up tomorrow. While the polling is unfortunate, I'm at least happy that we can use a queue internally. If we come up with something better we can swap in a new FIFO-feeder.
|
Ready for review. cc @bparees @csrwng @jcantrill @soltysh @pmorie |
There was a problem hiding this comment.
@ironcladlou Is this needed since you have line 53?
There was a problem hiding this comment.
@jcantrill Actually I should have just made 53 look like:
var nextStatus BuildStatus
since all paths lead to an assignment.
I'm not sure if I care to rewrite history to amend the original commit for this right now though.
cebcd98 to
de0758b
Compare
|
lgtm. |
|
[merge] |
|
Origin Merge Results: SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_requests_openshift3/317/) (Image: devenv-fedora_326) |
|
Evaluated for origin up to de0758b |
|
🎱 good to see it here |
OSEv3.3.0.18
Refactor the build API and validation. Refactor the build controller
to use the upstream cache package where possible. Use watches wherever
possible.