Code

From Seamonster
(Redirected from Seamonster Code)
Jump to: navigation, search


Introduction

SEAMONSTER source code is controlled using a system called "Subversion". Subversion (SVN) is a version control system that allows users to to keep track of changes made to any type of electronic data, in our case source code. SVN facilitates working on source code as a team.


There are two ways of looking at repository content. First, if you just want to see what is there using a web browser (without affecting the content of the repository) then you can go to the SVN website particular to SEAMONSTER and do just that. Second, if you want to check code out, modify it, check it back in, add stuff, delete stuff, and so on, then you are obliged to log in to the host machine and play by the "svn" rules.


Just as with many tech innovations (wikis, datacubes, matlab, ...) source code control sounds kind of dull. In fact it may even sound more like an inconvenience than a cool thing to use. Permit me to assert this is not so. In fact source code control is not only cool, it is also really useful and a lot of fun once you get used to it. So here we go...


Browsing source code

Web interface

There is an informative web interface to Subversion. After clicking on the 'seamonster' field a web page shows all the current source code directories as well as information on the latest changes.

   SVN2.png

This web interface allows you to look at all the revisions and to see the logs for each directory. It is also possible to compare two versions of source code and to display who is to blame for the changes.
Here is an rss feed for subversion updates.


Working within the svn system

To access (check out / modify / check in) code, log in directly to the host machine using a terminal of some type. The current machine name is http colon slash slash seamonster dot jun dot alaska dot edu.


(Subversion can be updated via download and install.)


All svn transactions are carried out using this command format: svn keyword [arguments if needed]. To start, within your personal directory tree you create a subdirectory containing files you would like included in SVN. Once this subdirectory is looking good you will Import it to the SVN repository. From that point your local copy of the subdirectory is immaterial as far as svn is concerned. You can only modify svn's idea of the source code through svn transactions. This means you must check out / modify / check in changes per the commands given below.


Note: It is important to be aware of how your current working directory is used in Subversion commands to implicitly identify files and directories.


SVN makes use of a small set of commands to manage the source code. Here are the most important ones:

  • Import new project (import ): To import a new project contained in the directory 'agents' into SVN
    • This implies a directory called agents exists, containing some files you wish to have in SVN.
    • cd to the parent directory of this subdirectory
    • Identify the appropriate destination directory within the svn tree, in this example called 'seamonster'.
    • svn import new_project http://seamonster.jun.alaska.edu/svn/seamonster/agents -m "Initial Import"
    • Your local subdirectory implicitly has the same name agents.
  • Check out (co ): To work on the contents of a directory it must be first checked out (like a library book).
    • Open a terminal on your computer and log in to the SVN machine.
    • Identify the target directory location/name in the SVN repository, for example:
      • svn is the subversion root
      • seamonster is the program's subdirectory
      • agents might be a sub-subdirectory that you wish to work on.
    • cd to some working location, say in a user account directory: /home/fred/working.
    • Check out agents using svn co http://seamonster.jun.alaska.edu/svn/seamonster/agents
    • This will create a local copy: /home/fred/working/agents
    • Go to work on the files in this directory
  • Add file (add ): To add a file, for example 'test.pl', to the working directory:
    • svn add test.pl
  • Delete file (del ): To delete a file, for example 'test.pl', from the subversion directory:
    • svn del test.pl
  • Update (up ): To update all the files in a directory to the newest SVN version
    • svn up
  • Commit (ci ): aka Check-in: Save changed version of a directory
    • cd to your copy of the subdirectory you have checked out and perhaps modified (/home/fred/working/agents in the above example).
    • issue svn ci.
    • This opens a commit file in the editor. Any changed files will be noted here.
    • Enter a description of the changes made.
    • Save and close the commit file.
    • All changed files will be committed to SVN.
    • You may verify this by visiting the svn website and looking at the file contents.


For more commands and a full documentation of SVN visit the Subversion web site or read the manual by entering svn help at the terminal command prompt.

Catalog

Rob notes (5/2008) this catalog is a tad out of date.


mon2kml

Will output mon operational status to kml. This will create the seamonster status kml. Might be replaced by smstatus.

seamonster

Abandoned test code.

smbrick

Import and display of brick data. Test version. This code will soon be replaced by code for the new database structure, where brick, mote and campbell data is treated the same.

smdisplay

Scripts for accessing and displaying data from the seamonster postgres database.

sminsert

Scripts for importing data into the database from a variety of formats

smkml

Code for generating seamonster kml streams

smstatus

A script for checking if databases have been updated recently. This will be expanded.