keda icon indicating copy to clipboard operation
keda copied to clipboard

add sessionsPerNode and setSessionsFromHub parameters to selenium-grid scaler

Open rubroboletus opened this issue 1 year ago • 4 comments

Added two new parameters for selenium-grid scaler, allowing to scale up based on real browser node sizing. When sesSessionsFromHub is set, KEDA will look for existing browser nodes with browserName, browserVersion and platformName same as scaledObject / scaledJob, get maxSessions and calculate how much nodes it needs. When no existing browser node matches, it uses sessionsPerNode value for calculation.

Checklist

  • [ ] When introducing a new scaler, I agree with the scaling governance policy
  • [x] I have verified that my change is according to the deprecations & breaking changes policy
  • [x] Tests have been added
  • [x] Changelog has been updated and is aligned with our changelog requirements
  • [ ] A PR is opened to update our Helm chart (repo) (if applicable, ie. when deployment manifests are modified)
  • [x] A PR is opened to update the documentation on (repo) (if applicable)
  • [x] Commits are signed with Developer Certificate of Origin (DCO - learn more)

Fixes #

Relates to #

rubroboletus avatar Aug 09 '24 05:08 rubroboletus

Could you open an issue and provide a description of your improvement for better tracking?

SpiritZhou avatar Aug 13 '24 03:08 SpiritZhou

/run-e2e selenium Update: You can check the progress here

JorTurFer avatar Aug 19 '24 21:08 JorTurFer

@rubroboletus , there are 2 checks failing:

  • DCO (you need to sign all the commits)
  • Static checks (https://github.com/kedacore/keda/actions/runs/10419863822/job/28858769588?pr=6055#step:6:128)

Could you take a look please?

JorTurFer avatar Aug 19 '24 21:08 JorTurFer

@rubroboletus , there are 2 checks failing:

  • DCO (you need to sign all the commits)
  • Static checks (https://github.com/kedacore/keda/actions/runs/10419863822/job/28858769588?pr=6055#step:6:128)

Could you take a look please?

@JorTurFer Fixed.

rubroboletus avatar Aug 20 '24 08:08 rubroboletus

/run-e2e selenium Update: You can check the progress here

JorTurFer avatar Sep 02 '24 20:09 JorTurFer

@rubroboletus, can you review this PR https://github.com/kedacore/keda/pull/6169 to see it can solve your expectation. In the PR, there is no need for new params. We extract Node stereotypes, node sessions against requests capabilities. Expect that a Node with different max sessions is set, scaler will look at the slots available and return correct scale needed.

VietND96 avatar Sep 18 '24 07:09 VietND96

@rubroboletus, can you review this PR #6169 to see it can solve your expectation. In the PR, there is no need for new params. We extract Node stereotypes, node sessions against requests capabilities. Expect that a Node with different max sessions is set, scaler will look at the slots available and return correct scale needed.

Problem is, that you can obtain info from the Grid only in case, that there is at least one node of such type running. When there is no node of such type running, you know nothing about its settings.

rubroboletus avatar Sep 18 '24 09:09 rubroboletus

Ok, I can understand now, the problem for calculation when minReplica=0. Let me update my PR and add a test to prove it works.

VietND96 avatar Sep 18 '24 11:09 VietND96

I updated one more scaler param nodeMaxSessions (the naming aligns with CLI option --max-sessions - https://www.selenium.dev/documentation/grid/configuration/cli_options/#node) Few tests for that param could be seen in https://github.com/kedacore/keda/pull/6169/files#diff-59589fb3c981e73ac59806307eb5a26330cafb0260a88777cba9124621748a8cR1410

VietND96 avatar Sep 19 '24 06:09 VietND96