Skip to content

build controller: use a buildconfig queue to track which buildconfigs to kick #16117

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

Merged

Conversation

csrwng
Copy link
Contributor

@csrwng csrwng commented Sep 3, 2017

Reverts to using the cache lister to determine which builds to run next.
Adds a new queue to the build controller to keep track of which build configs to poke when a build has completed.
Removes the OnComplete handler for policy, given that they all end up calling the same code.
Removes code that updates an annotation on a build to add to the queue and instead adds the build(s) directly to the queue.

Fixes #16081

@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 3, 2017
@csrwng
Copy link
Contributor Author

csrwng commented Sep 3, 2017

@openshift/devex

@csrwng csrwng assigned bparees and unassigned soltysh Sep 3, 2017
Copy link
Contributor

@bparees bparees left a comment

Choose a reason for hiding this comment

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

one nit and one thought.

}
}

// buildConfigWork gets the next build from the buildQueue and invokes handleBuild on it
Copy link
Contributor

Choose a reason for hiding this comment

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

gets the next buildconfig from the buildconfig queue and invokes handleBuildConfig on it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

bc.enqueueBuildConfig(build.Namespace, bcName)
if err := common.HandleBuildPruning(bcName, build.Namespace, bc.buildLister, bc.buildConfigGetter, bc.buildDeleter); err != nil {
utilruntime.HandleError(fmt.Errorf("failed to prune old builds %s/%s: %v", build.Namespace, build.Name, err))
}
Copy link
Contributor

Choose a reason for hiding this comment

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

seems like this could also run inside handleBuildConfig. Not sure if there's an advantage to moving it though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

leaving as is given that in handleBuildConfig it could potentially be called multiple times which could be wasteful.

@bparees
Copy link
Contributor

bparees commented Sep 5, 2017

and gofmt needed apparently.

[WARNING] !!! gofmt needs to be run on the listed files
./pkg/build/controller/policy/policy_test.go
[FATAL] Try running 'gofmt -s -d [path]'
[FATAL] Or autocorrect with 'hack/verify-gofmt.sh | xargs -n 1 gofmt -s -w'

@csrwng csrwng force-pushed the build_controller_policy_cache branch from 5c2fb6a to bff1d6f Compare September 5, 2017 15:47
@bparees
Copy link
Contributor

bparees commented Sep 5, 2017

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 5, 2017
@openshift-merge-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bparees, csrwng

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 5, 2017
@csrwng
Copy link
Contributor Author

csrwng commented Sep 5, 2017

Installation failed on tests that require an installed OpenShift
/retest

@csrwng
Copy link
Contributor Author

csrwng commented Sep 5, 2017

Flake #16143
/retest

@openshift-ci-robot
Copy link

@csrwng: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
ci/openshift-jenkins/extended_builds bff1d6f link /test extended_builds

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@openshift-merge-robot
Copy link
Contributor

Automatic merge from submit-queue (batch tested with PRs 16142, 16100, 16109, 16113, 16117)

@openshift-merge-robot openshift-merge-robot merged commit ee78030 into openshift:master Sep 5, 2017
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. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants