From 0d389e1d6c1aed4a92f82d9711f4564a12390fcd Mon Sep 17 00:00:00 2001 From: Jasper Ras Date: Mon, 16 Jun 2025 10:44:49 +0200 Subject: vault backup: 2025-06-16 10:44:49 --- ... groups for mutual exclusive running of jobs.md | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Resource groups for mutual exclusive running of jobs.md (limited to 'Resource groups for mutual exclusive running of jobs.md') diff --git a/Resource groups for mutual exclusive running of jobs.md b/Resource groups for mutual exclusive running of jobs.md new file mode 100644 index 0000000..d56edbf --- /dev/null +++ b/Resource groups for mutual exclusive running of jobs.md @@ -0,0 +1,23 @@ +[[Gitlab Docs - Resource Group]] + +--- + +It is possible for jobs to be run in serial over different pipelines by adding them to a `resource_group`. Jobs in the same `resource_group` will wait on other jobs in that group to be finished before starting. + +Keyword: `resource_group`. + +For example this was useful when building a pipeline that spins up a VM to run devstack and install the backup service. To prevent more recent pipelines from interfering with prior pipelines that are still running I've put jobs that need to wait in the `resource_group: devstack`. + +### Process modes +- unordered +- oldest_first +- newest_first +- newest_ready_first + +Sadly these can't be easily set in the YAML definition but have to be configured for a specific resource group via the API. + +``` +curl --request PUT --data "process_mode=oldest_first" \ + --header "PRIVATE-TOKEN: glpat-GpPmmkY5LYuHscpvZPJ8" "https://gitlab.group.one/api/v4/projects/6675/resource_groups/devstack" +{"id":102,"key":"devstack","process_mode":"oldest_first","created_at":"2025-05-27T13:10:00.691Z","updated_at":"2025-06-10T15:06:48.569Z"} +``` \ No newline at end of file -- cgit v1.2.3