Skip to content
This repository was archived by the owner on Jun 14, 2019. It is now read-only.

Conversation

@petr-muller
Copy link
Member

I'd like to consider something like this to go along fully enabling rehearsals in openshift/release#2847

I'm concerned whether it's fine to mass-submit hundreds of prowjobs for changes like yesterday's openshift/release#2834. It seems that GH has a limit of 1000 statuses per SHA so we're fine on that front, but I'm not sure about our test throughput. Also, we'll probably not care that much about jobs themselves when we do mass changes.

WDYT?

/cc @stevekuznetsov @droslean @bbguimaraes

@openshift-ci-robot openshift-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Feb 13, 2019
rehearsals := configureRehearsalJobs(toBeRehearsed, prRepo, prNumber, loggers)
return &Executor{
RehearsalJobCount: len(rehearsals),

Copy link
Member

Choose a reason for hiding this comment

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

nit: no need for the extra line here

Copy link
Member Author

Choose a reason for hiding this comment

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

I wanted to separate private and exported fields

Copy link
Member

@droslean droslean left a comment

Choose a reason for hiding this comment

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

I like this. But we should agree on the threshold limit. 15 sounds ok to me.

@petr-muller
Copy link
Member Author

Yeah, 15 is entirely arbitrary :)

@bbguimaraes
Copy link
Contributor

+0, we only rehearse container tests for now, so the impact shouldn't be that large, but it's nice to have a safety net.

@droslean
Copy link
Member

lgtm from my side. @stevekuznetsov wanna check?

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.

Would it be hard to add a --limit flag to this so we can tweak it after the fact by changing just job config

pj-rehearse rehearsed jobs and at least one of them failed. This means that
job would fail when executed against the current HEAD of the target branch.`
REHEARSAL_THRESHOLD = 15
Copy link
Contributor

Choose a reason for hiding this comment

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

Go prefers rehearsalThreshold

Copy link
Member Author

Choose a reason for hiding this comment

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

Aaaargh capitalized constants are burned to my brain


executor := rehearse.NewExecutor(changedPresubmits, prNumber, o.candidatePath, jobSpec.Refs, o.dryRun, loggers, pjclient)

if executor.RehearsalJobCount > REHEARSAL_THRESHOLD {
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we sorting the jobs? For the same set of selected jobs for rehearsal, will we choose the same 15 every time?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not attempting to sample, I'm bailing out when too many jobs would be rehearsed.

@petr-muller
Copy link
Member Author

petr-muller commented Feb 13, 2019

+0, we only rehearse container tests for now, so the impact shouldn't be that large, but it's nice to have a safety net.

Yeah, it's not that we would attempt to build hundreds of clusters, but Clayton's PR yesterday would still submit ~320 jobs (container-based but still) at once, which sounds excessive.

@petr-muller
Copy link
Member Author

I'll make it a parameter with a default.

@petr-muller
Copy link
Member Author

@stevekuznetsov PTAL now

// NewExecutor creates an executor. It also confgures the rehearsal jobs as a list of presubmits.
func NewExecutor(toBeRehearsed map[string][]prowconfig.Presubmit, prNumber int, prRepo string, refs *pjapi.Refs,
dryRun bool, loggers Loggers, pjclient pj.ProwJobInterface) *Executor {
rehearsals := configureRehearsalJobs(toBeRehearsed, prRepo, prNumber, loggers)
Copy link
Member

@droslean droslean Feb 14, 2019

Choose a reason for hiding this comment

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

Since we add more stuff to the constructor, I am starting thinking that it's better to export this function and call it from main and pass the rehearsals to the constructor directly. Then we don't have to include the RehearsalJobCount in the executor and we can make the limit check in main without creating the executor.

Copy link
Member Author

@petr-muller petr-muller Feb 14, 2019

Choose a reason for hiding this comment

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

I think when we have an extra layer already, let's use it to hide some details.

@stevekuznetsov
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 14, 2019
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: droslean, petr-muller, stevekuznetsov

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

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [droslean,petr-muller,stevekuznetsov]

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

@openshift-merge-robot openshift-merge-robot merged commit 9fb4c15 into openshift:master Feb 14, 2019
@petr-muller petr-muller deleted the safety-limit branch February 15, 2019 14:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants