Closed umlaeute closed 10 months ago
I like this idea but were having an issue where no matter what the only method it uses to install gitlab-runner on the fly is via curl. Yesterday the upstream curl was having random issues and pipelines were failing to upload artifacts due to corrupted gitlab-runner inside the vm.
Reading the script in the repo here and even running it manually on one of our vms works but never works when gitlab runs via pipeline. Since curl is at /usr/bin in ventura/sonoma etc by default my only guess was the initial ssh to spin up the vm is somehow having a very limited PATH like /bin:/usr/bin
Sorry to hijack your issue!
Should we just bundle some version of the runners within the VM like we do with GitHub Runner? If a VM will have slightly outdated binary, is it a problem?
Should we just bundle some version of the runners within the VM like we do with GitHub Runner? If a VM will have slightly outdated binary, is it a problem?
I cant speak for the OP but that is what we are doing right now. Packer installs via brew inside the vm. We like the idea of the functionality to install during the tart prepare stage but so far it has never worked for our setup as detailed in #53
We also keep our gitlab-runner versions pretty close to current; the versions on the mac machines themselves get updated weekly. It is probably not a huge issue though if the version inside the vm is slightly older. We are generating new packer images monthly.
@cosmoshepcat seems like a great approach. I guess we can also bundle it in our VMs so this branch will work:
@fkorotkov
Thats what I was referencing in my other issue #53 that code block does not work in our environment and not sure why. Even with both brew and gitlab-runner installed via packer inside the vm it never finds them and always uses curl to install.
Should we just bundle some version of the runners within the VM like we do with GitHub Runner? If a VM will have slightly outdated binary, is it a problem?
slightly outdated might not be a problem, but VM images tend to get stale.
and i did have bad experience in the past with VMs that were running more-than-slightly outdated versions of the gitlab-runner
. iirc, i've also experienced problems with too new gitlab-runner
binaries within the VMs (I cannot remember from the top of my head what went wrong exactly, but something along the lines of the VM-host running an gitlab-runner
that was much older than the one within the VM; at least I do have code in my pre-tart deploy scripts that ensures that the gitlab-runner
within the VM is exactly the same as the one on the host.
hence my original suggestions with being able to use the ${CI_RUNNER_VERSION}
variable.
in this vein: how about adding an option to just copy the ´gitlab-runner` binary from the host into the VM
value | installs... |
---|---|
host |
copies the gitlab-runner binary from the host into the VM |
this obviously only works if the host and the VM are similar.
I've been using
TART_EXECUTOR_INSTALL_GITLAB_RUNNER=true
in order to have agitlab-runner
on myghcr.io/cirruslabs/macos-monterey-xcode:latest
-based jobs for uploading artifacts.unfortunately, the gitlab-runner version installed via this method is rather old.
(Now homebrew currently ships
gitlab-runner_16.6.1
, so I figure the outdated version is because themacos-monterey-xcode
image has been created in 2002, and homebrew uses the old sources (and i tend to activate things likeHOMEBREW_NO_AUTO_UPDATE=1
on my CI systems, as i do not want to spend hours upgrading things likeandroind-ndk
that I never ever need).I also noticed, that
gitlab-runner
is either installed viabrew
(if available), or viacurl
: in the latter case, it will always download the latest version of the runner, whereas in thebrew
case it will install whatever is currently packaged.I find that i probably do not want the latest and greatest
gitlab-runner
(nor some outdated version) on the VM, but one that matches thegitlab-runner
that is running on the host controlling the VM.So i wonder whether it would make sense to extend the
TART_EXECUTOR_INSTALL_GITLAB_RUNNER
to also take a specific version number for the executor, so i could use more values for this variable:false
true
brew
curl
latest
gitlab-runner
(as published by gitlab)${CI_RUNNER_VERSION}
CI_RUNNER_VERSION
is a one of GitLab's predefined variables1.2.3
for the specific versions, tart would pick an appropriate installation method (though for simplicity's sake, i would just go for
curl
)