Skip to content
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

Add Jenkins X agent to the configuration #13199

Closed
wants to merge 3 commits into from

Conversation

ccojocar
Copy link
Member

@ccojocar ccojocar commented Jun 27, 2019

I am adding the Jenkins X agent to the configuration as agreed in #11888 and in the design document review. This will allow us to use our custom pipeline controller to trigger Jenkins X pipeline execution. This controller is planned to be maintained by Jenkins X team in a stand-alone repository.

cc @fejta @cjwagner @wbrefvem @abayer

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 27, 2019
@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. area/prow Issues or PRs related to prow sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels Jun 27, 2019
@ccojocar
Copy link
Member Author

/assign @fejta

@@ -1226,7 +1226,8 @@ func validateAgent(v JobBase, podNamespace string) error {
b := string(prowapi.KnativeBuildAgent)
j := string(prowapi.JenkinsAgent)
p := string(prowapi.TektonAgent)
agents := sets.NewString(k, b, j, p)
x := string(prowapi.JenkinsXAgent)
agents := sets.NewString(k, b, j, p, x)
Copy link
Contributor

Choose a reason for hiding this comment

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

I would expect more validation here -- should not have a podspec, etc ...

Copy link
Member Author

Choose a reason for hiding this comment

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

@stevekuznetsov Jenkins X does not require the PodSpec because every project has a build definition which is stored in the project repository. As an example, you can have a look at this pipeline definition: https://github.com/jenkins-x/jx/blob/master/jenkins-x.yml

Jenkins X is mainly using the Refs and ExtraRefs from ProwJobSpec. Given this, I don't think that the config requires extra validation at this point.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think his point is that we should validate that if the agent is JenkinsXAgent that it does not define a podspec?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's good point! I added some checks to validate that no spec, build_spec or pipeline_rus_spec is defined for jenkins-x agent.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jul 1, 2019
ccojocar added 2 commits July 1, 2019 09:41
Signed-off-by: Cosmin Cojocar <cosmin.cojocar@gmx.ch>
… in config for jenkins-x agent

Signed-off-by: Cosmin Cojocar <cosmin.cojocar@gmx.ch>
Signed-off-by: Cosmin Cojocar <cosmin.cojocar@gmx.ch>
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 1, 2019
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: eee87d0f9c202e364e5e2773a1f948cd50ba4f42

Copy link
Contributor

@stevekuznetsov stevekuznetsov left a comment

Choose a reason for hiding this comment

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

I am not suuuuuper on board with having an agent type without an impl behind it. Can't the JenkinsX system use their own CRD?

TektonAgent = "tekton-pipeline"
TektonAgent ProwJobAgent = "tekton-pipeline"
// JenkinsXAgent means prow will schedule the jobs via JenkinsX pipeline.
JenkinsXAgent ProwJobAgent = "jenkins-x"
Copy link
Contributor

Choose a reason for hiding this comment

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

So how does this actually end up working? Some proprietary controller that looks at ProwJobs in the cluster?

Copy link
Contributor

@wbrefvem wbrefvem Jul 1, 2019

Choose a reason for hiding this comment

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

That's more or less the size of it, but it won't be proprietary! :) Basically we'll be using a freestanding version (i.e. outside the prow tree, in its own repo) of the pipeline controller that Cosmin built at prow/cmd/pipeline, which will allow us to encapsulate the customizations we need without interfering with what you folks are doing upstream.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

@fejta fejta left a comment

Choose a reason for hiding this comment

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

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 1, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ccojocar, fejta, matthyx

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

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 1, 2019
@stevekuznetsov
Copy link
Contributor

Thinking this over another time instead of asking y'all to check in every type of agent you come up with, why don't we do this:

  • validate agents we know about
  • be permissive for agents we know nothing about

I don't really think that every time JenkinsX or OpenShift or whoever invents a new type of controller to integrate with ProwJobs we should expects devs to jump in and update a list of magic strings, that seems annoying at best. If we just tolerate unrelated agents we can allow development for those to happen entirely out of band, right?

@ccojocar
Copy link
Member Author

This is not required anymore. I am going to close it. Thanks @wbrefvem for contributing a more generic solution.

@ccojocar ccojocar closed this Jul 24, 2019
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. area/prow Issues or PRs related to prow cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants