Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3925,16 +3925,20 @@
"properties": {
"cpu": {
"format": "int32",
"description": "Required CPU, basic tier should be 1, standard tier should be in range (1, 4)",
"description": "Required CPU. This should be 1 for Basic tier, and in range [1, 4] for Standard tier. This is deprecated starting from API version 2020-11-01-preview. Please use the resourceRequests field to set the CPU size.",
"default": 1,
"type": "integer"
},
"memoryInGB": {
"format": "int32",
"description": "Required Memory size in GB, basic tier should be in range (1, 2), standard tier should be in range (1, 8)",
"description": "Required Memory size in GB. This should be in range [1, 2] for Basic tier, and in range [1, 8] for Standard tier. This is deprecated starting from API version 2020-11-01-preview. Please use the resourceRequests field to set the the memory size.",
"default": 1,
"type": "integer"
},
"resourceRequests": {
"$ref": "#/definitions/ResourceRequests",
"description": "The requested resource quantity."
},
"jvmOptions": {
"description": "JVM parameter",
"type": "string"
Expand Down Expand Up @@ -4014,6 +4018,20 @@
}
}
},
"ResourceRequests": {
"description": "Deployment resource request payload",
"type": "object",
"properties": {
"cpu": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"cpu": { [](start = 6, length = 10)

As the property name this is not clear how the unit should be. I'd recommend making the name a bit clear and changing the type to integer. Please see an example of how both cpu and memory can be defined here:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is by design, we want to make cpu and memory field in our API align with the AKS Resource requests convention: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/

For cpu, the user can pass 1 or 1000m to represent the 1c.
For memory, the user can pass 1024Mi or 1Gi to represent the 1Gb.

For now, our system needs to support the size like 0.5c/0.5Gb App, the previous cpu and memoryInGb properties are integer type, so they can't represent the 0.5c/0.5Gb size, so we introduce a new field resourceRequests into the API request.

properties: {
  cpu: string
  memoryInGb: string
  resourceRequests: {
    cpu: string
    memory: string
  }
}

The user can use ethier cpu/memory or resourceRequests to represent his App's size.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see - thanks for the explanation.

"description": "Required CPU. 1 core can be represented by 1 or 1000m. This should be 500m or 1 for Basic tier, and {500m, 1, 2, 3, 4} for Standard tier.",
"type": "string"
},
"memory": {
"description": "Required memory. 1 GB can be represented by 1Gi or 1024Mi. This should be {512Mi, 1Gi, 2Gi} for Basic tier, and {512Mi, 1Gi, 2Gi, ..., 8Gi} for Standard tier.",
"type": "string"
}
}
},
"LogFileUrlResponse": {
"description": "Log file URL payload",
"required": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
"artifactSelector": "sub-module-1"
},
"deploymentSettings": {
"cpu": 1,
"memoryInGB": 3,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the removing of these properties intentional? I still see them in the deploymentSettings response model.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, it is intentional. According to current design, the users can use either cpu/memory or resourceRequests to represent his App's size. It is a straight either or, they don't need to set them all.

"resourceRequests": {
"cpu": "1000m",
"memory": "3Gi"
},
"jvmOptions": "-Xms1G -Xmx3G",
"environmentVariables": {
"env": "test"
Expand Down Expand Up @@ -46,6 +48,10 @@
"deploymentSettings": {
"cpu": 1,
"memoryInGB": 3,
"resourceRequests": {
"cpu": "1000m",
"memory": "3Gi"
},
"jvmOptions": "-Xms1G -Xmx3G",
"environmentVariables": {
"env": "test"
Expand Down Expand Up @@ -87,6 +93,10 @@
"deploymentSettings": {
"cpu": 1,
"memoryInGB": 3,
"resourceRequests": {
"cpu": "1000m",
"memory": "3Gi"
},
"jvmOptions": "-Xms1G -Xmx3G",
"environmentVariables": {
"env": "test"
Expand Down Expand Up @@ -128,6 +138,10 @@
"deploymentSettings": {
"cpu": 1,
"memoryInGB": 3,
"resourceRequests": {
"cpu": "1000m",
"memory": "3Gi"
},
"jvmOptions": "-Xms1G -Xmx3G",
"environmentVariables": {
"env": "test"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
"deploymentSettings": {
"cpu": 1,
"memoryInGB": 3,
"resourceRequests": {
"cpu": "1000m",
"memory": "3Gi"
},
"jvmOptions": "-Xms1G -Xmx3G",
"environmentVariables": {
"env": "test"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
"deploymentSettings": {
"cpu": 1,
"memoryInGB": 3,
"resourceRequests": {
"cpu": "1000m",
"memory": "3Gi"
},
"jvmOptions": "-Xms1G -Xmx3G",
"environmentVariables": {
"env": "test"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
"deploymentSettings": {
"cpu": 1,
"memoryInGB": 3,
"resourceRequests": {
"cpu": "1000m",
"memory": "3Gi"
},
"jvmOptions": "-Xms1G -Xmx3G",
"environmentVariables": {
"env": "test"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
"deploymentSettings": {
"cpu": 1,
"memoryInGB": 3,
"resourceRequests": {
"cpu": "1000m",
"memory": "3Gi"
},
"jvmOptions": "-Xms1G -Xmx3G",
"environmentVariables": {
"env": "test"
Expand Down Expand Up @@ -73,6 +77,10 @@
"deploymentSettings": {
"cpu": 1,
"memoryInGB": 3,
"resourceRequests": {
"cpu": "1000m",
"memory": "3Gi"
},
"jvmOptions": "-Xms1G -Xmx3G",
"environmentVariables": {
"env": "test"
Expand Down