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

feat: enable choose agent/worker socket type per partition #203

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion armonik/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
| <a name="input_chart_name"></a> [chart\_name](#input\_chart\_name) | Name for chart | `string` | `"keda-hpa"` | no |
| <a name="input_chart_version"></a> [chart\_version](#input\_chart\_version) | Version for chart | `string` | `"0.1.0"` | no |
| <a name="input_charts_repository"></a> [charts\_repository](#input\_charts\_repository) | Path to the charts repository | `string` | `"../charts"` | no |
| <a name="input_compute_plane"></a> [compute\_plane](#input\_compute\_plane) | Parameters of the compute plane | <pre>map(object({<br> partition_data = object({<br> priority = number<br> reserved_pods = number<br> max_pods = number<br> preemption_percentage = number<br> parent_partition_ids = list(string)<br> pod_configuration = any<br> })<br> replicas = number<br> termination_grace_period_seconds = number<br> image_pull_secrets = string<br> node_selector = any<br> annotations = any<br> service_account_name = string<br> polling_agent = object({<br> image = string<br> tag = string<br> image_pull_policy = string<br> limits = optional(map(string))<br> requests = optional(map(string))<br> conf = optional(any, {})<br> })<br> worker = list(object({<br> name = string<br> image = string<br> tag = string<br> image_pull_policy = string<br> limits = optional(map(string))<br> requests = optional(map(string))<br> conf = optional(any, {})<br> }))<br> cache_config = object({<br> memory = bool<br> size_limit = string # if larger than supported, the max value for the node will be used instead<br> })<br> readiness_probe = optional(bool, false)<br> hpa = any<br> }))</pre> | n/a | yes |
| <a name="input_compute_plane"></a> [compute\_plane](#input\_compute\_plane) | Parameters of the compute plane | <pre>map(object({<br> partition_data = object({<br> priority = number<br> reserved_pods = number<br> max_pods = number<br> preemption_percentage = number<br> parent_partition_ids = list(string)<br> pod_configuration = any<br> })<br> replicas = number<br> termination_grace_period_seconds = number<br> image_pull_secrets = string<br> node_selector = any<br> annotations = any<br> service_account_name = string<br> socket_type = optional(string)<br> polling_agent = object({<br> image = string<br> tag = string<br> image_pull_policy = string<br> limits = optional(map(string))<br> requests = optional(map(string))<br> conf = optional(any, {})<br> })<br> worker = list(object({<br> name = string<br> image = string<br> tag = string<br> image_pull_policy = string<br> limits = optional(map(string))<br> requests = optional(map(string))<br> conf = optional(any, {})<br> }))<br> cache_config = object({<br> memory = bool<br> size_limit = string # if larger than supported, the max value for the node will be used instead<br> })<br> readiness_probe = optional(bool, false)<br> hpa = any<br> }))</pre> | n/a | yes |
| <a name="input_configurations"></a> [configurations](#input\_configurations) | Extra configurations for the various components | <pre>object({<br> core = optional(any, [])<br> control = optional(any, [])<br> compute = optional(any, [])<br> worker = optional(any, [])<br> polling = optional(any, [])<br> log = optional(any, [])<br> metrics = optional(any, [])<br> jobs = optional(any, [])<br> })</pre> | n/a | yes |
| <a name="input_control_plane"></a> [control\_plane](#input\_control\_plane) | Parameters of the control plane | <pre>object({<br> name = string<br> service_type = string<br> replicas = number<br> image = string<br> tag = string<br> image_pull_policy = string<br> port = number<br> limits = optional(map(string))<br> requests = optional(map(string))<br> image_pull_secrets = string<br> node_selector = any<br> annotations = any<br> hpa = any<br> default_partition = string<br> service_account_name = string<br> })</pre> | n/a | yes |
| <a name="input_environment_description"></a> [environment\_description](#input\_environment\_description) | Description of the environment deployed | `any` | `null` | no |
Expand Down
27 changes: 15 additions & 12 deletions armonik/compute-plane-configmap.tf
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
# configmap with all the variables
module "compute_aggregation" {
source = "../utils/aggregator"
source = "../utils/aggregator"
for_each = var.compute_plane
conf_list = flatten([
{
env = {
ComputePlane__WorkerChannel__Address = "/cache/armonik_worker.sock"
ComputePlane__WorkerChannel__SocketType = "unixdomainsocket"
ComputePlane__AgentChannel__Address = "/cache/armonik_agent.sock"
ComputePlane__AgentChannel__SocketType = "unixdomainsocket"
ComputePlane__WorkerChannel__Address = each.value.socket_type == "tcp" ? "http://localhost:10667" : "/cache/armonik_worker.sock"
ComputePlane__WorkerChannel__SocketType = each.value.socket_type
ComputePlane__AgentChannel__Address = each.value.socket_type == "tcp" ? "http://localhost:10666" : "/cache/armonik_agent.sock"
ComputePlane__AgentChannel__SocketType = each.value.socket_type
}
},
module.log_aggregation, var.configurations.compute])
materialize_configmap = {
name = "compute-plane-configmap"
name = "compute-plane-${each.key}-configmap"
namespace = var.namespace
}
}

module "polling_all_aggregation" {
source = "../utils/aggregator"
source = "../utils/aggregator"
for_each = var.compute_plane
conf_list = flatten([{
env = {
ComputePlane__MessageBatchSize = "1"
Expand All @@ -27,25 +29,26 @@ module "polling_all_aggregation" {
Amqp__LinkCredit = "2"
Pollster__GraceDelay = "00:00:15"
}
}, module.core_aggregation, module.compute_aggregation, var.configurations.polling])
}, module.core_aggregation, module.compute_aggregation[each.key], var.configurations.polling])
materialize_configmap = {
name = "polling-configmap"
name = "polling-${each.key}-configmap"
namespace = var.namespace
}
}

module "worker_all_aggregation" {
source = "../utils/aggregator"
source = "../utils/aggregator"
for_each = var.compute_plane
conf_list = flatten([{
env = {
target_data_path = "/data"
FileStorageType = local.check_file_storage_type
}
}, {
env = local.file_storage_endpoints
}, module.compute_aggregation, var.configurations.worker])
}, module.compute_aggregation[each.key], var.configurations.worker])
materialize_configmap = {
name = "worker-configmap"
name = "worker-${each.key}-configmap"
namespace = var.namespace
}
}
6 changes: 3 additions & 3 deletions armonik/compute-plane.tf
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#Aggragation
#Aggregation
module "worker_aggregation" {
source = "../utils/aggregator"
for_each = var.compute_plane
conf_list = flatten([module.worker_all_aggregation, each.value.worker[0].conf])
conf_list = flatten([module.worker_all_aggregation[each.key], each.value.worker[0].conf])
}

module "polling_agent_aggregation" {
source = "../utils/aggregator"
for_each = var.compute_plane
conf_list = flatten([module.polling_all_aggregation,
conf_list = flatten([module.polling_all_aggregation[each.key],
{
env = {
for queue in tolist(local.supported_queues) : queue => each.key
Expand Down
1 change: 1 addition & 0 deletions armonik/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ variable "compute_plane" {
node_selector = any
annotations = any
service_account_name = string
socket_type = optional(string)
polling_agent = object({
image = string
tag = string
Expand Down
Loading