Autoscaler agent labels do not work as documented

When DRONE_AGENT_LABELS env variable is set like documentation says:
https://autoscale.drone.io/reference/drone-agent-labels/

Autoscaler does not schedule servers at all. When I manually run command

drone server create

it starts a server and runs proper pipeline with exact labels I configured in pipeline definition.

Is anyone tried autoscaler with runner labels?

Hi @Roman_Navrotskii,

Can you please help us out with the following:

  1. Are you trying to autoscale the servers and these labels dont show correctly? you can refer to Autoscaling with Labels?
  2. While you create a server manually are the labels still incorrect?
    If possible can you please share your configuration to see how you are using the DRONE_AGENT_LABELS?

Thank you

Hi @csgit

Thanks for your answer!

Yes, I try to scale servers by labels. In pipeline definition I added

node:
  somelabel: somelabelvalue

And on autoscaler configuration I have environment variable

DRONE_AGENT_LABELS=somelabel:somelabelvalue

So I believe that autoscaler should schedules only servers for pipelines with that label.

When I create server manually all labels passed to RUNNER correctly.

Actually I just need an amd64 and arm64 builds. I use 2 autoscalers with different runner configuration (instance type, image, min, max). Both autoscalers connected to the single drone server.

The problem is when I am trying to use labels, it ignores pipelines with that labels (and ignores all pipelines as well).

I am curious why do we need parameter DRONE_AGENT_LABELS at all?

@csgit

Am I use DRONE_AGENT_LABELS properly? Or maybe I misunderstood something?

1 Like

HI @Roman_Navrotskii ,

I just need an amd64 and arm64 builds.

Am I use DRONE_AGENT_LABELS properly? Or maybe I misunderstood something?

I’m testing this configuration now and ran into the same question about arm64. I believe your proposal is correct: the autoscaler uses DRONE_AGENT_LABELS=somelabel:somelabelvalue , and it should match the pipeline definition “node: somelabel: somelabelvalue”. However yesterday we discovered another variable that must match in order for the autoscaler to launch the instances. If you set “arch: arm64” in the pipeline definition, the autoscaler should have DRONE_AGENT_ARCH=arm64 variable. Otherwise, nothing happens. Everything needs to match, both the arch setting (if it’s been configured) and the labels.

I am curious why do we need parameter DRONE_AGENT_LABELS at all?

You don’t necessarily need DRONE_AGENT_LABELS. Labels are helpful to create arbitrary correlations between runners and pipelines, for any reason you might think of. You could choose to have five differently configured autoscalers, and route jobs based on various criteria, using labels.