Skip to content

Allow OS overwrite via ShellScriptInfo

What does this MR do?

Allows to set the runtime OS for a job explicitly in ShellScriptInfo.

Why was this MR needed?

The runner manager can run on a different OS than the job, e.g. when the k8s executor is used, the runner manager runs on a linux node, while the jobs are set up to run on windows nodes. This adds the option to overwrite that via the ShellScriptInfo, by setting its RuntimeOS.

We use this for building up the git credential helper command, which needs to be slightly different on different combinations of OS and powershell/pwsh.

What's the best way to test this MR?

  • set up a cluster with windows nodes

    cluster setup
    clusterName='cl-win'
    location='europe-west1-c'
    imageType='WINDOWS_LTSC_CONTAINERD'
    winVersion='ltsc2019'
    gcloud container clusters create "$clusterName" --enable-ip-alias --num-nodes=1 --location "$location"
    gcloud container node-pools create winnodes --cluster="$clusterName" --image-type="$imageType" --no-enable-autoupgrade --machine-type=n1-standard-2 --windows-os-version="$winVersion" --location "$location" --num-nodes=1
  • run the runner manager on linux (locally on your non-windows workstation or by deploying it to a linux node)

  • set up a runner which uses powershell (not pwsh!) and runs jobs on the windows nodes

  • set the FF_GIT_URLS_WITHOUT_TOKENS

  • run any job that pulls a private repo

  • see it succeed

Previous to this change the git cred helper would have failed (with these logs), and because the repo can't be pulled, the whole job would have failed, too.

For example configs, see FF_GIT_URLS_WITHOUT_TOKENS & kubernetes & power... (#38629 - closed)

What are the relevant issue numbers?

closes: FF_GIT_URLS_WITHOUT_TOKENS & kubernetes & power... (#38629 - closed)

Edited by Hannes Hörl

Merge request reports

Loading