PokeAPI / ditto

Tool for meta operations over PokéAPI data
Apache License 2.0
49 stars 11 forks source link

Where to host the ditto updater bot #26

Closed tdmalone closed 4 years ago

tdmalone commented 6 years ago

From PokeAPI/pokeapi#353:

@sargunv:

IIRC there's also a DigitalOcean account being used to host the API right now ... I do plan on finding somewhere to host the ditto updater bot, so that's probably something worth transferring if you don't want to depend on something only I control. It should run fine on their smallest container (I plan on testing that today).

tdmalone commented 6 years ago

I have a couple of questions @sargunv:

sargunv commented 6 years ago

It can run anywhere that can run a Docker container in privileged mode. Ideally the platform would be able to schedule the run somehow, or otherwise run based on certain conditions such as a webhook.

tdmalone commented 6 years ago

The reason I ask about CI is because the webhook is basically just a push to GitHub, right? Which would mean it's a perfect candidate for a CI job.

But a privileged container... hmm. Travis won't run privileged Docker containers; I'm not sure if Circle does.

sargunv commented 6 years ago

It needs to be privileged because it launches PokeAPI and its dependencies in an inner container. It should be possible to set up the whole system without inner containers, but I'd prefer not to work on doing that. It would involve setting up an environment with two different Python projects: one python2, one python3, and postgres. I'm fine just running it on my own server or on a $5/month DigitalOcean droplet. If DigitalOcean will still sponsor us, that's even better.

It also needs write access to the repo, which I currently accomplish by mounting a suitable .ssh folder as a volume at /root/.ssh in the container at runtime. GitHub access tokens may work too.

neverendingqs commented 6 years ago

CircleCI can run privileged containers if the CI job runs on a VM instead of a container: https://circleci.com/docs/2.0/executor-types/#overview.

neverendingqs commented 6 years ago

If it's possible, my vote is for a CI system as well, because:

1) Other contributors can make changes to it 2) Increases the bus factor if say you go on vacation

sargunv commented 6 years ago

@Naramsim As for bus factor, I've included a readme in the updater folder showing exactly how to run it. It's really nothing more than ensuring the bot have the right access to the repo and then running a privileged container.

I'll check out CircleCI. Looks like they offer 1500 build minutes for free, which is enough for a daily build if it's not drastically slower than on my machine. Clone does take a while since it's pulling every single object once.

sargunv commented 6 years ago

Said readme

Naramsim commented 4 years ago

The bot now runs on CircleCI.

Although we should move it from here to a separate repo or to pokeapi, imho.