Allow to choose Parallels VM image via .gitlab-ci.yml
Description
At the moment there is only way of specifying VM name with the Parallels Executor is using configuration TOML file (base_name
). This approach works perfectly fine while you have a single VM to use.
But if you have several VMs deployed on a single physical Runner the only way of using all VMs simultaneously is to register a separate Runner for each VM.
As result, having 3 being used VMs I have the following TOML file on each physical Runner:
concurrent = 1
check_interval = 0
[[runners]]
name = "***************"
output_limit = 100000
url = "*************************************"
token = "******************************"
executor = "parallels"
[runners.ssh]
user = "runner"
password = "1234"
host = "localhost"
[runners.parallels]
base_name = "Image1"
disable_snapshots = false
[runners.cache]
[[runners]]
name = "***************"
output_limit = 100000
url = "*************************************"
token = "******************************"
executor = "parallels"
[runners.ssh]
user = "runner"
password = "1234"
host = "localhost"
[runners.parallels]
base_name = "Image2"
disable_snapshots = false
[runners.cache]
[[runners]]
name = "***************"
output_limit = 100000
url = "*************************************"
token = "******************************"
executor = "parallels"
[runners.ssh]
user = "runner"
password = "1234"
host = "localhost"
[runners.parallels]
base_name = "Image3"
disable_snapshots = false
[runners.cache]
At the moment I have just 6 physical devices, after multiplying by 3 I have 18 logical Runners which are visible in a Admin panel.
This approach does not scale well. Having 10 physical devices and 10 different VM images I will have to register 100 logical Runners. It complicates deployment and configuration processes.
Proposal
With Docker Executor you also can specify a default image in the TOML file, there is image
parameter for that. But it can be then overridden from .gitlab-ci.yml using appropriate parameter. It would be great the same functionality for the Parallels Executor (maybe VirtualBox as well).
Easiest way could just to use already existing image
parameter for specifying a desired VM image name, for example the following way:
build:
stage: build
image: Image2
variables:
MACOSX_DEPLOYMENT_TARGET: "10.7"
script:
- some commands ...
after_script:
- git clean -dxff -e "build/" -e "osx/"
artifacts:
paths:
- build/dist/*/*
when: always
tags:
- osx
- parallels
retry: 1
This is very easy to implement. Other option could be introducing some new parameter but will require more efforts.
Links to related issues and merge requests / references
A link to a MR with a draft implementation for the proposal: !1257 (merged)