qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] gitlab-ci: Restrict jobs using Docker to runners having 'doc


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH] gitlab-ci: Restrict jobs using Docker to runners having 'docker' tag
Date: Mon, 10 May 2021 16:53:53 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1

On 4/14/21 12:10 PM, Philippe Mathieu-Daudé wrote:
> On 3/19/21 6:40 AM, Thomas Huth wrote:
>> On 19/03/2021 01.43, Philippe Mathieu-Daudé wrote:
>>> When a job is based on a Docker image [1], or is using a Docker
>>> service, it requires a runner with Docker installed.
>>>
>>> Gitlab shared runners provide the 'docker' tag when they have it
>>> installed.
>>>
>>> Are Gitlab shared runners are limited resources, we'd like to
>>
>> s/Are/As/
>>
>>> add more runners to QEMU repositories hosted on Gitlab. If a
>>> runner doesn't provide Docker, our jobs requiring it will fail.
>>>
>>> Use the standard 'docker' tag to mark the jobs requiring Docker
>>> on the runner.
>>>
>>> [1] https://docs.gitlab.com/ee/ci/yaml/#image
>>> [2] https://docs.gitlab.com/ee/ci/yaml/#services
>>>
>>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> [...]
>>> diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
>>> index f65cb11c4d3..d4511cf7dea 100644
>>> --- a/.gitlab-ci.yml
>>> +++ b/.gitlab-ci.yml
>>> @@ -14,6 +14,8 @@ include:
>>>     - local: '/.gitlab-ci.d/crossbuilds.yml'
>>>     .native_build_job_template: &native_build_job_definition
>>> +  tags:
>>> +  - docker
>>>     stage: build
>>>     image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:latest
>>>     before_script:
>>> @@ -38,6 +40,8 @@ include:
>>>         fi
>>>     .native_test_job_template: &native_test_job_definition
>>> +  tags:
>>> +  - docker
>>>     stage: test
>>>     image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:latest
>>>     script:
>>
>> If you add it to the templates ... won't this disable most of the jobs
>> on the dedicated runners that don't have docker? Wouldn't it be better
>> to add the tag only to the jobs that run "make check-tcg" ?
> 
> But this is the point, if a runner doesn't have Docker, it can not
> run the job...

Apparently gitlab isn't clever enough to figure the 'image:' tag implies
we are expecting Docker... I suppose they wanted to keep it simple and
filter with runner tags.

Now the public runners are named 'gitlab-org-docker', see:

https://gitlab.com/gitlab-org/gitlab-ui/-/merge_requests/1267/diffs
https://gitlab.com/gitlab-org/gitlab-docs/-/merge_requests/800/diffs
https://gitlab.com/gitlab-org/gitlab-docs/blob/master/.gitlab-ci.yml#L483
https://gitlab.com/gitlab-com/gl-infra/infrastructure/-/issues/9685

Long term it would be simpler if we use gitlab recommended templates,
so we don't have to update ours when they change.

Meanwhile I'll simpy respin using 'gitlab-org-docker'.

Regards,

Phil.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]