tarantool / tarantool-qa

QA related issues of Tarantool
3 stars 0 forks source link

Change labels for distinguising regular and lightweight runners #303

Closed NickVolynkin closed 1 year ago

NickVolynkin commented 1 year ago

Problem

Lightweight runners with 1 CPU and 2Gb RAM are currently labeled with a full set of labels and a specific flavor label:

runs-on: [ self-hosted, Linux, x86_64, flavor-1-2 ]

Because of this, we must use the flavor label in workflows to distinguish them from the regular "workhorse" runners with 8 CPU and 16Gb RAM:

runs-on: [ self-hosted, Linux, x86_64, flavor-8-16 ]

This is inconvenient when used with matrix strategy in workflows. All other combinations of OS & arch don't have these flavor labels:

  example-job:
    strategy:
      fail-fast: false
      matrix:
        ARCH: [ ARM64, x86_64 ]
        OS: [ Linux, macOS ]
    # with Linux, it will sometimes run on flavor-1-2
    runs-on: [ self-hosted, ${{ matrix.OS }}, ${{ matrix.ARCH }} ]

Note that labels Linux and X86 are mandatory and cannot be removed. The full set of labels on such runners looks like this:

Screenshot 2023-01-12 at 12 17 13

Workflows currently using the lightweight runners: https://github.com/search?q=org%3Atarantool+flavor-1-2&type=code

Solution 1 [declined]

We can remove the label x86_64 from the lightweight runners, and also add a specific lightweight label.

The full set of labels will be:

Screenshot 2023-01-12 at 12 19 21

But the runners can be selected with just a few labels:

runs-on: [ self-hosted, lightweight ]

Workflows that use the matrix strategy must use the label x86_64 for architecture or have the specific ubuntu-20.04-self-hosted label. Otherwise, they will sometimes run on these lightweight runners.

The flavor* labels should stay, however. They give instant information about the runners' resources, which is good for people writing workflows. We should also add such labels to the macOS runners.

Solution 2 [accepted]

Add labels regular or lightweight to all our runners. For example, a heavy-load workflow, like compiling and testing, will use regular with all workflows combinations:

  example-job:
    strategy:
      fail-fast: false
      matrix:
        ARCH: [ ARM64, x86_64 ]
        OS: [ Linux, macOS ]
+   runs-on: [ self-hosted, ${{ matrix.OS }}, ${{ matrix.ARCH }}, regular ]
-   runs-on: [ self-hosted, ${{ matrix.OS }}, ${{ matrix.ARCH }} ]

It will make a few existing workflows much tidier:

jobs:
  prepare-build-base:
+   runs-on: [ self-hosted, Linux, '${{ matrix.sys-arch }}', regular ]
-   runs-on: [ self-hosted, Linux, '${{ matrix.flavor }}', '${{ matrix.sys-arch }}' ]
    strategy:
      fail-fast: false
      matrix:
+       sys-arch: [ x86_64, aarch64 ]
-       include:
-         - sys-arch: 'x86_64'
-           flavor: 'flavor-8-16'
-         - sys-arch: 'aarch64'
-           flavor: 'flavor-8-32'
ylobankov commented 1 year ago

Implemented, so closing it.