diff mbox series

[3/4] gitlab: make Cirrus CI timeout explicit

Message ID 20230912184130.3056054-4-berrange@redhat.com (mailing list archive)
State New, archived
Headers show
Series ci: fix hang of FreeBSD CI jobs | expand

Commit Message

Daniel P. Berrangé Sept. 12, 2023, 6:41 p.m. UTC
On the GitLab side we're invoking the Cirrus CI job using the
cirrus-run tool which speaks to the Cirrus REST API. Cirrus
sometimes tasks 5-10 minutes to actually schedule the task,
and thus the execution time of 'cirrus-run' inside GitLab will
be slightly longer than the execution time of the Cirrus CI
task.

Setting the timeout in the GitLab CI job should thus be done
in relation to the timeout set for the Cirrus CI job. While
Cirrus CI defaults to 60 minutes, it is better to set this
explicitly, and make the relationship between the jobs
explicit

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 .gitlab-ci.d/cirrus.yml       | 3 +++
 .gitlab-ci.d/cirrus/build.yml | 2 ++
 2 files changed, 5 insertions(+)

Comments

Philippe Mathieu-Daudé Sept. 13, 2023, 5:54 a.m. UTC | #1
On 12/9/23 20:41, Daniel P. Berrangé wrote:
> On the GitLab side we're invoking the Cirrus CI job using the
> cirrus-run tool which speaks to the Cirrus REST API. Cirrus
> sometimes tasks 5-10 minutes to actually schedule the task,
> and thus the execution time of 'cirrus-run' inside GitLab will
> be slightly longer than the execution time of the Cirrus CI
> task.
> 
> Setting the timeout in the GitLab CI job should thus be done
> in relation to the timeout set for the Cirrus CI job. While
> Cirrus CI defaults to 60 minutes, it is better to set this
> explicitly, and make the relationship between the jobs
> explicit
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>   .gitlab-ci.d/cirrus.yml       | 3 +++
>   .gitlab-ci.d/cirrus/build.yml | 2 ++
>   2 files changed, 5 insertions(+)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
diff mbox series

Patch

diff --git a/.gitlab-ci.d/cirrus.yml b/.gitlab-ci.d/cirrus.yml
index 41d64d6680..816d89cc2a 100644
--- a/.gitlab-ci.d/cirrus.yml
+++ b/.gitlab-ci.d/cirrus.yml
@@ -15,6 +15,9 @@ 
   stage: build
   image: registry.gitlab.com/libvirt/libvirt-ci/cirrus-run:master
   needs: []
+  # 20 mins larger than "timeout_in" in cirrus/build.yml
+  # as there's often a 5-10 minute delay before Cirrus CI
+  # actually starts the task
   timeout: 80m
   allow_failure: true
   script:
diff --git a/.gitlab-ci.d/cirrus/build.yml b/.gitlab-ci.d/cirrus/build.yml
index a9444902ec..29d55c4aa3 100644
--- a/.gitlab-ci.d/cirrus/build.yml
+++ b/.gitlab-ci.d/cirrus/build.yml
@@ -16,6 +16,8 @@  env:
   TEST_TARGETS: "@TEST_TARGETS@"
 
 build_task:
+  # A little shorter than GitLab timeout in ../cirrus.yml
+  timeout_in: 60m
   install_script:
     - @UPDATE_COMMAND@
     - @INSTALL_COMMAND@ @PKGS@