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

Allow dynamic worker queue to be set #181

Merged
merged 7 commits into from
Dec 18, 2024
Merged

Allow dynamic worker queue to be set #181

merged 7 commits into from
Dec 18, 2024

Conversation

vandyliu
Copy link
Collaborator

Description

🧪 Functional Testing

Tested with this script

variable "env" {
  type = string
  default = "prod"
}

locals {
  worker_queue_config = {
    dev = [
      {
        name               = "default"
        is_default         = true
        astro_machine      = "A5"
        max_worker_count   = 10
        min_worker_count   = 0
        worker_concurrency = 5
      }
    ]
    default = [
      {
        name               = "default"
        is_default         = false
        astro_machine      = "A10"
        max_worker_count   = 3
        min_worker_count   = 1
        worker_concurrency = 10
      }
    ]
  }
}


resource "astro_deployment" "dedicated" {
  name                           = "test-wq-deployment"
  description                    = "Test deployment"
  type                           = "STANDARD"
  region                         = "us-east-1"
    cloud_provider               = "AWS"
  contact_emails                 = ["[email protected]"]
  default_task_pod_cpu           = "0.25"
  default_task_pod_memory        = "0.5Gi"
  executor                       = "CELERY"
  is_cicd_enforced               = false
  is_dag_deploy_enabled          = true
  is_development_mode            = true
  is_high_availability           = false
  resource_quota_cpu             = "10"
  resource_quota_memory          = "20Gi"
  scheduler_size                 = "SMALL"
  workspace_id                   = "cm4rl55w8000501ghao8mnkwd"
  environment_variables          = []
  worker_queues                  = lookup(local.worker_queue_config, var.env, local.worker_queue_config["default"])
}

📸 Screenshots

Screenshot 2024-12-16 at 2 09 11 PM

📋 Checklist

  • Added/updated applicable tests
  • Added/updated examples in the examples/ directory
  • Updated any related documentation

@vandyliu vandyliu requested a review from a team as a code owner December 16, 2024 22:09
@@ -645,20 +645,6 @@ func (r *DeploymentResource) ValidateConfig(
return
}

// Need to do dynamic validation based on the executor and worker queues
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

https://astronomer.slack.com/archives/C05V3UUHFAN/p1734363978465609

Seems that if we want to allow customers to set this dynamically, we cannot use this static checking

Copy link
Collaborator

@ichung08 ichung08 left a comment

Choose a reason for hiding this comment

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

approving as changes look good - do we need to update any tests?

@vandyliu vandyliu merged commit 9edf368 into main Dec 18, 2024
9 checks passed
@vandyliu vandyliu deleted the fix-dynamic-wq branch December 18, 2024 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants