Skip to content

Document how alembic is run in production via the containers #45

Description

@devraj

Extending #44 we should define how alembic is configured in the production container and how you are expected to run the migration in production environments.

We should also think about providing Task based scripts, Tasks is available as a Github action which would work well with the proposed CI/CD workflow.

Activity

  1. self-assigned this
    on Sep 14, 2022
  2. added a commit that references this issue on Sep 12, 2023
  3. devraj commented on Oct 6, 2023

    @devraj
    MemberAuthor

    I was making some headway on this on a client's project that uses this template. My initial approach was to make a Taskfile that would be suitable for production and make available a subset of operations like:

    • Run alembic migration
    • Attach the database to head of the migrations, this can be useful if we are initialising a blank database but subsequently want to run migrations
    • Leave a task that allows the developer to run arbitrary alembic operations

    Debian does not have an official go-task package but Apline linux does. These are the two Linux flavours published by the official Python base image.

    Shifting to Apline would mean a massive move away from our general toolkit.

    People have workarounds using tools like pacstall (in this instance on Ubuntu). Before we can provide this as part of the template we would have to figure out how we install task on Debian.

    Failing everything task provides a binary

    sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d
    

    We already have curl available on the pods to assist with other actions. I have tested this on our current images.

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

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions