language-learners / phpbb

Source code for the language learners forum (phpBB with language-related extensions).
3 stars 4 forks source link

Get the Super Challenge bot back online #21

Open emk opened 7 years ago

emk commented 7 years ago

There's a number of things we need to do here:

rdearman commented 7 years ago

I have imported the data into a new DB on the DB server. "superchallenge"

rdearman commented 7 years ago

The SC bot uses a crontab to periodically check for tweets. Is it possible to run a cron job in a docker? It can work outside of a container, because it is a simple PHP script which gathers the tweets and inserts into the DB.

emk commented 7 years ago

Yeah, there are several different ways to do that, of varying degrees of complexity and annoyance. One option is to create a second container, and to set it to just run a cron daemon. Here's an example.

It's certainly possible to run a SysV init daemon inside a container and boot a whole machine's worth of processes. But it's generally better to have one process per container.

rdearman commented 7 years ago

I've partially completed the docker setup, (branch link below) still need to work out how to run the DB setup script and then update some fields with from the config-files. But it seems to be going OK. Still unsure of the cron thing, but that can wait for the moment.

https://github.com/rdearman/superchallengebot/tree/docker

rdearman commented 7 years ago

OK, got copy in the docker branch works with an ASW DB I setup and copied over. I haven't yet merged into the master branch because I plan to make it work stand alone. Basically all that needs to happen is put the correct settings into the ./dockerconfig/config-include.php file for the DB and it will spark up and run.

I still don't know how to get the crontab working.

emk commented 7 years ago

Whoo-hoo! I've been hugely busy with real work this week, but I'm hoping once again to free up my weekend a bit and help get the bot back online.

rdearman commented 7 years ago

Been tearing my hair out over this crontab thing. It needs access to the httml files inside the SCBot container, because it need the same DB and configuration information. But I have no idea how to make them talk to each other. :(

emk commented 7 years ago

Short form: Use the same image for both, and point them both at the same external volume with -v.

rdearman commented 7 years ago

OK, in order to migrate this thing over, I'm going to try to repoint the existing tweet processor so that it deposits into the aws DB (assuming permissions allow). This would be the start of the migration since at that point all we have to do after configuring the new setup is remove the crontab from the other host.

rdearman commented 7 years ago

OK, I now no more about mysql utf8 collation than any human should need to know. But the twitter collection is running on my server, but is now feeding the aws DB. It should be possible to fire up the site by checking out the docker fork of the SCBot on github and editing the dockerconfig/config-include.php with the correct values. We'd need to coordinate the cutover of the tweet collector crontab, but at the moment it can be left.

emk commented 7 years ago

@rdearman Is all the historical data in the DB, too? I don't want to lose anything that we can avoid losing.

emk commented 7 years ago

It should be possible to fire up the site by checking out the docker fork of the SCBot on github and editing the dockerconfig/config-include.php with the correct values.

I don't see a Dockerfile or dockerconfig directory anywhere on https://github.com/language-learners/superchallengebot/tree/docker. Do you need to push some code?

emk commented 7 years ago

@rdearman Good morning! I'd really love to get the Super Challenge bot back online, but I still can't find your Dockerfile anywhere. If you have a moment, could you please take a look? Thank you! I'd love to get the bot back online.

rdearman commented 7 years ago

Looks like I need to add the directories and files and sync. Will do it soon as i can. Not near a computer for couple of hours.

emk commented 7 years ago

Cool. No problem. I probably won't have much time today anyway.

rdearman commented 7 years ago

OK, I've put everything back in, and merged into the master.