bazel-buildfarm icon indicating copy to clipboard operation
bazel-buildfarm copied to clipboard

Worker with different amount of memory

Open axel7083 opened this issue 3 years ago • 1 comments

We have in our project actions requiring more ram than others, since they are a minority, we would like to only have one worker with more ram. And target this workers when building/testing those greedy targets.

I saw the https://github.com/bazelbuild/bazel-buildfarm/pull/694, with the min-mem / max-mem, but I did not understand how to let the server know how much each workers have memory available.

I tried adding to the dequeue_match_settings the max-mem property with the maximum amount available for each worker, but this is leading to problems with the queuing system (no match).

I am trying to see if they is a simple way of doing this. Without having to create a new queue.

axel7083 avatar Jan 20 '22 17:01 axel7083

If you wish to use a single queue (instead of multiple queues), I believe this can still be achieved. Your single queue may need to accept unmatched properties. Something like:

      provisioned_queues: {
        queues: {
          name: "main"

          platform: {
            properties: {
              name: "min-cores"
              value: "*"
            }
            properties: {
              name: "max-cores"
              value: "*"
            }
          }
          allow_unmatched: True
        }
      }

The dequeue properties check is performed here: https://github.com/bazelbuild/bazel-buildfarm/blob/891d3e678946bdd72f2ff69e5b12190c83a7c484/src/main/java/build/buildfarm/worker/DequeueMatchEvaluator.java#L169-L171

Unfortunately, the min/max properties don't get their range checked. It either needs to be an exact match or use *.
Maybe we should change that.

If you are still not getting the desired behavior, please post your worker/sever configs as an example.

luxe avatar Jan 25 '22 12:01 luxe