Skip to content

run migrations in compose.dev.yml#121

Merged
emi420 merged 2 commits intohotosm:developfrom
categulario:fix/migrate-in-docker
Mar 23, 2026
Merged

run migrations in compose.dev.yml#121
emi420 merged 2 commits intohotosm:developfrom
categulario:fix/migrate-in-docker

Conversation

@categulario
Copy link
Copy Markdown
Collaborator

No description provided.

@categulario categulario requested a review from emi420 March 13, 2026 00:59
@spwoodcock
Copy link
Copy Markdown
Member

I would propose running migrations as a separate service, e.g. https://github.com/hotosm/drone-tm/blob/91b6c2b4e2b406ba4ca2acd605d0d40dd4b85d4f/compose.yaml#L136

I don't know if we are having multiple chatmap api replicas, but it's always good practice anyway: https://12factor.net/admin-processes

@emi420
Copy link
Copy Markdown
Contributor

emi420 commented Mar 13, 2026

Thanks @spwoodcock! this PR is a small improvement for what we have and I agree with the idea of not to optimize prematurely, so I'm ok with this change as it is.

@spwoodcock
Copy link
Copy Markdown
Member

spwoodcock commented Mar 13, 2026

Its hardly an over-optimisation - a couple of lines of config for correctness - but sure!

I'll make a follow up issue to address in future, as this type of setup can cause db corruption

@emi420
Copy link
Copy Markdown
Contributor

emi420 commented Mar 13, 2026

We don't need this right now as we're using a single instance for the API, it is just a small improvement for what we have and there are other important things to improve, test and fix, so we're putting our efforts there.

We'll come back to improve this in the future when needed, your suggestion is really appreciated and it will be taken into account 👍

@spwoodcock
Copy link
Copy Markdown
Member

ok I hear you - again not trying to add extra work - but I gave you the solution to copy in a link 😅

I'm only mentioning this because I'm managing most of the Kubernetes migrations, and the goal is to have every app there.
ChatMap could be moved soon very easily.

If I created replicas and forgot about this entrypoint, it could cause issues (and considering dk have our work cut out for us, it's easy to overlook this).

Dropping it though! Just letting you know my rationale for being annoying 👍

@emi420
Copy link
Copy Markdown
Contributor

emi420 commented Mar 13, 2026

I understand your logic behind this. We have to still confirm if we are going to move ChatMap to k8s any time soon. I would like to first have a more solid team behind the k8s infrastructure, including myself, so devops is not a bottleneck.

@emi420
Copy link
Copy Markdown
Contributor

emi420 commented Mar 13, 2026

@categulario we had a talk with @spwoodcock, I understand better the need now, please follow his advice in this case and implement migrations as a Docker service if you have the time, thanks!

@spwoodcock
Copy link
Copy Markdown
Member

Sorry for the hassle! It would be really appreciated 🙏 (and prevent data issues if and when this migrated to k8s)

@categulario
Copy link
Copy Markdown
Collaborator Author

Ok, I moved the migrate command to its own container

@categulario categulario changed the title use entrypoint in container for production and develop run migrations in compose.dev.yml Mar 21, 2026
Copy link
Copy Markdown
Member

@spwoodcock spwoodcock left a comment

Choose a reason for hiding this comment

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

Thanks! 🙏

@emi420 emi420 merged commit 781c12e into hotosm:develop Mar 23, 2026
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