osmbe / community_planning

10 stars 0 forks source link

Infrastructure: Move from Droplet/VM to App Platform #41

Closed jbelien closed 2 years ago

jbelien commented 2 years ago

We currently have 1 Digital Ocean Droplet where 3 services (and some redirections) are running:

It's becoming a bit tricky to manage because the update/maintenance service of each service is really different: Welcome Tool is actively maintained and updated but the other too not so much. It means that the version of PHP used for each service can be different (and incompatible).

My suggestion is, instead of having 1 Droplet where we have all our service running, to have 1 App Platform for each service. Each service would then be independent from each other and can have separate update process without any issue. It would also allow me to connect the App Platform directly to GitHub so each time I create a release the app is automatically updated (instead of having to do the update manually like I'm doing now).

The 1 Droplet currently costs 5USD/month. Each App Platform would also cost 5USD/month ; so it would cost use 3 times the price. For the Stripe API I know they have simplified a lot of things since last time I checked so maybe that API is not needed anymore.

Redirections would not be possible with the new setup but I can setup those redirections on the Open Knowledge Belgium Droplet that takes care of the redirections for OKBE domain names (so this is not an issue).

joostschouppe commented 2 years ago

Sounds good to me

jbelien commented 2 years ago

✅ Migration of OSM Welcome Tool complete!

jbelien commented 2 years ago

Not really happy with the performances of Digital Ocean App Platform. I don't know if it's just me but https://welcome.osm.be/ takes a while to load the first page.

I found this article that might explain it.

I'll investigate to see if I can find a better solution.

xivk commented 2 years ago

I know quite a bit about docker and stuff. It should be doable to host this using docker-compose in nicely separate containers and services. Let me know if you are thinking in this direction.

Withing one droplet I mean using docker.

joostschouppe commented 2 years ago

I'll ping heavy user Jakka

nobohan commented 2 years ago

I have the same impression: slower for about a week.

Jakkajakka commented 2 years ago

Yes very slow and with lot of new mapper to welcome take to long, to work smoothly.

jbelien commented 2 years ago

I have the same impression: slower for about a week.

Yes very slow and with lot of new mapper to welcome take to long, to work smoothly.

@nobohan @Jakkajakka Okay, thanks for your feedback. It confirms my feeling! I'll find another solution.


I know quite a bit about docker and stuff. It should be doable to host this using docker-compose in nicely separate containers and services. Let me know if you are thinking in this direction.

@xivk My "goal" is to have a "1-click deployment" : meaning in 1 click, build the container, and publish it online (with custom domain name and SSL).

DigitalOcean App Platform does exactly that but we now know that performances makes it unusable. I know that Heroku could also be an option ; that will be my next lead. Microsoft, Google, and Amazon also provides such services but I've discarded those options (even though I would personally not mind using Microsoft App Service).

My main goal is not to have to maintain a VM/Droplet/Server ; only a Dockerfile in a GitHub repository.

Any feedback/insight is of course more than welcome.

xivk commented 2 years ago

Our approach is not far from that but you do need an NGINX proxy for SSL termination and you need to setup docker and do some stuff to get started.

These things are always a tradeoff so there is no perfect solution apart from paying more. That said I think I maintain more than 50 services basically alone this way and rarely have to touch them.

jbelien commented 2 years ago

I'm also tempted to go for a Kubernetes cluster. It seems a bit overkill but costs look similar to App Platform. Starting playing with it at work and it's pretty neat.

xivk commented 2 years ago

Never tried that.

jbelien commented 2 years ago

@nobohan @Jakkajakka I've reverted to the old setup (using our VM). I've tried to migrate the work done these last few days (since the migration) but couldn't. I do apologize for this.

jbelien commented 2 years ago

Since this unfortunate experience, I've decided to pause this migration... It's working perfectly on our VM ; let's keep something that's working!

Jakkajakka commented 2 years ago

Error when check "werd verwelkomd"

afbeelding