Skip to content

Conversation

@soltysh
Copy link
Contributor

@soltysh soltysh commented Apr 20, 2017

This builds on top of the rebase PR, so only last commit matters here, but I wanted to start the discussion.

@smarterclayton mind taking a look if this is going in the right direction? While working on it I was wondering why we want to have two separate controllers one for scheduled and the other for regular image stream operations, isn't having a single sufficient?

@soltysh
Copy link
Contributor Author

soltysh commented Apr 20, 2017

@soltysh
Copy link
Contributor Author

soltysh commented Apr 20, 2017

@mfojtik fyi

!c.Options.ImagePolicyConfig.DisableScheduledImport,
)
if c.Options.ImagePolicyConfig.DisableScheduledImport {
glog.V(2).Infof("Scheduled image import is disabled - the 'scheduled' flag on image streams will be ignored")
Copy link
Contributor

Choose a reason for hiding this comment

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

wonder if there is a way to communicate this to users (if I create scheduled import as a user, I have no idea it is disabled, right?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The image stream controller could know that and could add an annotation with that info. I'll defer to @smarterclayton for opinion, since he has mixed feelings, but I agree it would be beneficial for users to know this.

@openshift-bot openshift-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 26, 2017
@soltysh soltysh force-pushed the image_shared_informers branch from e1b4c43 to a135f1c Compare May 2, 2017 11:04
@openshift-bot openshift-bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels May 2, 2017
@soltysh soltysh force-pushed the image_shared_informers branch from a135f1c to 47b6759 Compare May 4, 2017 10:59
@soltysh soltysh changed the title [WIP] Image shared informers Image shared informers May 4, 2017
@soltysh
Copy link
Contributor Author

soltysh commented May 4, 2017

[test]

@smarterclayton this is ready for final review

@openshift-bot openshift-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 4, 2017
@soltysh
Copy link
Contributor Author

soltysh commented May 4, 2017

Flake #14044

[test]


// RunImageImportController starts the image import trigger controller process.
func (c *MasterConfig) RunImageImportController() {
isInformer := c.Informers.ImageStreams()
Copy link
Contributor

Choose a reason for hiding this comment

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

nuke this, you used this just once

controller, scheduledController := factory.Create()
controller.Run()
ctrl, sched := imagecontroller.NewImageStreamControllers(
isInformer,
Copy link
Contributor

Choose a reason for hiding this comment

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

c.Informers.ImageStreams()

}
controller, scheduledController := factory.Create()
controller.Run()
ctrl, sched := imagecontroller.NewImageStreamControllers(
Copy link
Contributor

Choose a reason for hiding this comment

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

s/ctrl/controller/

glog.V(2).Infof("Scheduled image import is disabled - the 'scheduled' flag on image streams will be ignored")
} else {
scheduledController.RunUntil(utilwait.NeverStop)
sched.Run(utilwait.NeverStop)
Copy link
Contributor

Choose a reason for hiding this comment

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

scheduledController (hate cryptic short forms)

q := cache.NewResyncableFIFO(cache.MetaNamespaceKeyFunc)
cache.NewReflector(lw, &api.ImageStream{}, q, f.ResyncInterval).Run()
// instantiate informer based image stream controller
ctrl := newImageStreamController(isInformer, isNamespacer)
Copy link
Contributor

Choose a reason for hiding this comment

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

controller

@soltysh
Copy link
Contributor Author

soltysh commented May 18, 2017

Flake #13827

[test]

@openshift-bot openshift-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 18, 2017
@mfojtik
Copy link
Contributor

mfojtik commented May 18, 2017

@soltysh we might do this e486a4f plumbing for the image controller as well (we are going to migrate all controllers eventually...) can you have a look? if not I can do that on top of this PR :-)


stream, err := c.getByKey(key.(string))
if err == nil && stream != nil {
glog.V(3).Infof("Queued import of stream %s/%s...", stream.Namespace, stream.Name)
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this 3 before?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's slightly different than what we've had before. But this is this and it was 3 back then.

@soltysh
Copy link
Contributor Author

soltysh commented May 19, 2017

@mfojtik roger that, I'll try to update that tomorrow.

}
stream, err := c.lister.ImageStreams(namespace).Get(name, metav1.GetOptions{})
if apierrs.IsNotFound(err) {
glog.V(4).Infof("Image stream has been deleted: %v", key)
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't need a log line

if !needsScheduling(sharedStream) {
return ErrNotImportable
}
stream := *sharedStream
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sufficient, this is mutating a shared cache

@smarterclayton
Copy link
Contributor

Logic looks ok except for a few things, want to see this rebased and green tests.

@soltysh soltysh force-pushed the image_shared_informers branch from bb96e00 to 54306a3 Compare May 20, 2017 21:34
@soltysh
Copy link
Contributor Author

soltysh commented May 20, 2017

I've rebased and squashed all the changes to a single commit. @mfojtik where's that commit coming from, I can't find that code anywhere in origin :/ I've left there TODO. Let's merge this in on green tests and I'll work out a followup with the init changes, wdyt?

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to 54306a3

@openshift-bot openshift-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 20, 2017
@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin/1592/) (Base Commit: 37d5498)

@soltysh
Copy link
Contributor Author

soltysh commented May 21, 2017

@mfojtik @smarterclayton any objections on merging this in?

@mfojtik
Copy link
Contributor

mfojtik commented May 22, 2017

@soltysh i'm fine merging this but you should follow up with the controller initialization :-)

@mfojtik
Copy link
Contributor

mfojtik commented May 24, 2017

[merge]

@mfojtik
Copy link
Contributor

mfojtik commented May 25, 2017

[merge][severity: blocker] memory use is still p0 for 3.6

@mfojtik mfojtik added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 25, 2017
@mfojtik
Copy link
Contributor

mfojtik commented May 25, 2017

[merge][severity: blocker]

flake: #14349

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to 54306a3

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/merge FAILURE (https://ci.openshift.redhat.com/jenkins/job/merge_pull_request_origin/794/) (Base Commit: 4b3473a) (Extended Tests: blocker)

@smarterclayton
Copy link
Contributor

Blocked by hate, force merging

@mfojtik mfojtik merged commit 016b65a into openshift:master May 25, 2017
@mfojtik
Copy link
Contributor

mfojtik commented May 25, 2017

evil-girl-fire-force-merge

@soltysh soltysh deleted the image_shared_informers branch May 29, 2017 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants