Skip to content

[BEAM-3066] Add standalone version of seed job#4004

Merged
asfgit merged 1 commit intoapache:masterfrom
kennknowles:seed-job-standalone
Oct 19, 2017
Merged

[BEAM-3066] Add standalone version of seed job#4004
asfgit merged 1 commit intoapache:masterfrom
kennknowles:seed-job-standalone

Conversation

@kennknowles
Copy link
Copy Markdown
Member

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a JIRA issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Run mvn clean verify to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

R: @jasonkuster

@kennknowles
Copy link
Copy Markdown
Member Author

Diff of seed job versus this new standalone job:

 // Defines the seed job, which creates or updates all other Jenkins projects.
-job('beam_SeedJob') {
+job('beam_SeedJob_Standalone') {
   description('Automatically configures all Apache Beam Jenkins projects based' +
               ' on Jenkins DSL groovy files checked into the code repository.')
 
-  previousNames('beam_SeedJob_Main')
-
-  // Set common parameters.
-  common_job_properties.setTopLevelMainJobProperties(delegate)
-
-  // This is a post-commit job that runs once per day, not for every push.
-  common_job_properties.setPostCommit(
-      delegate,
-      '0 6 * * *',
-      false,
-      'dev@beam.apache.org')
-
-  // Allows triggering this build against pull requests.
-  common_job_properties.enablePhraseTriggeringFromPullRequest(
-    delegate,
-    'Seed Job',
-    'Run Seed Job')
+  properties {
+    githubProjectUrl('https://github.com/apache/beam/')
+  }
+
+  jdk('JDK 1.8 (latest)')
+
+  // Restrict to only run on Jenkins executors labeled 'beam'
+  label('beam')
+
+  logRotator {
+    daysToKeep(14)
+  }
+
+  scm {
+    git {
+      remote {
+        github('apache/beam')
+
+        // ${ghprBuildId} is not interpolated by groovy, but passed through to Jenkins where it
+        // refers to the environment variable
+        refspec(['+refs/head/*:refs/remotes/origin/*'
+                 '+refs/pull/${ghprPullId}/*:refs/remotes/origin/pr/${ghprPullId}/*']
+                .join(' '))
+
+        // The variable ${sha1} is not interpolated by groovy, but a parameter of the Jenkins job
+        branch('${sha1}')
+
+        extensions {
+          cleanAfterCheckout()
+        }
+      }
+    }
+  }
+
+  parameters {
+    // Setup for running this job from a pull request
+    stringParam(
+        'sha1',
+        defaultBranch,
+            'Commit id or refname (eg: origin/pr/4001/head) you want to build against.')
+  }
+
+  wrappers {
+    timeout {
+      absolute(5)
+      abortBuild()
+    }
+  }
+
+  triggers {
+    // Run once per day
+    cron('0 */6 * * *')
+
+    githubPullRequest {
+      admins(['asfbot'])
+      useGitHubHooks()
+      orgWhitelist(['apache'])
+      allowMembersOfWhitelistedOrgsAsAdmin()
+      permitAll()
+
+      // Also run when manually kicked on a pull request
+      triggerPhrase('Run Seed Job')
+      onlyTriggerPhrase()
+
+      extensions {
+        commitStatus {
+          context("Jenkins: Standalone Seed Job")
+        }
+
+        buildStatus {
+          completedStatus('SUCCESS', '--none--')
+          completedStatus('FAILURE', '--none--')
+          completedStatus('ERROR', '--none--')
+        }
+      }
+    }
+  }
+
+  // If anything goes wrong, mail the main dev list, because it is a big deal
+  publishers {
+    mailer('dev@beam.apache.org', false, true)
+  }
 
   steps {
     dsl {

* limitations under the License.
*/

import common_job_properties
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Actually, this should be removed

@kennknowles
Copy link
Copy Markdown
Member Author

The test results here indicate how urgent it is that we fix our testing situation - this PR touches nothing that is tested, yet both main precommits flaked. I think the first prerequisite step is to make it easy and safe to change testing rapidly to experiment.

@kennknowles kennknowles force-pushed the seed-job-standalone branch 5 times, most recently from 94d2f12 to 62d61da Compare October 18, 2017 21:21
@kennknowles
Copy link
Copy Markdown
Member Author

run seed job

@jasonkuster
Copy link
Copy Markdown
Contributor

LGTM

1 similar comment
@aaltay
Copy link
Copy Markdown
Member

aaltay commented Oct 19, 2017

LGTM

@kennknowles
Copy link
Copy Markdown
Member Author

Thanks!

@asfgit asfgit merged commit 58b3369 into apache:master Oct 19, 2017
asfgit pushed a commit that referenced this pull request Oct 19, 2017
@kennknowles kennknowles deleted the seed-job-standalone branch October 23, 2017 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants