Skip to content

Schedule deadline reminder command with EventBridge ECS task #188

Description

@alexeygrigorev

Context

Issue #180 covers deadline reminder email behavior. We need a deployed scheduling mechanism that runs CMP reminder logic without tying it to web requests.

We do not need Lambda for this. EventBridge should start a one-off ECS task using the CMP image.

Current environment note: CMP deploys to dev via CI/CD, and Datamailer currently has only a sandbox deployment. There is no Datamailer production environment for this work.

Desired runtime

EventBridge schedule -> ECS RunTask with CMP image -> uv run python manage.py send_deadline_reminders -> Datamailer enqueue/list-send API -> exit

The scheduled command should be quick. It should compute eligible reminder windows, create/trigger Datamailer work, and exit. Datamailer handles slow per-recipient sending asynchronously.

Desired behavior

  • Add send_deadline_reminders management command if not already implemented by Add deadline reminder emails for homework, projects, and peer reviews #180.
  • Add an --enqueue-only or equivalent mode if needed so the command never waits for delivery.
  • Configure infra/deployment docs for EventBridge scheduled ECS task.
  • Ensure the command is safe to run repeatedly.
  • Use stable idempotency/send keys for reminder windows.

Acceptance criteria

  • Local command can be run manually with uv run python manage.py send_deadline_reminders.
  • Dev schedule is documented/configured as EventBridge -> ECS task, with no Lambda requirement.
  • The command exits quickly after triggering Datamailer work.
  • Duplicate scheduled runs do not send duplicate reminders.
  • Failures are logged and observable.

Related: #180

Current blocker

Repo-side implementation and documentation are in place. The remaining step is external AWS IAM/scheduler state: grant the CI deploy user the documented permissions, or provide an existing Scheduler role ARN, then rerun the Configure Deadline Reminders workflow and verify the EventBridge schedule exists.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    infraRequires AWS/CI/deploy/prod-environment work; not solvable in the app code alone

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions