Special parameters for the git lab runner and docker container that it run
In some cases, I need to configure special parameters for the git lab runner that is created by the CML runner. I also need to be able to set special options for running the container. For example:
- git lab runner must have the parameter: privileged = true or
- docker container must be started with the option: --log-driver=fluentd --log-opt fluentd-address=XX.XX.XX.XX:24224
You can probably use the DOCKER_PRIVILEGED environment variable in the first case. Log driver options don't seem to be supported by GitLab runners configuration, though.
I wonder if we should close this issue with a cml.dev/doc pull request. ๐ค Allowing arbitrary config.toml values doesn't seem to provide any particular benefit when compared to the (already working) environment variable propagation.
Does using environment variables also work for runners on cloud machines? I have been trying to set the shared memory through DOCKER_SHM_SIZE by passing script=$(echo 'DOCKER_SHM_SIZE=4g' | base64) to --cloud-startup-script but with no success so far.
Something like cml runner ยทยทยท --cloud-startup-script="$(echo "export DOCKER_SHM_SIZE=4g" | base64 --wrap=0)" should work as expected after releasing https://github.com/iterative/terraform-provider-iterative/pull/370.
That's amazing! my training will finally be blazing fast again :) You're the best
๐ @MaxHuerlimann & @dmitry-spodarets, https://github.com/iterative/terraform-provider-iterative/pull/370 has been released. Can you confirm that it works as expected?
When I add --cloud-startup-script="$(echo "export DOCKER_SHM_SIZE=4g" | base64 --wrap=0)" such that the comment is
- cml-runner
--cloud=azure
--cloud-region=eu-west
--cloud-type=m
--labels=cml-runner
--cloud-startup-script=$(echo "export DOCKER_SHM_SIZE=4g" | base64 --wrap=0)
the deployment fails. The error message contains
Error: Error checking the runner status\nโ \nโ with iterative_cml_runner.runner,\nโ on main.tf line 14, in resource \"iterative_cml_runner\" \"runner\":\nโ 14: resource \"iterative_cml_runner\" \"runner\" {\nโ \nโ -- Logs begin at Thu 2022-01-27 12:44:00 UTC, end at Thu 2022-01-27\nโ 12:49:37 UTC. --\nโ Jan 27 12:49:22 iterative systemd[1]: Started cml.service.\nโ Jan 27 12:49:28 iterative cml.sh[17542]:\nโ {\"level\":\"info\",\"message\":\"Preparing workdir\nโ /tmp/tmp.xgJw8Xty7f/.cml/cml-jdr96m7kf4...\"}\nโ Jan 27 12:49:28 iterative cml.sh[17542]:\nโ {\"level\":\"info\",\"message\":\"Launching gitlab runner\"}\nโ Jan 27 12:49:32 iterative cml.sh[17542]:\nโ {\"level\":\"warn\",\"message\":\"SpotNotifier can not be started.\"}
If I remove the script line the deployment succeeds.
@MaxHuerlimann, can you please try it again?