Skip to content

Replace Core's run-docker.sh #239

Description

@khvn26

Container startup for the Core API is orchestrated by api/scripts/run-docker.sh, a shell script that sequences several manage.py invocations. The flagsmith-common CLI is the intended replacement.

Completing the migration consolidates startup into a single Python entrypoint, lets us orchestrate startup steps in-process, and resolves the task processor cold-start problem behind Flagsmith/flagsmith#7887.

Where we are

flagsmith already does most of the groundwork:

  • Unknown verbs dispatch to Django, so flagsmith migrate, flagsmith createcachetable, flagsmith waitfordb, flagsmith bootstrap already work.
  • flagsmith start {api,task-processor} is the gunicorn wrapper.

The gap is the composite/sequencing verbs and a few environment defaults.

Acceptance criteria

  • Every container role — API, SDK, task processor, and the deploy migration step — starts through the flagsmith entrypoint, with no dependency on run-docker.sh.
  • Migrations are applied once per deploy, never on each subroutine start.
  • Task processor cold start drops enough that the temporary startPeriod raised in fix(infra): Task processor tasks killed during startup by health check flagsmith#7887 can be reverted and tasks stop being recycled by the health check.
  • No startup behaviour regresses: same startup environment, same databases migrated in the same order, and the same guarantee that a role never starts before its migrations are applied.
  • The running server receives termination signals directly and shuts down cleanly; any failed startup step fails the container.
  • The change is backwards compatible so deployments and downstream consumers can migrate gradually. flagsmith can be used in place of run-docker.sh, and run-docker.sh can stay as a thin shim (exec flagsmith "$@").

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions