Skip to content

Commit

Permalink
Add extra large scheduler size option (#1696)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
neel-astro and pre-commit-ci[bot] authored Aug 8, 2024
1 parent aeb55a4 commit 63c58bc
Show file tree
Hide file tree
Showing 8 changed files with 318 additions and 112 deletions.
119 changes: 87 additions & 32 deletions astro-client-core/api.gen.go

Large diffs are not rendered by default.

46 changes: 28 additions & 18 deletions astro-client-platform-core/api.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 20 additions & 18 deletions cloud/deployment/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,6 @@ const (
awsCloud = "aws"
azureCloud = "azure"
standard = "standard"
LargeScheduler = "large"
MediumScheduler = "medium"
SmallScheduler = "small"
SMALL = "SMALL"
MEDIUM = "MEDIUM"
LARGE = "LARGE"
disable = "disable"
enable = "enable"
)
Expand Down Expand Up @@ -371,12 +365,14 @@ func Create(name, workspaceID, description, clusterID, runtimeVersion, dagDeploy
standardDeploymentRequest.WorkerQueues = &defautWorkerQueue
}
switch schedulerSize {
case SmallScheduler:
case strings.ToLower(string(astrocore.CreateStandardDeploymentRequestSchedulerSizeSMALL)):
standardDeploymentRequest.SchedulerSize = astroplatformcore.CreateStandardDeploymentRequestSchedulerSizeSMALL
case MediumScheduler:
case strings.ToLower(string(astrocore.CreateStandardDeploymentRequestSchedulerSizeMEDIUM)):
standardDeploymentRequest.SchedulerSize = astroplatformcore.CreateStandardDeploymentRequestSchedulerSizeMEDIUM
case LargeScheduler:
case strings.ToLower(string(astrocore.CreateStandardDeploymentRequestSchedulerSizeLARGE)):
standardDeploymentRequest.SchedulerSize = astroplatformcore.CreateStandardDeploymentRequestSchedulerSizeLARGE
case strings.ToLower(string(astrocore.CreateStandardDeploymentRequestSchedulerSizeEXTRALARGE)):
standardDeploymentRequest.SchedulerSize = astroplatformcore.CreateStandardDeploymentRequestSchedulerSizeEXTRALARGE
case "":
standardDeploymentRequest.SchedulerSize = astroplatformcore.CreateStandardDeploymentRequestSchedulerSize(configOption.DefaultValues.SchedulerSize)
}
Expand Down Expand Up @@ -418,12 +414,14 @@ func Create(name, workspaceID, description, clusterID, runtimeVersion, dagDeploy
dedicatedDeploymentRequest.WorkerQueues = &defautWorkerQueue
}
switch schedulerSize {
case SmallScheduler:
case strings.ToLower(string(astrocore.CreateStandardDeploymentRequestSchedulerSizeSMALL)):
dedicatedDeploymentRequest.SchedulerSize = astroplatformcore.CreateDedicatedDeploymentRequestSchedulerSizeSMALL
case MediumScheduler:
case strings.ToLower(string(astrocore.CreateStandardDeploymentRequestSchedulerSizeMEDIUM)):
dedicatedDeploymentRequest.SchedulerSize = astroplatformcore.CreateDedicatedDeploymentRequestSchedulerSizeMEDIUM
case LargeScheduler:
case strings.ToLower(string(astrocore.CreateStandardDeploymentRequestSchedulerSizeLARGE)):
dedicatedDeploymentRequest.SchedulerSize = astroplatformcore.CreateDedicatedDeploymentRequestSchedulerSizeLARGE
case strings.ToLower(string(astrocore.CreateStandardDeploymentRequestSchedulerSizeEXTRALARGE)):
dedicatedDeploymentRequest.SchedulerSize = astroplatformcore.CreateDedicatedDeploymentRequestSchedulerSizeEXTRALARGE
case "":
dedicatedDeploymentRequest.SchedulerSize = astroplatformcore.CreateDedicatedDeploymentRequestSchedulerSize(configOption.DefaultValues.SchedulerSize)
}
Expand Down Expand Up @@ -945,12 +943,14 @@ func Update(deploymentID, name, ws, description, deploymentName, dagDeploy, exec
DefaultTaskPodMemory: defaultTaskPodMemory,
}
switch schedulerSize {
case SmallScheduler:
case strings.ToLower(string(astrocore.CreateStandardDeploymentRequestSchedulerSizeSMALL)):
standardDeploymentRequest.SchedulerSize = astroplatformcore.UpdateStandardDeploymentRequestSchedulerSizeSMALL
case MediumScheduler:
case strings.ToLower(string(astrocore.CreateStandardDeploymentRequestSchedulerSizeMEDIUM)):
standardDeploymentRequest.SchedulerSize = astroplatformcore.UpdateStandardDeploymentRequestSchedulerSizeMEDIUM
case LargeScheduler:
case strings.ToLower(string(astrocore.CreateStandardDeploymentRequestSchedulerSizeLARGE)):
standardDeploymentRequest.SchedulerSize = astroplatformcore.UpdateStandardDeploymentRequestSchedulerSizeLARGE
case strings.ToLower(string(astrocore.CreateStandardDeploymentRequestSchedulerSizeEXTRALARGE)):
standardDeploymentRequest.SchedulerSize = astroplatformcore.UpdateStandardDeploymentRequestSchedulerSizeEXTRALARGE
case "":
standardDeploymentRequest.SchedulerSize = astroplatformcore.UpdateStandardDeploymentRequestSchedulerSize(*currentDeployment.SchedulerSize)
}
Expand Down Expand Up @@ -1006,12 +1006,14 @@ func Update(deploymentID, name, ws, description, deploymentName, dagDeploy, exec
WorkerQueues: &workerQueuesRequest,
}
switch schedulerSize {
case SmallScheduler:
case strings.ToLower(string(astrocore.CreateStandardDeploymentRequestSchedulerSizeSMALL)):
dedicatedDeploymentRequest.SchedulerSize = astroplatformcore.UpdateDedicatedDeploymentRequestSchedulerSizeSMALL
case MediumScheduler:
case strings.ToLower(string(astrocore.CreateStandardDeploymentRequestSchedulerSizeMEDIUM)):
dedicatedDeploymentRequest.SchedulerSize = astroplatformcore.UpdateDedicatedDeploymentRequestSchedulerSizeMEDIUM
case LargeScheduler:
case strings.ToLower(string(astrocore.CreateStandardDeploymentRequestSchedulerSizeLARGE)):
dedicatedDeploymentRequest.SchedulerSize = astroplatformcore.UpdateDedicatedDeploymentRequestSchedulerSizeLARGE
case strings.ToLower(string(astrocore.CreateStandardDeploymentRequestSchedulerSizeEXTRALARGE)):
dedicatedDeploymentRequest.SchedulerSize = astroplatformcore.UpdateDedicatedDeploymentRequestSchedulerSizeEXTRALARGE
case "":
dedicatedDeploymentRequest.SchedulerSize = astroplatformcore.UpdateDedicatedDeploymentRequestSchedulerSize(*currentDeployment.SchedulerSize)
}
Expand Down
Loading

0 comments on commit 63c58bc

Please sign in to comment.