Test-infra: Invert job config specification

Created on 20 Apr 2017  Â·  27Comments  Â·  Source: kubernetes/test-infra

We discussed this in #1961.

jobs:
- name: ci-kubernetes-bazel-build
  spec:
    containers:
    - image: gcr.io/k8s-testimages/bazelbuild:0.8
  postsubmit:
    branches:
    - master
  periodic:
    interval: 1h

This will also allow us to naturally define jobs without a trigger, such as the enormous cluster tests.

areprow lifecyclrotten

Most helpful comment

/remove-lifecycle stale
/assign
will get to this one day... one day...

All 27 comments

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or @fejta.
/lifecycle stale

I don't think we are going to this route..

ref https://github.com/kubernetes/test-infra/issues/3338

/assign @paulangton
ignore my previous comment, this is still something good to have

@krzyzacy: GitHub didn't allow me to assign the following users: paulangton.

Note that only kubernetes members and repo collaborators can be assigned.

In response to this:

/assign @paulangton
ignore my previous comment, this is still something good to have

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.

/assign @paulangton

So instead of

jobs:
- name: ci-kubernetes-bazel-build
  spec:
    containers:
    - image: gcr.io/k8s-testimages/bazelbuild:0.8
  postsubmit:
    branches:
    - master
  periodic:
    interval: 1h

we probably should have

jobs:
- name: ci-kubernetes-bazel-build
  spec:
    containers:
    - image: gcr.io/k8s-testimages/bazelbuild:0.8
  trigger:
    branches:
    - master

or

jobs:
- name: ci-kubernetes-bazel-build
  spec:
    containers:
    - image: gcr.io/k8s-testimages/bazelbuild:0.8
  trigger:
    interval: 2h

and we can unify three different job types into one struct

cc @cjwagner @BenTheElder @stevekuznetsov

/remove-lifecycle stale

if we can invert this we might be able to design it in a way that is easier to extend the triggering agent without modifying the prowjob CRD.

Eg right now I'd love to add (but don't want to create a new job type etc)

  • jobs that are triggered on github release tagging events
  • jobs that are triggered in presubmit, postsubmit etc but not with some heuristics on the file changes (beyond just a regex, some kind of "docs only change" detection for example)
  • other forms of specifying scheduling for horlogium
    ...

/meow

Bad bot!

/woof

@BenTheElder: dog image

In response to this:

/woof

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.

Good bot.

and we can unify three different job types into one struct

@krzyzacy This seems nice except that it will move us farther away from unique job names unless we provide some mechanism for giving the different job types different names.
We should also consider how we would name a job that is triggered on multiple different repos (if that is something we intend to support by specifying the repo in the trigger section).

Another option: We could completely separate the trigger config section from the job specs, keeping the triggering config similar to the current config (presubmits, postsubmits and periodics sections). Then we could just provide the triggering config and reference the job config defined elsewhere. This format would make it easy for us to specify different job names for different triggering scenarios, but it would make the config a little harder to read because triggering config would be separate from job config.

@cjwagner trigger is seperated from specs from my sample above? If not can you also give an example?

and we can still enforce unique job names on config loading (like force append branch names to a job, but use the same context value).

trigger is seperated from specs from my sample above? If not can you also give an example?

I was thinking that multiple triggers could refer to the same job spec:

job-specs:
- name: bazel-build
  spec:
    containers:
    - image: gcr.io/k8s-testimages/bazelbuild:0.8

triggers:
  presubmits:
    "k/k":
    - name: pull-kubernetes-bazel-build
      job-spec: bazel-build
      branches:
      - master
    "k/t-i":
    - name: pull-test-infra-bazel-build
      job-spec: bazel-build
  postsubmits:
    "k/k":
    - name: pull-test-infra-bazel-build
      job-spec: bazel-build

If we allow the trigger entries to specify args or env we could pretty easily move the config.json information here and then just have different job-spec entries for each scenario.

and we can still enforce unique job names on config loading (like force append branch names to a job, but use the same context value).

I think we should have complete job names exist in the raw config if possible. If we append things like branch or repo names to the configured job name at load time it won't be easy to look up real jobs based on the config unless you know exactly how the config parsing logic mutates job names.

Multiple triggers on the same job specs in this way is an idea I like too,
but wouldnt really be any more useful than triggers inline to a job unless
different triggers could override things like the git checkout config.

On Wed, Jun 6, 2018, 9:24 PM Cole Wagner notifications@github.com wrote:

trigger is seperated from specs from my sample above? If not can you also
give an example?

I was thinking that multiple triggers could refer to the same job spec:

job-specs:

  • name: bazel-build
    spec:
    containers:

    • image: gcr.io/k8s-testimages/bazelbuild:0.8

      triggers:

      presubmits:

      "k/k":

    • name: pull-kubernetes-bazel-build

      job-spec: bazel-build

      branches:



      • master


        "k/t-i":



    • name: pull-test-infra-bazel-build

      job-spec: bazel-build

      postsubmits:

      "k/k":

    • name: pull-test-infra-bazel-build

      job-spec: bazel-build

If we allow the trigger entries to specify args or env we could pretty
easily move the config.json information here and then just have different
job-spec entries for each scenario.

and we can still enforce unique job names on config loading (like force
append branch names to a job, but use the same context value).

I think we should have complete job names exist in the raw config if
possible. If we append things like branch or repo names to the configured
job name at load time it won't be easy to look up real jobs based on the
config unless you know exactly how the config parsing logic mutates job
names.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/kubernetes/test-infra/issues/2547#issuecomment-395288742,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA4Bq8cmqLEp7JAAlDjC6IstVzKZ8wsBks5t6KsZgaJpZM4NDcIq
.

hummm, I feel like it won't be that many jobs can share the same spec.

Different branch has different bazel/go versions, and k/k and test-infra can diverge as well?

On the same branch CI / presubmit / postsubmit are nearly the same except
upload location, context, git checkout.

On Thu, Jun 7, 2018 at 12:12 PM Sen Lu notifications@github.com wrote:

hummm, I feel like it won't be that many jobs can share the same spec.

Different branch has different bazel/go versions, and k/k and test-infra
can diverge as well?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/kubernetes/test-infra/issues/2547#issuecomment-395532737,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA4Bq4r4YvEifZ5jbch94n0uLfVr1-JRks5t6XsEgaJpZM4NDcIq
.

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

/remove-lifecycle stale
/assign
will get to this one day... one day...

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

/pony shrug
/remove-lifecycle stale
/lifecycle frozen

@krzyzacy: pony image

In response to this:

/pony shrug
/remove-lifecycle stale
/lifecycle frozen

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.

/close
It's unlikely we're going to ever get to this

@spiffxp: Closing this issue.

In response to this:

/close
It's unlikely we're going to ever get to this

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.

/remove-lifecycle frozen
/lifecycle rotten

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cblecker picture cblecker  Â·  4Comments

spzala picture spzala  Â·  4Comments

xiangpengzhao picture xiangpengzhao  Â·  3Comments

BenTheElder picture BenTheElder  Â·  4Comments

sjenning picture sjenning  Â·  4Comments