Kubernetes executor: allow specifying logs and scripts directory path in runner configuration
Description
I am working with custom runtimes in kubernetes and I want to support gitlab runner with them.
Currently it works very well with FF_USE_LEGACY_KUBERNETES_EXECUTION_STRATEGY=true
, because it only relies on one build volume and kubectl exec. However, as the name suggests, it will probably be removed in the future which will cause my setup to break.
My current problem with non-legacy startegy is that I can only mount directories into my custom runtime to the specific path. E.g. /Volumes/Shared Dirs/<volume_name>
, which is possible to set for build dir with builds_dir
parameter, but not possible with scripts and logs volumes that are used in that strategy due to their hardcoded nature: https://gitlab.com/gitlab-org/gitlab-runner/-/blob/main/executors/kubernetes/kubernetes.go#L1221
Proposal
My proposal is to add both logs_dir
and scripts_dir
to supported configuration for custom cases like this similar to how builds_dir
is implemented here https://gitlab.com/gitlab-org/gitlab-runner/-/blob/main/executors/custom/api/config.go?ref_type=heads#L11
Please let me know your thoughts about it, as currently you also embed ProjectID and JobID for some reason to the default scripts and log path (even though its empty dir volume type). If omitting them is not a problem, I can go ahead and contribute to the project myself.