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: Added SQS support to ArmoniK #1344

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

AncientPatata
Copy link
Contributor

@AncientPatata AncientPatata commented Dec 12, 2024

Motivation

SQS was added to ArmoniK.Core but was never supported in ArmoniK.Infra, now that SQS is added as a module to ArmoniK.Infra. This PR makes adjustments to ArmoniK to support these upcoming changes;

Description

Created instances of the SQS module/service account and made it toggleable through a variable. Since integrating SQS required creating a service account that will be used by ArmoniK's control and compute planes.

Testing

Tested, queue is being created, used and tasks are executed in ArmoniK.

Impact

TODO.

Additional Information

Not Applicable.

Checklist

  • My code adheres to the coding and style guidelines of the project.
  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • I have thoroughly tested my modifications and added tests when necessary.
  • Tests pass locally and in the CI.
  • I have assessed the performance impact of my modifications.

@AncientPatata AncientPatata force-pushed the ad/sqs_testing branch 3 times, most recently from 13ffd16 to 7b1f85c Compare December 20, 2024 11:34
@AncientPatata AncientPatata marked this pull request as ready for review December 20, 2024 11:36
@AncientPatata AncientPatata changed the title Added SQS support to ArmoniK feat: Added SQS support to ArmoniK Dec 20, 2024
@AncientPatata
Copy link
Contributor Author

I would need to upgrade the version of Core to 0.29.1, and the ArmoniK.Infra PR would need to be merged first before merging this

@AncientPatata AncientPatata force-pushed the ad/sqs_testing branch 3 times, most recently from 8929679 to 47ecef9 Compare December 23, 2024 10:15
@@ -143,6 +144,24 @@ module "mq" {
kms_key_id = local.kms_key
}

module "sqs" {
count = length(var.sqs_service_account_name) > 0 ? 1 : 0
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
count = length(var.sqs_service_account_name) > 0 ? 1 : 0
count = can(coalesce(var.sqs_service_account_name)) ? 1 : 0

}

module "sqs_service_account" {
count = length(var.sqs_service_account_name) > 0 ? 1 : 0
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
count = length(var.sqs_service_account_name) > 0 ? 1 : 0
count = can(colaesce(var.sqs_service_account_name)) ? 1 : 0

@@ -76,4 +78,6 @@ module "armonik" {
image = local.ecr_images["${var.pod_deletion_cost.image}:${try(coalesce(var.pod_deletion_cost.tag), "")}"].image
tag = local.ecr_images["${var.pod_deletion_cost.image}:${try(coalesce(var.pod_deletion_cost.tag), "")}"].tag
})

depends_on = [module.sqs_service_account]
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this module is optional, how is this dependency managed when the module is not deployed ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wouldn't it be okay because the module is still deployed (just with count 0).. It's the same thing as the dependency you did with both mongodb and mongodb_sharded no? (We pass the two in even though we only deploy one of them)

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think such a PR should change so much versions

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right.. I think I should wait for the latest version of Core to be used in ArmoniK before merging though (and also of ArmoniK.Infra) since both are needed.

Comment on lines 306 to 307
type = string
default = ""
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
type = string
default = ""
type = optional(string)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Keyword "optional" can only be used for object type attributes..

@AncientPatata AncientPatata force-pushed the ad/sqs_testing branch 10 times, most recently from 1edc0b4 to 2784f1a Compare December 26, 2024 09:29
Copy link

sonarqubecloud bot commented Jan 8, 2025

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.

3 participants