Page MenuHomeSoftware Heritage

Make the timeout declaratively parametric
ClosedPublic

Authored by ardumont on Mar 29 2022, 11:20 AM.

Details

Summary

I've only opened the configuration and kept the 20 minutes timeout.

(According to discussion here)

Diff Detail

Repository
rCJSWH Jenkins jobs
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Actually change as described.

olasd requested changes to this revision.Mar 29 2022, 11:34 AM
olasd added a subscriber: olasd.

That will apply to all jobs, which I don't think we want to do.

We need to add a job parameter to be able to set the timeout per project.

I'm happy to do that with you if you want.

This revision now requires changes to proceed.Mar 29 2022, 11:34 AM

I'm happy to do that with you if you want.

sure, that'd be awesome.

i've tentatively tried something out in this very diff.

Make the timeout parametric (tox does not complain)

anlambert added a subscriber: anlambert.

You are still setting a timeout of 30 minutes for all jobs.

Do this instead:

(swh) ✔ ~/swh/swh-jenkins-jobs [master|✚ 4⚑ 2] 
13:16 $ git diff
diff --git a/jobs/swh-packages.yaml b/jobs/swh-packages.yaml
index 6de7432..2b57ed0 100644
--- a/jobs/swh-packages.yaml
+++ b/jobs/swh-packages.yaml
@@ -299,6 +299,7 @@
     pkg: web
     python_module: swh.web
     do_cypress: true
+    timeout: 30
     jobs:
       - "swh-jobs-{name}"
 
diff --git a/jobs/templates/swh-pipeline-diff.yaml b/jobs/templates/swh-pipeline-diff.yaml
index 5dab0a0..37f602a 100644
--- a/jobs/templates/swh-pipeline-diff.yaml
+++ b/jobs/templates/swh-pipeline-diff.yaml
@@ -11,6 +11,7 @@
     auth-token: 'ph4br1cat0r'
     phabricator_diff: true
     do_cypress: false
+    timeout: 20
     properties:
       - build-discarder:
           artifact-num-to-keep: 20
diff --git a/jobs/templates/swh-pipeline.groovy.j2 b/jobs/templates/swh-pipeline.groovy.j2
index ded6013..774621f 100644
--- a/jobs/templates/swh-pipeline.groovy.j2
+++ b/jobs/templates/swh-pipeline.groovy.j2
@@ -87,7 +87,7 @@ pipeline {
 
     stage('Tests') {
       options {
-        timeout(time: 20, unit: 'MINUTES')
+        timeout(time: {{ timeout }}, unit: 'MINUTES')
       }
 
       parallel {
diff --git a/jobs/templates/swh-pipeline.yaml b/jobs/templates/swh-pipeline.yaml
index 48bda35..c8e4d5c 100644
--- a/jobs/templates/swh-pipeline.yaml
+++ b/jobs/templates/swh-pipeline.yaml
@@ -16,6 +16,7 @@
           artifact-num-to-keep: 20
     phabricator_diff: false
     do_cypress: false
+    timeout: 20
     parameters:
       - git-parameter:
           name: REVISION
This revision now requires changes to proceed.Mar 29 2022, 1:17 PM

Actually only make the timeout parametric (since the work has been done)

ardumont retitled this revision from Increase timeout for webapp builds to Make the timeout declaratively parametric.Mar 29 2022, 3:33 PM
ardumont edited the summary of this revision. (Show Details)
ardumont edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Mar 30 2022, 9:59 AM