Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overlord can support many autoscalers of different categories #8695

Open
VladimirIordanov opened this issue Oct 18, 2019 · 1 comment
Open

Comments

@VladimirIordanov
Copy link

VladimirIordanov commented Oct 18, 2019

Motivation

Since #7066 Druid supports different categories of tasks which run on dedicated instance of MiddleManager. But Overlord still can spawn only one instance of MiddleManager via Autoscaler. That is not flexible when Druid should support different categories of tasks and cluster parameter for the each of the category is different. For instance realtime and batch tasks will require clusters of different configurations: workers count; CPU, memory, per each worker, etc. In that case overlord could provision dedicated cluster per each task category.

Proposed changes

Create CategoriedWorkerBehaviorConfig to support declaration of several autoscalers. Each of the autoscalers should have "category" property which should link it to according "category" of Task based on CategoryConfig.

Change all current implementations of ProvisioningStrategy interface to select appropriate AutoScaler from CategoriedWorkerBehaviorConfig during "provisioning" or "terminating". In that way overlord can spawn/terminate a corresponding cluster for a submitted task. If there is no matched autoscaler found in the config then the default one will be used. If there is no declaration of default autoscaler then there will be no autoscaling and tasks will be in pending state.

Rationale

Structure of the CategoriedWorkerBehaviorConfig will be like this:

{
  "selectStrategy": {
    "type": "fillCapacity",
    ...
  },
  "autoScalers": [
    {
        "type": "ec2",
        "minNumWorkers": 0,
        "maxNumWorkers: 5,
        "envConfig": {
           "availabilityZone": "us-east-1a"
           ...
        }
        ...
    },
    {
        "type": "ec2",
        "category": "_category_1_",
        "minNumWorkers": 2,
        "maxNumWorkers: 10,
        "envConfig": {
           "availabilityZone": "us-west-2a"
           ...
        }
        ...
    },
    {
        "type": "ec2",
        "category": "_category_1_",
        "minNumWorkers": 1,
        "maxNumWorkers: 3,
        "envConfig": {
           "availabilityZone": "us-east-2a"
           ...
        }
        ...
    }
  ]
}

The "autoScalers" section will contain definitions of all supported autoscalers as array.
Where "category_1" and "category_2" are category names according to supported types of tasks (and middleManagers). Default autoscaler will not have category name and its declaration is optional. If it was declared then any task which doesn't have autoscaler for its category will be served by default autoscaler.

Operational impact

No impact because this PR will not change the existing config files.

VladimirIordanov pushed a commit to VladimirIordanov/incubator-druid that referenced this issue Nov 25, 2019
VladimirIordanov pushed a commit to VladimirIordanov/incubator-druid that referenced this issue Nov 25, 2019
 - Changed behavior config structure.
 - Small refactoring
 - Extended unit tests
VladimirIordanov pushed a commit to VladimirIordanov/incubator-druid that referenced this issue Nov 25, 2019
VladimirIordanov pushed a commit to VladimirIordanov/incubator-druid that referenced this issue Nov 25, 2019
VladimirIordanov pushed a commit to VladimirIordanov/incubator-druid that referenced this issue Nov 25, 2019
VladimirIordanov pushed a commit to VladimirIordanov/incubator-druid that referenced this issue Nov 25, 2019
VladimirIordanov pushed a commit to VladimirIordanov/incubator-druid that referenced this issue Nov 25, 2019
VladimirIordanov pushed a commit to VladimirIordanov/incubator-druid that referenced this issue Nov 25, 2019
VladimirIordanov pushed a commit to VladimirIordanov/incubator-druid that referenced this issue Nov 25, 2019
 - Added "category" field into Autoscaler
 - Changed config format to support the "category" field
 - Fixed parameters of unit tests
VladimirIordanov pushed a commit to VladimirIordanov/incubator-druid that referenced this issue Nov 25, 2019
VladimirIordanov pushed a commit to VladimirIordanov/incubator-druid that referenced this issue Nov 25, 2019
VladimirIordanov pushed a commit to VladimirIordanov/incubator-druid that referenced this issue Nov 25, 2019
 - Put category information into Autoscaler
 - Changed structure of behavior config
 - Changed CategoriedProvisioningStrategy accordingly
 - Fixed bug in PendingTaskBasedWorkerProvisioningStrategy
 - Extended unit tests
 - Code cleanup and refactoring
