Skip to content

Commit

Permalink
Fix deployment file create for kube deployment (#1454)
Browse files Browse the repository at this point in the history
* fix dpeloyment file create for kube deployment

* undo comment

* undelete file

* fix test

* fix test
  • Loading branch information
sunkickr committed Nov 28, 2023
1 parent 18d0c75 commit 7d5337e
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 7 deletions.
3 changes: 3 additions & 0 deletions cloud/deployment/fromfile/fromfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,10 @@ func getQueues(deploymentFromFile *inspect.FormattedDeployment, nodePools []astr
qList[i].IsDefault = requestedQueues[i].Name == defaultQueue
if requestedQueues[i].MinWorkerCount != nil {
qList[i].MinWorkerCount = *requestedQueues[i].MinWorkerCount
} else {
qList[i].MinWorkerCount = -1
}

qList[i].MaxWorkerCount = requestedQueues[i].MaxWorkerCount
qList[i].WorkerConcurrency = requestedQueues[i].WorkerConcurrency
qList[i].WorkerConcurrency = requestedQueues[i].WorkerConcurrency
Expand Down
11 changes: 6 additions & 5 deletions cloud/deployment/fromfile/fromfile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4433,11 +4433,12 @@ func TestGetQueues(t *testing.T) {
}
expectedWQList := []astro.WorkerQueue{
{
Name: "default",
IsDefault: true,
PodCPU: "0.1",
PodRAM: "0.25Gi",
NodePoolID: "test-pool-id",
Name: "default",
IsDefault: true,
PodCPU: "0.1",
PodRAM: "0.25Gi",
MinWorkerCount: -1,
NodePoolID: "test-pool-id",
},
}
qList := []inspect.Workerq{
Expand Down
10 changes: 9 additions & 1 deletion cloud/deployment/inspect/inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,15 @@ func getTemplate(formattedDeployment *FormattedDeployment) FormattedDeployment {
}
template.Deployment.EnvVars = newEnvVars
if template.Deployment.Configuration.Executor == deployment.KubeExecutor {
template.Deployment.WorkerQs = nil
var newWorkerQs []Workerq
for i := range template.Deployment.WorkerQs {
if template.Deployment.WorkerQs[i].Name == "default" {
template.Deployment.WorkerQs[i].PodCPU = ""
template.Deployment.WorkerQs[i].PodRAM = ""
newWorkerQs = append(newWorkerQs, template.Deployment.WorkerQs[i])
}
}
template.Deployment.WorkerQs = newWorkerQs
}

return template
Expand Down
7 changes: 6 additions & 1 deletion cloud/deployment/inspect/inspect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,12 @@ func TestFormatPrintableDeployment(t *testing.T) {
"cloud_provider": "",
"region": ""
},
"worker_queues": null,
"worker_queues": [
{
"name": "default",
"worker_type": "test-instance-type"
}
],
"alert_emails": [
"email1",
"email2"
Expand Down

0 comments on commit 7d5337e

Please sign in to comment.