Skip to content

Conversation

@leek
Copy link
Owner

@leek leek commented Oct 22, 2025

Description

This PR refactors the ECS infrastructure to separate queue worker and scheduler service configurations from the web service, allowing independent resource allocation for each service type.

Key Changes:

  • Introduced dedicated CPU, memory, and scaling variables for queue worker and scheduler services
  • Updated variable descriptions to clarify service-specific resource allocations
  • Corrected the project name from "Laravel" to "Apollo" in the main tags

Summary by CodeRabbit

  • New Features

    • Modularized compute resources: separate configurable services for web, queue worker, and scheduler with independent CPU, memory, and desired-task settings
    • Support for per-service sizing and counts for background and scheduled tasks
  • Chores

    • Improved variable descriptions and documentation for clearer service-specific configuration guidance

@leek leek requested a review from Copilot October 22, 2025 13:54
@leek leek self-assigned this Oct 22, 2025
@leek leek added the enhancement New feature or request label Oct 22, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the ECS infrastructure to separate queue worker and scheduler service configurations from the web service, allowing independent resource allocation for each service type.

Key Changes:

  • Introduced dedicated CPU, memory, and scaling variables for queue worker and scheduler services
  • Updated variable descriptions to clarify service-specific resource allocations
  • Corrected the project name from "Laravel" to "Apollo" in the main tags

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
terraform/variables.tf Added queue worker and scheduler variable definitions with enhanced descriptions for web service variables
terraform/modules/compute/variables.tf Added queue worker and scheduler configuration variables with organization sections
terraform/modules/compute/main.tf Updated locals to use new service-specific variables instead of shared container resources
terraform/main.tf Passed new queue worker and scheduler variables to the compute module and updated project tag
terraform/environments/example.tfvars Reorganized configuration with separate sections for web, queue worker, and scheduler services

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@gemini-code-assist
Copy link

Summary of Changes

Hello @leek, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refactors the ECS Fargate infrastructure configuration by introducing distinct and granular resource definitions for the web service, queue workers, and schedulers. This change moves away from a monolithic container configuration, allowing for independent tuning of CPU, memory, and desired task counts for each critical application component. The update enhances flexibility in resource management and improves the scalability and operational efficiency of the ECS environment.

Highlights

  • Dedicated ECS Configurations: Introduced separate Terraform variables for CPU, memory, and desired task counts for ECS Fargate web services, queue workers, and schedulers.
  • Granular Resource Control: Enabled independent scaling and resource allocation for different application components (web, queue, scheduler) within the ECS cluster.
  • Terraform Module Updates: Updated the 'compute' Terraform module to consume these new, component-specific configuration variables.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@leek leek changed the title feat(ecs): split queue and scheduler from web feat(ecs): allow customization of sizing of each task Oct 22, 2025
@leek
Copy link
Owner Author

leek commented Oct 22, 2025

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 22, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces separate configurations for the web service, queue worker, and scheduler in the Terraform infrastructure. It modifies the terraform.tfvars, main.tf, modules/compute/main.tf, modules/compute/variables.tf, and variables.tf files to accommodate these changes. The goal is to split the queue and scheduler from the web service, allowing for more granular resource allocation and scaling. I have provided comments addressing potential issues related to variable descriptions and consistency in resource configurations.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 22, 2025

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Container resource configuration is parameterized: queue worker and scheduler now have separate CPU, memory, and desired_count inputs instead of hardcoded values. New variables are added at root and module levels and wired into the compute module; web service variables and descriptions are clarified. No public signatures were removed.

Changes

Cohort / File(s) Summary
Environment configuration
terraform/environments/example.tfvars
Container resources section reorganized into labeled components (Web Service, Queue Worker, Scheduler) and updated to reference dedicated queue_worker_* and scheduler_* variables.
Root module inputs & wiring
terraform/main.tf, terraform/variables.tf
Added six new public variables: queue_worker_cpu, queue_worker_memory, queue_worker_desired_count, scheduler_cpu, scheduler_memory, scheduler_desired_count. Existing web service variable descriptions clarified. New variables are passed into the compute module.
Compute module implementation
terraform/modules/compute/main.tf, terraform/modules/compute/variables.tf
Worker service definitions (queue-worker and scheduler) changed to use the new module variables (queue_worker_*, scheduler_*) for CPU, memory, and desired_count; variables declared with descriptions and defaults.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Multiple related files updated to add and wire new variables; changes are consistent but require verifying defaults, module inputs, and example environment values.

Possibly related PRs

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The PR title "allow customization of sizing of each task" is directly related to the main changes in the changeset. The raw summary shows that the core purpose is to introduce dedicated CPU, memory, and desired count variables for queue workers and schedulers, enabling independent resource allocation for each service type. The title accurately captures this intent—allowing customization of resource sizing per service. The title is concise, clear, and specific enough that a teammate scanning history would understand this is about ECS task sizing customization.
Description Check ✅ Passed The PR description provides substantive content in the Description section, clearly explaining the refactoring of ECS infrastructure to separate queue worker and scheduler configurations from the web service. The Key Changes section is well-populated with three specific points about new variables, updated descriptions, and the project name correction. However, several template sections remain incomplete or unchecked, including Type of Change (no checkbox marked), Testing (all items unchecked), Related Issues (blank), Checklist (all items unchecked), and Additional Notes (empty). Despite these procedural omissions, the core descriptive content is complete and on-topic, providing reviewers with sufficient understanding of what the PR accomplishes.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8aaa674 and cc91859.

📒 Files selected for processing (1)
  • terraform/main.tf (1 hunks)

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 175e319 and 8aaa674.

📒 Files selected for processing (5)
  • terraform/environments/example.tfvars (1 hunks)
  • terraform/main.tf (2 hunks)
  • terraform/modules/compute/main.tf (2 hunks)
  • terraform/modules/compute/variables.tf (1 hunks)
  • terraform/variables.tf (1 hunks)
🔇 Additional comments (7)
terraform/variables.tf (2)

74-103: LGTM! Clear documentation of web service configuration.

The updated descriptions appropriately clarify that these variables apply specifically to the web service component, which helps distinguish them from the new queue worker and scheduler configurations.


105-122: LGTM! Well-defined queue worker configuration.

The queue worker variables are properly defined with sensible defaults (512 CPU, 1024 MB, 1 task) that balance resource usage for background job processing.

terraform/modules/compute/variables.tf (2)

76-108: LGTM! Well-organized web service configuration section.

The addition of section headers and updated descriptions improves module documentation and clearly delineates the web service configuration from the new worker components.


110-130: LGTM! Queue worker variables properly defined.

The queue worker configuration variables are correctly defined with sensible defaults that align with the root module declarations.

terraform/modules/compute/main.tf (1)

118-142: LGTM! Successful modularization of worker service resources.

The worker services configuration now correctly uses dedicated variables for queue-worker and scheduler resources, replacing hardcoded values and enabling granular per-component control as intended by this PR.

terraform/environments/example.tfvars (1)

53-77: LGTM! Clear and well-organized container configuration.

The reorganized structure with dedicated sections for Web Service, Queue Worker, and Scheduler makes the configuration more intuitive. All CPU/memory combinations are valid for Fargate, and the example values are appropriate for a production deployment.

terraform/main.tf (1)

235-251: LGTM! Compute module inputs properly wired.

The module inputs are well-organized with clear section comments, and all the new queue worker and scheduler variables are correctly passed from the root module to the compute submodule.

@leek leek merged commit 30dd325 into main Oct 22, 2025
0 of 2 checks passed
@leek leek deleted the leek/customize-ecs-tasks branch October 22, 2025 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants