[FEATURE] #1217 Added feature to emulate gitlab hosted runner using the --container-emulate
option with the name of one of the gitlab preset.
#1219
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
summary
Added an option to prefill
memory
,kernel-memory
andcpus
docker options based on the configuration of Gitlab's hosted runner. This is useful when attempting to debug performance issue. By default, no limit is applied, the host resources are all available.When passing the option
--container-emulate=
with the name of a gitlab hosted runner, the docker resources is limited to the resource available for this class of hosted runner. As of this PR, those are the valuessaas-linux-small
saas-linux-medium
saas-linux-large
saas-linux-xlarge
saas-linux-2xlarge
see the gitlab documentation here
Of course, you are also limited to the host resources. You cannot have 128 GB of RAM on a host that only has 16 GB.
As of right now, I've only added support for the base linux machine. This does not include runner with a GPUs. This could be a nice amelioration in the futur. The runners names does not contains the architecture, as this is based on the host CPU, and cannot be emulated.
Usage
You can pass an additional option
--containter-emulate
with one of the previously mentionned runner name. For example, using the namesaas-linux-small
will limit the container resource to 8 GB or RAM and 2 CPUs.You can check the memory limit and CPU usage using the
docker stats {container_id}
command.This PR Closes #1217