Closed tejassharma96 closed 3 years ago
Looks like you have the architecture for this since you have a StartVMRequest struct. You'd need to perform some minor refactoring by adding external_id
, updating name
so it translates to name
rather than name_template
, and adding name_template
as its own property.
You would then just need to update the instantiation of the StartVMRequest to populate those variables.
I'd love to make a pr for this but am unfamiliar with the code base and the programming language, so I wouldn't know, eg, what sort of tests need to be updated. If someone could point me to any tests relevant to making these changes, I'd be happy to update those tests and make the change myself.
The top instance example from the image above is the defaults. The bottom is using the following for the registration:
./out/binaries/anka-gitlab-runner-darwin-amd64 register --non-interactive \
. . .
--name "localhost shared runner" \
. . .
--executor anka \
--anka-instance-name "triggered by shared runner" \
--anka-external-id "http://test123.com" \
. . .
The code looks to be done so I'm working on the CI tests now. This will be released as 1.4.0 once they pass.
Will those also be configurable from within the gitlab-ci yml file? Or just when registering the runner. It'd be great to have them configurable from the yml file too :)
@tejassharma96, just to confirm: You mean set an ENV under variables
?
Yep, exactly, and then they can be read from there the same way we can currently set ANKA_TEMPLATE_UUID
etc (https://github.com/veertuinc/gitlab-runner/blob/aa0a550808278288fbf71b016ffd00166f69ee9a/executors/anka/executor_anka.go#L61)
It would be great to match specific instances in the controller to which job they're running on gitlab. The controller has custom fields for "Name" and "External ID", could they be set up to pull from our gitlab ci files? e.g for my use case I might use
$CI_PROJECT_NAME
andCI_JOB_ID
)