VladimirIordanov pushed a commit to VladimirIordanov/incubator-druid that referenced this issue Nov 26, 2019
VladimirIordanov pushed a commit to VladimirIordanov/incubator-druid that referenced this issue Nov 27, 2019
VladimirIordanov pushed a commit to VladimirIordanov/incubator-druid that referenced this issue Dec 2, 2019
 - Introduced new logic into the existing strategies
VladimirIordanov pushed a commit to VladimirIordanov/incubator-druid that referenced this issue Dec 4, 2019
VladimirIordanov pushed a commit to VladimirIordanov/incubator-druid that referenced this issue Dec 4, 2019
VladimirIordanov pushed a commit to VladimirIordanov/incubator-druid that referenced this issue Dec 4, 2019
VladimirIordanov pushed a commit to VladimirIordanov/incubator-druid that referenced this issue Dec 4, 2019
VladimirIordanov pushed a commit to VladimirIordanov/incubator-druid that referenced this issue Dec 4, 2019
 - Added "category" field into Autoscaler
 - Changed config format to support the "category" field
 - Fixed parameters of unit tests
VladimirIordanov pushed a commit to VladimirIordanov/incubator-druid that referenced this issue Dec 4, 2019
VladimirIordanov pushed a commit to VladimirIordanov/incubator-druid that referenced this issue Dec 4, 2019
VladimirIordanov pushed a commit to VladimirIordanov/incubator-druid that referenced this issue Dec 4, 2019
 - Put category information into Autoscaler
 - Changed structure of behavior config
 - Changed CategoriedProvisioningStrategy accordingly
 - Fixed bug in PendingTaskBasedWorkerProvisioningStrategy
 - Extended unit tests
 - Code cleanup and refactoring
VladimirIordanov pushed a commit to VladimirIordanov/incubator-druid that referenced this issue Dec 4, 2019
VladimirIordanov pushed a commit to VladimirIordanov/incubator-druid that referenced this issue Dec 4, 2019
VladimirIordanov pushed a commit to VladimirIordanov/incubator-druid that referenced this issue Dec 4, 2019
 - Introduced new logic into the existing strategies
VladimirIordanov pushed a commit to VladimirIordanov/incubator-druid that referenced this issue Dec 4, 2019
VladimirIordanov pushed a commit to VladimirIordanov/incubator-druid that referenced this issue Dec 4, 2019
 - Added more test cases
 - Refactored unit tests
VladimirIordanov pushed a commit to VladimirIordanov/incubator-druid that referenced this issue Dec 5, 2019
@VladimirIordanov VladimirIordanov changed the title Support different types of MiddleManagers by Autoscaler Support different types of Autoscalers Dec 11, 2019
VladimirIordanov pushed a commit to VladimirIordanov/incubator-druid that referenced this issue Jan 29, 2020
 - Used Default Worker Category as a fallback for null worker categories
VladimirIordanov pushed a commit to VladimirIordanov/incubator-druid that referenced this issue Jan 30, 2020
 - Refactored legacy code to avoid NPE
 - Removed duplicates
VladimirIordanov pushed a commit to VladimirIordanov/incubator-druid that referenced this issue Jan 31, 2020
VladimirIordanov pushed a commit to VladimirIordanov/incubator-druid that referenced this issue Feb 4, 2020
 - Added more debug info
 - Removed duplicated code
VladimirIordanov pushed a commit to VladimirIordanov/incubator-druid that referenced this issue Feb 5, 2020
@VladimirIordanov VladimirIordanov changed the title Support different types of Autoscalers Overlord can support many autoscalers of different categories Feb 7, 2020
VladimirIordanov pushed a commit to VladimirIordanov/incubator-druid that referenced this issue Feb 13, 2020
sascha-coenen pushed a commit to smaato/druid that referenced this issue Feb 14, 2020
… Add documentation and javadoc comments. Fixed naming of one class.
sascha-coenen pushed a commit to smaato/druid that referenced this issue Feb 19, 2020
… fix spelling in documentation and code to pass spellchecker tests
sascha-coenen pushed a commit to smaato/druid that referenced this issue Feb 26, 2020
… remove orphaned classes according to findings duriing code review.
@fxpz
Copy link

fxpz commented Sep 21, 2022

Any update on this feature?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants