Gitlab CI:在多台机器上运行同一组测试 [英] Gitlab CI: running the same set of tests on several machines
问题描述
在高性能计算中,至关重要的是要针对许多不同的体系结构/编译器(从便携式计算机到超级计算机)测试代码.
In high performance computing is crucial to have a code tested against many different architectures/compilers: from a laptop to a supercomputer.
假设我们有
-
N
测试机器/工人(每台都运行gitlab-ci-runner
); -
M
测试,
N
testing machines/workers (each one runninggitlab-ci-runner
);M
tests,
.gitlab-ci.yml
的正确布局应该是什么,以确保N
机器的each
运行所有测试?
what shall be the correct layout of .gitlab-ci.yml
to ensure that each
of the N
machines runs all the tests?
在我看来,增加更多的工人最终会像round-robin
那样分配工作.
Looks to me that adding just more workers ends up in a round-robin
like assignment of the jobs.
感谢您的帮助.
推荐答案
您可以在.gitlab-ci.yml和运行程序中使用标签,以将测试分发到所需的所有mashine. Gitlab CI对这些用例非常开放.我假设您不使用docker进行测试.
You could use tags in your .gitlab-ci.yml and on the runners to distribute your tests to all mashines you want. Gitlab CI is very open to those use cases. I assume that you don't use docker for testing.
要实现您的目标,请执行以下步骤:
To accomplish your goal, do following steps:
- 如果跑步者要求您提供标签,请在
N
mashines BUT上安装您的gitlab-ci-multi-runners,并用特定名称标记mashine,例如"MashineWithManyCPUsWhatever".请使用gitlab-ci-multi-runner register
命令执行此操作.注册后,您也可以在管理视图的Gitlab中更改标签. 跑步者的类型应该共享"而不是特定".
- Install your gitlab-ci-multi-runners on your
N
mashines BUT if the runner ask you for tags, tag the mashine with a specifc name e.g. "MashineWithManyCPUsWhatever". Please use thegitlab-ci-multi-runner register
command to do so. You can alternatively change the tags in Gitlab on the administration view after registration. The type of the runners should be "shared" not "specific".
- 当您在mashines上安装并标记每个跑步者时,请为您的工作贴标签. 示例:
- When you installed and tagged every runner on your mashines, tag you jobs. Example:
现在将在具有特定标签的特定mashine上执行所有作业. 有关更多信息,请参见 Gitlab CI文档
Every job will now be excecuted on the specific mashine with the specific tag. For more Information see Gitlab CI Documentation
这篇关于Gitlab CI:在多台机器上运行同一组测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!