Social Help for Sugar: Week 7

A little over seven weeks of the GSoC coding period is gone. Fortunately, I’m mostly done with the work excepting a few things to polish up and then we can work to actually deploy the social help activity . This is a good thing since the autumn semester at my college starts in just four days and I might not be able to dedicate too much time to the project.

Anyway, this week was hectic – I had to get a ton of things in order for the new college year. Nevertheless, I did manage to get some work done.

First, I went through a mini heart attack when the inbuilt database backup thingy didn’t work on my local machine. It was weird, really. Everything had worked before when it just suddenly stopped accepting backups. After several less than successful attempts to get the backups to work, I just gave up on my local machine and decided to try creating a shiny new docker instance and try the backup on it instead. And much to my relief, it did finally work.

Then, I wrote to Paul, explaining everything we’ve accomplished till now. I also asked whether it was high time for a code review. While I waited for the reply, I decided to see if I can update discourse to the latest version. Normally, the admin would use the inbuilt option in discourse to do this but of course, we couldn’t do such a thing since we’re using a custom version of discourse. So, I manually did a fetch-and-merge on my github repository of discourse, created yet another docker instance and installed the latest version on it. It, too, worked flawlessly. Come to think of it, I’m liking docker more and more.

Anyway, Paul replied to me soon after. He wanted us to have a separate button to launch social-help for every activity along with the shortcut thingy. So, I talked on the IRC, got some clues and added the button. It works, now.

That’s all for this week.

Advertisements

Social Help for Sugar: Week 6

Another week has gone by and my project is mostly working. Last week, I had worked on deployment and after a lot of grief, I was able to able to get a Docker instance running. This week, I had planned on working on database migration scripts – which I did, eventually.

The first thing I did this week was to talk to Paul, asking him about the server space requirements that we’ll have at the time of launch. Paul connected me to Matthew who’s a sysadmin and we’ve discussed some of the details since then. Matthew told me that they’ll have a meeting soon to discuss getting a new VPN for the official deployment.

Then, I decided to clean up a few things. Until now, I had hard-coded the address of the forum. However, that would never work in practice, specially because we’re aiming to get a social-help instance running in every non-internet area. So, I decided to add an option to the control-panel, much like the option for the jabber server. It took me a bit of time but finally, I got round to doing that after a few failures. Now, users can fill in a custom URL for the social-help discussion forum.

The next thing, and a very important thing, was the db migration scripts. The idea is that we’ll have a central repository of information – the central discussion forum running on a subdomain of sugarlabs.org. This central forum will have most of the information. However, as I’ve stated before, we’re making things in such a way that the discussion forum can work even in areas with no connectivity, we’d like to be able to deploy discourse in these areas too. Deployment is pretty easy with docker, as I’ve written in my previous posts. However, these localized discourse instances will be devoid of any information. So, I’m thinking that it will be good to have a way to initialize these new discourse instances with all the information contained in the central repository. That’s why wee needed a db migration script.

Now comes the problem. Taking dump of the running postgres database is easy. The problem is the restoration. To restore the dump, we’ll need to stop the server for a bit. However, to stop the server, we’ll first need to log in to the running docker instance. But, for the docker instance to exist, we’ll need it running! And that’s the dilemma. We can’t have a running server to get a backup but if the we stop the server, the docker instance cannot be logged into. So, I was in a fix.

I tried a couple of things, all to no avail. I was despairing, really. Then, I though maybe the discourse devs had already thought of this problem – what with a new version of discourse coming out every week. And voila! They had thought of it after a few searches on meta.discourse.org, I hit jackpot. There’s a guide that shows exactly how to do this thing. So, I was saved again by the foresight of the discourse developers. Thanks guys!

This next week, I guess that I’ll get a final review from Paul and start working on a code review. Then, with some hope, Matthew will have the server space for me and we’ll probably be able to officially launch this thing.