Portable Revision Control Server (using Subversion)

Hi all,

I’m throwing out a feeler to determine what teams do for software revision control before and at competitions. Two years ago, I set up an Ubuntu linux server (no GUI, ha!) at our pit running a subversion server. It got some mild use the first year and then a bit more use last year. Next year, I plan on schooling the programmers in the way it’s done in the real world.

I was wondering what methods teams use for altering software at the competitions. Are there teams that show up and make no modifications to their code (if so, I bow to thee)? Or do teams have only one programmer modifying at a time? Do you use code revision at the competitions?

I have already determined that there have been a significant number of situations that call for us to have a portable subversion server. The three main concerns were portability (size, weight, ruggedness, lack of support wires), multiple point access (a few different programmers able to connect simultaneously) and number one it had to be done on the CHEAP! After searching through IPX size motherboards, cases, and other small embedded boxes I finally came up with the simplest and most readily available platform…the Linksys router. Specifically, the WRT54G-TM (or similar variant - the TM is like a GS v3.0 with more RAM and Flash than the standard WRT54G).

So, I wonder how many people now think I’m crazy? Well, I can tell you that as of the end of last year’s season, I had successfully compiled and tested a custom image of OpenWRT (linux for WRT) for the Linksys router using only the 8MB of built-in flash for storage. I was able to store both our 2009 and 2010 code repositories with enough room for at least another 6 or more years (it uses the heavily compressed file system called JFFS2). The Linksys satisfies all of my requirements beautifully. It is small, light, fairly rugged and only needs one 12V wall wart for power (could be powered from a battery too). It has a built in switch so multiple people can access it (or it could be done wirelessly) and best of all it could cost as little as $20! I bought some used TM versions from eBay for about $23, but that’s atypical. One can also do an SD card modification (which I have done but not tested) to increase storage to 4GB or more. I’ve also installed and tested samba which allows for mapped file storage.

I have fairly thoroughly documented the whole process and was wondering if there are any other teams that would be interested in this project. I have already determined that we will try this system out in the upcoming year and I will try to provide feedback on any issues we observe. So far, it appears to run smoothly and about as fast as the linux PC we used previously (even though it’s only a 200MHz processor). Any feedback would be great. Thanks.

  • Bryce

P.S. I do also realize that it is possible to keep a local repository on a USB flash drive as well. This project is meant to be a safer and easier alternative.

Interesting solution.

Do you just turn off the wireless to make it Pit legal or do you get permission from the FTA to run an access point?

That’s a very creative solution.

Our team uses a subversion repository hosted on one of our mentor’s servers. As far as what we do during competition, it’s complicated.

Usually the rule of thumb is to have a “barebones” copy - where only the essential drive code and simplest auton possible exist. This code is to be used only in dire situations when our robot is having chaotic network connectivity issues and we want to check off “code” from our troubleshooting checklist.

We always try not to change any code during a competition, but if we ever do it’s done by only one programmer and okay’ed/reviewed by the programming mentor.

Love the idea of using a linksys router though, really really smart.

We started using a surplus laptop running linux as a CVS server 5 years ago. When that died, we replaced it with the cheapest netbook we could find. We hook that up via network to the programming computers.

Typically we only have 1 person making changes at competition (at most 2), but revision control is still very important (especially when you’re asked to go back to the autonomous from 3 matches ago).

The next time our computer dies, I was planning to look into a plug computer like SheevaPlug

Unrelated to this discussion, we have a SheevaPlug at home and it’s been very nice so far. Definitely has a bit of oomph.

Our team has been using Bazaar instead of CVS or Subversion, and that’s been working out great. The highlights are:

  • No central server required (but you can have one)
  • Every working copy (called a branch) stores full version history for offline viewing. This also ends up speeding up operations like viewing history, committing, and reverting.
  • Simple interface
  • Excellent merge handling
  • Each programmer gets their own branch and can commit without having an internet connection. When another programmer needs the changes the other made, the two programmers just merge their branches.
  • Better handling of renames than Subversion or CVS
  • Changes can be emailed
  • Works with Subversion repositories natively

Hope that helps!

Our team used SVN for source control last year during the build season. We were using Google code for the central repository. But every once in a while we didn’t have internet access at the school. This was the biggest problem with Source control we had.

When we went to GSR, we ended up switching to Mercurial. With Mercurial everyone has a copy of the repository so you don’t need an internet connection. When we wanted to share changes we had a copy of the repository on a flash drive, and would just share the flash drive and update our repository with the one on the flashdrive. Mercurial also makes merging changes much easier than SVN.

Mercurial’s another good program and shares many of the same features as Bazaar. It’s all a matter of taste, really.

Stay away from Git, though. It’s way too easy to break a repository in Git and not understand what’s going on. I don’t understand what it’s doing half the time.

Definitely don’t want to get into a Git vs. svn debate, but don’t be afraid to try Git out. I’m in the same boat as you though, it can be quite complicated. However, I find that the support community for Git is terrific and once you learn the basics of what it’s doing you are able to do some pretty sweet stuff.

