NERSC logo National Energy Research Scientific Computing Center
  A DOE Office of Science User Facility
  at Lawrence Berkeley National Laboratory
 

NERSC SVN/CVS server

NERSC hosts Subversion (SVN) and CVS repositories for NERSC projects. Access is by SSH only; pserver access is not supported. The NERSC server can be accessed as either svn.nersc.gov or cvs.nersc.gov. If you are starting a new project with version control we recommend using SVN over CVS.

Documentation

How to get access to a SVN or CVS repositories

Contact your NERSC project PI and have him/her request access by filling out this form.

OS and Software Requirements

It is assumed that you will access the repository through a UNIX command line interface and use a command-line version of SSH (SSH protocol 2 is assumed here and required for access). You must have the svn or cvs command installed on your UNIX machine. (On NERSC supercomputers, the cvs command in located in the cvs module.) No other access is described here; you may be able to get GUI clients to work however. Web-based interfaces are under consideration; please let me (ragerber@nersc.gov) know if you would like such an interface.

Getting Started

Before you get started, you will need the following information
  1. your user name on NERSC's SVN/CVS machine
  2. the path name to the root of your project's repository on the NERSC CVS/SVN machine
  3. the name of the SVN/CVS modules/directories you wish to access (unless you are creating new directories/modules)

Suggested Client Configuration

We will describe how to use NERSC's Power 5 system, Bassi, as an example client. Once you have an account on the server and know your repository name, perform these steps to configure your UNIX enviroment. (If you know what you are doing, you can configure your environment differently, but (I think) the following method provides for the most transparent access.)

If you do not want to configure your client as described below, you will have to provide your password on SSH passphrase with each cvs command you issue.

These characters are those you type at the keyboard.
These characters are to be typed and replaced by ones applicable to your account or cvs repository.

0. Create a .ssh directory in your home directory if it doesn't already exist.

1. Create a private key exclusively for SVN/CVS (You only have to do this step once.)
On your UNIX machine, run ssh-keygen as in this example on Bassi:
% ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/usr/common/homes/u/username/.ssh/id_rsa)
/usr/common/homes/u/username/.ssh/identity_svn
Enter passphrase (empty for no passphrase): choose a passphrase 
Enter same passphrase again: same passphrase as above
Your identification has been saved in /usr/common/homes/u/username/.ssh/identity_svn.
Your public key has been saved in /usr/common/homes/u/username/.ssh/identity_svn.pub.
Where you replace /usr/common/homes/u/username/ with the path to your home directory. This creates a public/private key pair. In order to access SVN/CVS without typing your passphrase with each command, run your shell under ssh-agent and use ssh-add to store your passphrase in memory.

2. Transfer your public key (You only have to do this step once.)
Obtain your password as directed in the email you received when your account was activated. Then use scp to copy the contents of the file identity_cvs.pub to your .ssh directory on svn.nersc.gov

% scp ~/.ssh/identity_svn.pub svn.nersc.gov:.ssh/authorized_keys2 
	

3. Create an SSH alias (optional)
On your UNIX machine (e.g. Bassi):
  1. create a .ssh directory in your home directory if it doesn't already exist.
  2. cd ~/.ssh
  3. edit a file named config
  4. Add these lines to the config file
    Host 		svnserver
    HostName 	svn.nersc.gov
    User 		your_login_name
    IdentityFile 	~/.ssh/identity_svn
    Protocol	2
    
4. Set environment variables (CVS only) (You only have to do this step once on each UNIX client.)
csh, tcsh users: Edit ~/.cshrc, ~/.cshrc.ext, ~/.tcshrc or other applicable shell initialization file to include these lines:
setenv CVSROOT cvsserver:/cvs/your_cvsrepository_root
setenv CVS_RSH ssh
sh, ksh, bash users: Edit ~/.profile, ~/.bash_profile or other applicable shell initialization file to include these lines:
export CVSROOT=cvsserver:/cvs/your_cvsrepository_root
export CVS_RSH=ssh	
You may have to replace ssh with the full path specification to your ssh binary.

Source these files or log out and log back into the UNIX machine you are using.

Your account on the server

You have an account on the NERSC server, but it is restricted to running a very few commands.

Logins and passwords on the SVN/CVS server are subject to the NERSC Account Ownership Policy.

To use SVN checkout a repository with the following command.

svn checkout svn+ssh://svn.nersc.gov/svn/your_repository_name

After that you will be able to run svn commands from your working copy without specifying the entire path.

For CVS If you use the procedures outlined above, you do not need to use a password. However, if you wish to connect to the server from a machine that is not configured as described, you may use a password to access CVS. If you have not performed the configuration described above, you can access the server using the following syntax:

cvs -d user@cvs.nersc.gov:/cvs/your_repository_root cvs_commands
Note that you will have to use this syntax and give your password each time you issue a CVS command.


LBNL Home
Page last modified: Thu, 11 Oct 2007 17:08:11 GMT
Page URL: http://www.nersc.gov/nusers/systems/servers/cvs.php
Web contact: webmaster@nersc.gov
Computing questions: consult@nersc.gov

Privacy and Security Notice
DOE Office of Science