Skip to content. | Skip to navigation

Personal tools

Navigation

You are here: Home / Wiki / Kb279

Kb279

Emulab FAQ: Experiment Templates: CVS Interface to the Workbench

Emulab FAQ: Experiment Templates: CVS Interface to the Workbench

The workbench allows you to interact with your templates via CVS. To check out a copy of your template, issue the following CVS command on your desktop:

`     cvs -d ops.emulab.net:/proj/$pid/templates/XXXXX/cvsrepo co setup records
 `

Once the checkout completes, you will see two subdirectories, once called setup and another called records.

The setup directory contains the datastore for your template, and another directory for your NS file. Each time you create a new version of your template, either from the web interface or the command line, appropriate tags are added to the repository so that you can easily find older versions of your template.

Once you have a checkout, you can change the NS file or the contents of the datastore using CVS commit. This does not create a new version of your template''' To actually create a new template based on the changes you have committed, you need to use the CVS tag command while in the setup directory of your checkout:

`     cvs tag mytag
 `

and then wait for the email from emulab that says the template has been modified. (the tag command returns immediately). Note that you can reuse a previous tag by using the -F option.

The above example assumes you want to work along the trunk of the CVS repository, which is the usual case for most developers. However, you can also work along a branch by creating a branch tag:

`     cvs tag -r existing_tag -b newtag1
     cvs update -r newtag1
 `

The first command creates a new branch off of an existing tag in the CVS (template) history. The second command updates your sandbox so that you are currently working along your new branch. At this point you can make changes and commit them as described above. When you are ready to actually create a new Template, simply tag the tree:

`     cvs tag newtag2
 `

and then wait for the email from emulab that says the template has been modified.

While it would be nice to instantiate a template via a CVS command, this is future work. In the meantime, you should continue to use the web interface or the command line tools on users. At the termination of your instance, the instance record is added to the records subdirectory mentioned at the beginning of this FAQ entry. Since Emulab adds the record to the repository directly, you will need to cd into the records directory and do a CVS update. Be careful of this though, since you will get a checkout of every record (each run for all your instances in all of your template versions). To check out a single record at a time, you need to use the instance index and the run number. For example:

`     cd records
     cvs update 12345,1
 `

where the first number is the instance index and is available via the web interface, using the "View Records" menu item.