run migrations in compose.dev.yml#121
Conversation
|
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 |
|
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. |
|
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 |
|
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 👍 |
|
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. 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 👍 |
|
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. |
|
@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! |
|
Sorry for the hassle! It would be really appreciated 🙏 (and prevent data issues if and when this migrated to k8s) |
|
Ok, I moved the migrate command to its own container |
No description provided.