Resource_group behavior for separate projects

Running on GitLab Enterprise Edition 14.3.3-ee

I went over the docs and several tickets, for example:

This is a big issue, I don’t know if there is something missing but in my case, the resource_group is not working when used by different projects.

I got a gitlab-ci template, which has two jobs and both of these jobs are running in the same stage but have the same resource_group: my-special-resource-group set.

This template is used by several totally independent projects. So each of them, do have a include on this template. When “Project A” is executed at the same time as “Project B”, they can reach this included jobs at the same time and they will be executed, even though they have set the same resource_group.

These included jobs run on a gitlab-runner with docker executor. They are deploying some stuff on a server, only on of these jobs is allowed to run at a time across all projects using that template.
How can this be achieved?

I’ve just been building some import tooling for an external translation service, which is used in my company. All company projects will eventually use this, however the service does not properly support atomic updates, so I would have to serialize all jobs across all projects in order to avoid race conditions.

I haven’t found any information recording the use of resource_group across projects, but your thread suggests that they are per project (which makes a lot of sense for gitlab.com, since that would easily result in name conflicts).

The only way to achieve this would be to put the job that needs global serialization into a separate project and to trigger that as a downstream pipeline instead of including it into projects. I think the downstream pipeline trigger could be part of a pipeline template that’s then included into actual projects, so the complexity is “hidden”.