We take our SVN server with us to competitions. It goes under the table with a 24 port switch setting on top of it. Great for code changes or reverts to previous tags or other points. We also use it to store our log files from each match. A student is responsible to get the log files from the driver station and commit them to the SVN repository for viewing on any of the computers we have with us, and of course back home. I set up the machine with a DHCP server so when a user in the pits connects they get an IP address that is compatible with the “real” IP address of the server. That way everyone’s access to the server is just like they see when they are at home or at the school. It is all hardwired. Two years ago in Atlanta I did a session about how to build a SVN server. After the session I had a team come up and tell me a horror story about how they lost their code in a crashed hard drive during competitions. If you are reading this and do not have version control I would highly recommend you figure it out and get some. It is wonderful!! One of those things after you have it for a while you wonder how you ever got along without it before.

Our team uses Google Code project hosting as our svn repository. This can be a problem during competition when one doesn’t have access to the internet though. A simple solution is to just work off one communal laptop to do all the programming. We haven’t run into a situation where that computer has broken down on us in the middle of comp; however, we do have backup laptops that contain code from the previous day/night commit to the repository.

Surprised nobody has said anything like using an external hard drive to store the repository. Now that I think about it, you could also do all your work off an external hard drive or a usb drive (sorta mentioned above).

Yeah, 166 (who mentioned it above <_<) used my external hard drive during GSR, but at Atlanta, we usually either shared a laptop or just plugged the laptops together in an ad-hoc ethernet tangle. The tangle seemed better in my opinion, because it was easy to pull from each other while still being connected to both the robot and the dashboard, where we had FTP’d the log files at the end of the match. This way, we could stay constantly connected, download the logs, fix any problems (I started typing “people”. Freudian slip?), and upload any required fixes.

I agree with not getting into a debate on SCM systems. I would throw in another recommendation for Git, I use it on a daily basis and it is actually very intuitive. If you want a good primer on Git the book Pro Git is free at http://progit.org/book/.

Switch to Git. Your dreams will come true, and nightmares of merging will disappear.

Git seems appropriate for an FRC type of revision system at competition. My personal preference would be to still have a central server back at the school (or wherever) and use a tethered smart phone to access it. In a couple of years, I suspect a cheap 3G wireless plan for the laptop/netbook will be available too.

Be careful in your presumptions here; there is no silver bullet for merging. Take company with 30+ programmers all touching a 500k+ SLOC code base (common for any sort of bleeding-edge company that reuses software to create new products) and the nightmares will commence, regardless of what repository system is used. Over time, features are added/removed and code methods are refactored, renamed, or removed. This is especially apparent when a branch splits and a bug fix or feature is done in one branch, only to be discovered later that the other branch implemented the fix/feature in a different way and a merge isn’t possible with a large time investment. Again, this is for larger software systems.

The thing to keep in mind with GIT, is there’s no way to use it directly on windows. you need a Linux emulator, that I can’t think the name of right now. Unless that’s changed recently…

Cygwin is the name you are fishing for.

From a quick search, it looks like that isn’t true any more, and there is a version of git that is integrated into Windows Explorer in the same way that SVN can be with tortoise SVN. http://code.google.com/p/tortoisegit/

Cygwin is no longer required to run Git on Windows, there is msysGit which simplifies install a command line version of Git on Windows. In addition there are GUI Git tools such as TortoiseGit which was mentioned and Git Extensions.

Cool, last time I had looked at Git I didn’t see anything about a windows version, only using it with cygwin, (thanks AustinSchuh). From what I’ve heard, GIT is a good source control system also.

Firstly, thank you all for replying! I’ve been wondering what solutions teams were using for a while now. I also wonder how many teams are still without some sort of code control. It really does simplify life in the end!

Good question. The default configuration is to run with wireless off. At our home pit, we have set up a wireless network with both N and G using the kit N router (on 5GHz) and a Dlink G router. So, I would rarely need to use wireless but could be used if necessary (say on a LOOONNNGG bus ride to St. Louis).

Last year at the competition I transfered the repository to a USB stick and we just had only one laptop modifying code at a time. It was definitely nice to have competition revision control. I definitely agree with GGCO that trying to not modify code at competition would be ideal - I have yet to see that on our team however…

I did think about converting an old laptop, but for multi-point access one would have to bring a switch or connect through an ad-hoc network (not legal in the pit as mentioned above).

The SheevaPlug looks awesome! I may just have to get one to play around with some day. It definitely packs more power than the Broadcom chipset in the router, but if we only use if for file transfer and code check-in and out it seems to be more than adequate. Still, very cool.

We were originally just looking for something that worked a little more intuitively than CVS and subversion improved many of the issues that I had with the CVS RCS. Subversion was readily available (and more importantly I knew someone with serious subversion skills) so that’s what we chose. I will have to look into Bazaar, looks very interesting.

On a side note, unfortunately we are back in the 20th century at our pit with no internet access whatsoever. We are looking into a 3G connection but we won’t have continuous access for a long time probably. So the Google code stuff would be an issue for us - I will have to look into the possibility of using Google code as a backup however to give us online access if we ever needed it.

Wow that stinks! First rule of thumb is at least have a backup I guess. The other great thing about SVN is that it has an administrator command to allow two servers to sync. Unfortunately, the embedded version does not have this command, so if I run the router as the main server I can have the tower (that we use currently) sync to it periodically so we have a mirror site as well!

With a subversion router, you could connect the dashboard, robot and up to three other computers at the same time :slight_smile:

  • Bryce

P.S. Sorry to reply back so late. I’ve been busy at work…