Project

General

Profile

Hacking Keep » History » Revision 7

Revision 6 (Tim Pierce, 08/28/2014 02:08 PM) → Revision 7/9 (Tim Pierce, 08/28/2014 02:08 PM)

h1. Hacking Keep 

 {{toc}} 

 These instructions describe how to build the Arvados Keep storage server and/or proxy on your local machine. 

 h2. Install Go 

 The Arvados Keep server and proxy are written in "Go":http://www.golang.org/.    In order to build it locally, you must have the Go toolchain installed.    Follow the instructions at http://golang.org/doc/install to install Go. 

 The rest of these instructions assume that you have a working Go installation on your system, and that your @GOPATH@ environment variable is set appropriately. 

 If you have just installed Go for the first time, you may set @GOPATH@ to any empty directory.    The Go toolchain will install Go packages and dependencies here.  

 <pre> 
 export GOPATH=~/gocode 
 mkdir -p $GOPATH 
 </pre> 

 h2. Get source code 

 Clone the Arvados git repository, if you have not already: 

 <pre> 
 cd 
 git clone git://git.curoverse.com/arvados.git 
 </pre> 

 *Note:* If you are an authorized committer, clone @git@git.curoverse.com:arvados.git@ instead so you may push directly to git.curoverse.com. 

 

 h2. Tell Go to use your local copy 

 This step ensures that your development environment uses your locally-modified code, instead of fetching the master branch from git.curoverse.com: 

 <pre> 
 mkdir -p $GOPATH/src/git.curoverse.com 
 ln -s ~/arvados $GOPATH/src/git.curoverse.com/arvados.git 
 </pre> 

 Reason: The Keepstore and Keepproxy packages import other Go packages from the Arvados source tree. These packages have names like: 

 <pre> 
 

  git.curoverse.com/arvados.git/sdk/go/keepclient 
 
  git.curoverse.com/arvados.git/sdk/go/arvadosclient 
 </pre> 

 When the Go compiler needs to import one of these packages, it will look in @$GOPATH/src@ for the package source code. If it does not find the code locally, it will fetch the code from git.curoverse.com automatically.    This symlink ensures that Go will find your local source code under @$GOPATH/src/git.curoverse.com/arvados.git/...@ 

 

 h2. Run test suite 

 <pre> 
 cd ~/arvados/services/keepstore 
 go test 
 </pre> 

 The @go test@ command will print a few dozen lines of logging output.    If the tests succeeded, it will print PASS followed by a summary of the packages which passed testing, e.g.: 

 <pre> 
 PASS 
 ok   	 _/home/you/arvados/services/keepstore 	 1.023s 
 </pre>