|
| 1 | +--- |
| 2 | +id: organization-runner-configuration |
| 3 | +description: Organization Runner Configuration |
| 4 | +image: "https://cirun.io/cirun-summary-image-v4.png" |
| 5 | +keywords: [Cirun, Examples, Cloud Platform, Runners] |
| 6 | +--- |
| 7 | + |
| 8 | +# Organization Runners Config |
| 9 | + |
| 10 | +When using cirun.io in an organization on multiple repositories, quite often it is the case |
| 11 | +that you have similar `.cirun.yml` files across multiple repositories. To solve this problem, |
| 12 | +cirun provides a way to define global cirun configuration at organization level, such that |
| 13 | +you define all the configuration at one place and you can use that in all the repositories. |
| 14 | + |
| 15 | +To use this feature you'd create a repository named `.cirun` in your organization |
| 16 | +and create a global configuration file named `.cirun.global.yml` in the root directory, |
| 17 | +like the following: |
| 18 | + |
| 19 | + |
| 20 | +### `.cirun.global.yml` |
| 21 | + |
| 22 | +This is the file where you will define all the runner configurations you would |
| 23 | +want to use in the various GitHub Actions workflows in various repositories |
| 24 | +in the organization. The format of this file is same as `.cirun.yml`, for example: |
| 25 | + |
| 26 | + |
| 27 | +```yaml |
| 28 | +runners: |
| 29 | + - name: aws-gpu-runner |
| 30 | + cloud: aws |
| 31 | + instance_type: g4dn.xlarge |
| 32 | + machine_image: ami-0939f4afb89c09aa1 |
| 33 | + labels: |
| 34 | + - cirun-aws-gpu |
| 35 | + |
| 36 | + - name: aws-cpu-runner-pass |
| 37 | + cloud: aws |
| 38 | + instance_type: t2.small |
| 39 | + machine_image: ami-06fd8a495a537da8b |
| 40 | + labels: |
| 41 | + - cirun-aws-cpu |
| 42 | + |
| 43 | + - name: aws-cpu-arm-runner |
| 44 | + cloud: aws |
| 45 | + instance_type: a1.medium |
| 46 | + machine_image: ami-0229f8cfc24033d05 |
| 47 | + labels: |
| 48 | + - cirun-aws-cpu-arm |
| 49 | + |
| 50 | + - name: aws-multiple-runner |
| 51 | + cloud: aws |
| 52 | + instance_type: t2.small |
| 53 | + machine_image: |
| 54 | + - ami-06fd8a495a537da8b |
| 55 | + - ami-06fd8a495a537da8b |
| 56 | + - ami-06fd8a495a537da8b |
| 57 | + - ami-06fd8a495a537da8b |
| 58 | + - ami-06fd8a495a537da8b |
| 59 | + region: |
| 60 | + - sa-east-1 |
| 61 | + - me-south-1 |
| 62 | + - eu-north-1 |
| 63 | + - eu-west-1 |
| 64 | + - eu-north-1 |
| 65 | + labels: |
| 66 | + - cirun-aws-multiple-runner |
| 67 | + |
| 68 | + - name: gcp-gpu-custom-machine-runner |
| 69 | + cloud: gcp |
| 70 | + gpu: nvidia-tesla-t4 |
| 71 | + instance_type: n1-standard-1 |
| 72 | + machine_image: cirun-labs:cirun-nvidia |
| 73 | + labels: |
| 74 | + - cirun-gcp-gpu-custom-machine |
| 75 | + |
| 76 | + - name: gcp-cpu-runner |
| 77 | + cloud: gcp |
| 78 | + instance_type: n1-standard-1 |
| 79 | + machine_image: ubuntu-2004-focal-v20220712 |
| 80 | + labels: |
| 81 | + - cirun-gcp-cpu |
| 82 | + |
| 83 | + - name: do-runner |
| 84 | + cloud: digitalocean |
| 85 | + instance_type: s-1vcpu-1gb |
| 86 | + machine_image: ubuntu-20-04-x64 |
| 87 | + labels: |
| 88 | + - cirun-do |
| 89 | + |
| 90 | + - name: azure-cpu-runner |
| 91 | + cloud: azure |
| 92 | + instance_type: Standard_DS1_v2 |
| 93 | + machine_image: Canonical:UbuntuServer:18.04-LTS:latest |
| 94 | + labels: |
| 95 | + - cirun-azure-cpu |
| 96 | + |
| 97 | + - name: azure-gpu-runner |
| 98 | + cloud: azure |
| 99 | + instance_type: Standard_NC4as_T4_v3 |
| 100 | + machine_image: nvidia:ngc_azure_17_11:ngc-base-version-22_03_0-gen2:latest |
| 101 | + region: southeastasia |
| 102 | + labels: |
| 103 | + - cirun-azure-gpu |
| 104 | + |
| 105 | + - name: azure-cpu-runner-spotinstance |
| 106 | + cloud: azure |
| 107 | + instance_type: Standard_DS1_v2 |
| 108 | + machine_image: Canonical:UbuntuServer:18.04-LTS:latest |
| 109 | + preemptible: true |
| 110 | + labels: |
| 111 | + - cirun-azure-cpu-spot |
| 112 | + |
| 113 | + - name: oracle-runner |
| 114 | + cloud: oracle |
| 115 | + instance_type: VM.Standard.E2.1.Micro |
| 116 | + machine_image: ocid1.image.oc1.uk-london-1.aaaaaaaavy5v3inu2ho2h57vwvvsclukdh4jvhg45um2nrejyxa7s46zcwoq |
| 117 | + region: uk-london-1 |
| 118 | + labels: |
| 119 | + - cirun-oracle-cpu |
| 120 | + |
| 121 | + - name: aws-windows-runner |
| 122 | + cloud: aws |
| 123 | + region: us-east-1 |
| 124 | + instance_type: t2.medium |
| 125 | + machine_image: ami-0f9c44e98edf38a2b |
| 126 | + preemptible: true |
| 127 | + labels: |
| 128 | + - cirun-aws-windows-runner |
| 129 | + |
| 130 | + - name: azure-windows-runner |
| 131 | + cloud: azure |
| 132 | + region: uksouth |
| 133 | + instance_type: Standard_D2s_v3 |
| 134 | + machine_image: "microsoftwindowsdesktop:windows-11:win11-22h2-pro:latest" |
| 135 | + labels: |
| 136 | + - cirun-azure-windows-runner |
| 137 | + |
| 138 | + - name: azure-custom-image-runner |
| 139 | + cloud: azure |
| 140 | + region: uksouth |
| 141 | + instance_type: Standard_D2s_v3 |
| 142 | + machine_image: "/subscriptions/7b9d1535-2655-4887-a82c-accb37d605a8/resourceGroups/ubuntu-cimage/providers/Microsoft.Compute/images/ubuntu-cimage-image-20240226023350" |
| 143 | + labels: |
| 144 | + - cirun-azure-custom-image-runner |
| 145 | +``` |
| 146 | +
|
| 147 | +
|
| 148 | +Now in your repositories github workflow files you can use refer the labels from the globa |
| 149 | +config defined in the `.cirun` repository, for example: |
| 150 | + |
| 151 | +```yaml |
| 152 | +runs-on: "azure-custom-image-runner--${{ github.run_id }}" |
| 153 | +``` |
0 commit comments