Building a subversion server
Download
1 / 71

Building A Subversion Server - PowerPoint PPT Presentation


  • 182 Views
  • Updated On :

Building A Subversion Server. Version Control for Your Robot Software By Hugh Meyer FRC Team 1741 Red Alert Robotics Greenwood Indiana April 16, 2009. Purpose.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Building A Subversion Server' - ostinmannual


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Building a subversion server l.jpg

Building A Subversion Server

Version Control for Your Robot Software

By Hugh Meyer

FRC Team 1741

Red Alert Robotics

Greenwood Indiana

April 16, 2009


Purpose l.jpg
Purpose

  • The purpose of this session is to provide a comprehensive overview of the process to build and use a subversion server by supplying you enough information to implement your own server and expose sources of additional information for more detailed help.

  • By Hugh Meyer FRC Team # 1741


Introduction to subversion l.jpg
Introduction to Subversion

  • What it is and why we need it

  • The Problem of File Sharing

  • Memory Stick Nightmares

  • Ultimate Backup System

  • Giant edit undo button


What is subversion and why do we need it l.jpg
What is Subversion and why do we need it

  • Subversion is software that is designed to help programmers keep track of different changes or versions of code

  • It allows several people to share and work on the same code at the same time

  • It simplifies the process of merging code from different developers


The problem of file sharing l.jpg
The Problem of File Sharing

  • When two or more people need to modify the same file at the same time on different computers

  • How to prevent users from over writing each others changes

  • There are two ways to solve this

  • The Lock-Modify-Unlock Solution

  • The Copy-Modify-Merge Solution


Memory stick nightmares l.jpg
Memory Stick Nightmares

  • Students tend to share files by memory sticks so it is easy for them to share program code this way.

  • As they develop code the number of different files, that are really the same file modified over and over increases beyond control very quickly.

  • Tracking who has the latest version is very difficult and merging changes from different users is very time consuming and error prone.


Ultimate backup system l.jpg
Ultimate Backup System

  • Have you ever lost work because your computer crashed?

  • It is not a matter of if you computer disk crashes but when!


Giant edit undo button l.jpg
Giant edit undo button

  • Have you ever lost work because you saved a file that you changed and wished you had the previous file back?

  • Edit undo is great, but some times it is only good to a point.


Computer hardware l.jpg
Computer Hardware

  • Get a computer to build your server

  • If you have the funds get the biggest hard drive you can

  • If you have the funds get the fastest CPU you can

  • If you have the funds get the most memory you can

  • If you don’t have funds don’t worry! Just about anything will do!


Machine requirements l.jpg
Machine Requirements

  • Generally speaking not very demanding.

  • OS needs about 200 meg of disk space.

  • Memory required is 8 meg.

  • CPU is 386 and up.

  • More is always better…


Ideas for cheap machines l.jpg
Ideas for Cheap Machines

  • Talk to your school network administrator

  • Talk to your sponsors IT department

  • Talk to you church IT administrator

  • Ask parents of students


Load and configure operating system netbsd l.jpg
Load and Configure Operating System NetBSD

  • Download ISO image and burn boot disk

  • Run the install process

  • Learn basic command for VI text editor (Google is your friend)

  • Setup IP address, gateway, DNS servers

  • Connect system to the Internet

  • Test connection

  • Install Package System

  • Setup svn user and svn_user group

  • Configure any firewalls you are behind to open svn port # 3690


Download iso image and burn boot disk l.jpg
Download ISO Image and Burn Boot Disk

  • Go to the NetBSD website.

  • Click on the download NetBSD link.

  • I like to download the ISO image and burn a bootable CD.

  • I generally will download from the master site in California.

  • Use this file and your favorite disk burning software to make a bootable disk.

  • In Nero the command is “burn image” under the “recorder” menu item.

  • This process is not the same as burning a data disk.


Running the install process l.jpg
Running the Install Process

  • Be sure your computer will boot from the CDrom drive. You may need to adjust a setting in your cmos.

  • Follow the wizard prompts. The defaults will nearly always work and are usually the best choices.

  • Reboot the machine.

  • Review the afterboot man page. It provides a check list of stuff to complete after a new install.


Learn some basic os commands l.jpg
Learn Some Basic OS Commands

  • Command cd in this context is change directory

  • “cd /” puts you at the root level

  • Command “cd etc” is where most files you need to change will be

  • Command ls gives a listing of files

  • Command pwd prints working directory

  • Command dmesg shows boot messages that go so fast you miss them


Learn basic os commands l.jpg
Learn Basic OS Commands

  • Man pages are built in help

  • apropos searches the man pages

  • The pipe ‘| more’ function is handy

  • The documentation on the NetBSD website is good

  • How to documents on the NetBSD website are nice


Learn basic commands for vi text editor l.jpg
Learn Basic Commands for VI Text Editor

  • Initiate the editor with the command “vi filename” of the file you want to edit

  • Command “vi rc.conf” edits a primary configuration file

  • J moves down, k moves up, l moves left, h moves right

  • Command :x exits and saves

  • See resource page for more…


Setup ip address gateway dns servers l.jpg
Setup IP address, gateway, DNS servers

  • Edit /etc/rc.conf file to insert ifconfig line and defaultroute gateway.

  • Ifconfig ex0 inet xx.xx.xx.xx netmask 255.255.255.xx using the IP address and netmask for your internet connection.

  • defaultroute=“xx.xx.xx.xx”

  • Edit /etc/resolv.conf to include your ISP namservers

  • nameserver xx.xx.xx.xx


Connect system to the internet l.jpg
Connect System to the Internet

  • Plug in network cable to your network device

  • Be sure it is 100 mbps if possible

  • Check link lights


Test connection l.jpg
Test connection

  • Ping your router

  • ‘ping ww.xx.yy.zz’

  • Ping your name servers

  • Do a name lookup to be sure DNS is working “nslookup google.com”

  • If these three work you can count it good


Install netbsd package system l.jpg
Install NetBSD Package System

  • I like to use sup to install the package system. It takes longer to download initially, but after that it only downloads the updates files and will automatically handle deleting old files. The following commands will do the job.

  • mkdir /etc/supfiles /usr/sup

  • cp /usr/share/examples/supfiles/sup.netbsd.org /etc/supfiles/coll.list


Install netbsd package system22 l.jpg
Install NetBSD Package System

  • Edit the /etc/supfiles/coll.list, and comment out (add a # to the start) all lines except the block of two lines that start “current release=pkgsrc’

  • Run sup to update pkgsrc with the command ‘sup –s –v’

  • Be aware this will take a while. I let it run at night and it is done in the morning.


Setup svn user and svn user group l.jpg
Setup svn user and svn_user group

  • ‘useradd –m svn’

  • ‘groupadd svn_usr’

  • ‘usermod –G svn_usr svn’


Define repository files location l.jpg
Define Repository Files Location

  • Log in as the user svn before creating repository

  • Create the directory structure where you want your repository located

  • ‘mkdir /usr2/repos’

  • Verify that directories are set to correct user and group with the ‘ls –l’ command


Configure any firewalls you are behind to open svn port 3690 l.jpg
Configure Any Firewalls You Are Behind to Open SVN Port # 3690

  • Subversion uses port 3690

  • This port must be open if you are behind any fire walls

  • If this is on a school network then you will need your network administrator to do this

  • If you are on Comcast or AT&T or similar service then you may need to log into your router, or hopefully the port will be open by default

  • You MUST have a static IP address


Load and configure subversion l.jpg
Load and Configure Subversion 3690

  • Download, build, and install subversion using the package system

  • Test your new subversion install

  • Setup inetd to launch subversion on incoming request using svnserve

  • Setup host allow and deny files to control access if desired

  • Create repository using svnadmin create command

  • Setup passwd and other conf files


Download build and install subversion using the package system l.jpg
Download, Build, and Install Subversion Using the Package System

  • Easiest way to install is to use the NetBSD package system.

  • Change directory to the package folder for subversion

  • ‘cd /usr/pkgsrc/devel/subversion’

  • ‘make fetch-list | sh’


Download build and install subversion using the package system28 l.jpg
Download, Build, and Install Subversion Using the Package System

  • ‘make’

  • ‘make install’

  • ‘make clean’

  • ‘make clean CLEANDEPENDS=YES’


Test your new subversion install l.jpg
Test Your New Subversion Install System

  • Test the installation by entering the command ‘svn ? | more’ You should get a response of commands.

  • Enter command ‘svnadmin –help’ you should get list of commands.

  • If these work you are good to go.


Setup inetd l.jpg
Setup inetd System

  • Inetd is a process that looks for incoming connections on the server and launches the appropriate executable depending on the requested service.

  • The /etc/inetd.conf file must be updated to indicate what to do with a subversion request.

  • Edit the /etc/inetd.conf file

  • ‘svn stream tcp nowait svn /usr/pkg/bin/svnserve svnserve –i –r /usr2/repos’


Setup host allow and deny files to control access if desired l.jpg
Setup Host Allow and Deny Files to Control Access If Desired System

  • If you are concerned about security you can create two files that will tell inetd to allow or deny certain requests.

  • Create an /etc/hosts.allow file

  • Insert the following lines

  • ‘svnserve: ALL’ or ‘svnserve: xx.xx.xx.xx


Setup host allow and deny files to control access if desired32 l.jpg
Setup Host Allow and Deny Files to Control Access If Desired System

  • Create a /etc/hosts.deny file

  • ‘ALL:ALL’ or any you know you want to keep out.

  • I have the svn open so students can access it from home, but I do restrict other services like telnet to only allow connections from my home, the school, and my work.

  • See the man page hosts_access(5) for more information on this feature.


Create repository using svnadmin create command l.jpg
Create Repository Using svnadmin Create Command System

  • You should be logged in as user svn

  • Change directory to the location you created earlier for your repository files

  • I use /usr2/repos

  • Create a directory that is named whatever you want your repository called with the mkdir command.

  • Use the svnadmin command to create your repostiory

  • ‘svnadmin create /user2/repos/YouRepoName’

  • Change directory to the new location and you should have several directories with files in them


Setup passwd and other conf files l.jpg
Setup passwd and Other Conf Files System

  • Use command ls and you should see a folder ‘conf’

  • cd to the conf folder

  • Modify the svnserve.conf file to set access like you want and activate the password file

  • The file explains what things do, so read and follow the instructions

  • Modify the password file by adding the users you want to have access to your repository

  • Your server setup is now complete


Create and initialize client working environment l.jpg
Create and Initialize Client Working Environment System

  • Load Client Tools

    • TortoiseSVN

    • Subeclipse

    • Subersion command line tools

    • SlikSVN


Tortoisesvn l.jpg
TortoiseSVN System

  • Integrated solution for Windows

  • Implemented as a shell extension

  • Works with any file type

  • Visually shows you modified files with icon overlays

  • Download from: http://tortoisesvn.net/


Subeclipse l.jpg
Subeclipse System

  • Integrated solution for Eclipse

  • Used by the Wind River Workbench

  • Instructions for installation are in chapter 4 of the FRC Software Guide


Subversion command line tools l.jpg
Subversion Command Line Tools System

  • Useful for compilers

  • Useful to IDEs that need to interface to the repository


Sliksvn l.jpg
SlikSVN System

  • Command tool used by Wind River Workbench

  • Instructions for installation are in chapter 4 of the FRC Software Guide


Using subversion l.jpg
Using Subversion System

  • Initial folders and files import

  • Checkout working copy

  • Commit changes made to working copy

  • Update working copy to merge changes others have made


Initial folders and files import l.jpg
Initial Folders and Files Import System

  • Setup branches, tags, and trunk folders

  • Import the files you want in your trunk folder

  • DELETE Your Local Copy!! (or just move it somewhere else)


Checkout working copy l.jpg
Checkout Working Copy System

  • Use appropriate tool to do initial checkout

  • Test the working copy by compiling to be sure everything works


Committing working copy l.jpg
Committing Working Copy System

  • Select commit option

  • Dialog box will pop up showing what it plans to do

  • Read this box carefully to be sure it is what you want to happen

  • It will show new files and ask if you want to add them or ignore them


Update working copy l.jpg
Update Working Copy System

  • Before you start work always update your working copy

  • You will get any modifications made by others

  • Check the logs if you want to see activity

  • Use the diff viewer to see exactly what has changed


Using your server at competitions l.jpg
Using Your Server At Competitions System

  • Setup server as DHCP server to serve addresses in the range of it’s normal IP range

  • When a user connects he will be assigned a network address similar to the server and can access the repository with no changes in the users local computer configuration


Using your server at competitions55 l.jpg
Using Your Server At Competitions System

  • Add the following to the /etc/rc.conf file

    • dhcpd=YES

    • dhcpd_flags=“-q YourNetInterface”

    • inetd=NO

    • /user/pkg/bin/svnserve –d –r /usr2/repos –listen-host=xx.xx.xx.xx

  • Setup /etc/dhcpd.conf file to serve up IP addresses – see man page for details


Using subversion for frc code base l.jpg
Using Subversion for FRC Code Base System

  • In Wind River Workbench

    • Use Subclipse – Integrated solution


Using subversion for frc code base57 l.jpg
Using Subversion for FRC Code Base System

  • In LabVIEW

    • Use TortoiseSVN on folder where the VI files are saved

    • This will use the Lock-Modify-Unlock approach since LabVIEW files are binary and unknown by ToroiseSVN in the standard mode

    • TortoiseSVN does have some settings for entering a diff, merge tool that might work with LabVIEW, but I have not tried that approach

    • Load PushOK SVN for more integrated solution. See NI document in reference section for more detailed information about this option


Using subversion for frc code base58 l.jpg
Using Subversion for FRC Code Base System

  • In MPLAB. Use TortoiseSVN on project folder

    • Use integrated support via command line Subversion


Additional resources and references l.jpg
Additional Resources and References System

  • The Subversion documentation

  • Books

  • Web links

  • Google is your friend


Version control with subversion l.jpg
Version Control With Subversion System

  • Version Control with Subversion, Second Edition by Ben Collins-Sussman, Brian W. Fitzpatrick, and C. Michael Pilato, published by O’Reilly

  • http://oreilly.com/catalog/9780596510336/

  • The reference book created by core members of the Subversion development team.


Netbsd operating system l.jpg
NetBSD Operating System System

  • NetBSD is a free, secure, and highly portable Unix-like Open Source operating system available for many platforms, from large-scale server systems to powerful desktop systems to handheld and embedded devices.

  • http://netbsd.org/

  • Highly structured and disciplined code that is very stable and reliable.


Netbsd wiki l.jpg
NetBSD Wiki System

  • The NetBSD Wiki is a collaborative writing project to build useful resources for NetBSD users

  • http://netbsd.org/docs/


Tortoisesvn63 l.jpg
TortoiseSVN System

  • TortoiseSVN is an easy to use SCM / source control software for Microsoft Windows

  • It is implemented as a Windows shell extension, which makes it integrate seamlessly into the Windows explorer.

  • Since it's not an integration for a specific IDE you can use it with whatever development tools you like.

  • http://tortoisesvn.net/


Subversion l.jpg
Subversion System

  • The most recent version of Subversion is: 1.6.1. (As of April 13, 2009)

  • You can install Subversion by compiling its source code release directly, or you can install one of the prepackaged binaries found here.

  • http://subversion.tigris.org/getting.html


Subclipse l.jpg
Subclipse System

  • Subclipse is an Eclipse Team Provider plug-in providing support for Subversion within the Eclipse IDE. This is used for the Wind River Workbench tool provided to FRC teams.

  • http://subclipse.tigris.org/

  • The installation instructions in the FRC software guide are very good.


Frc chapter 4 software installation l.jpg
FRC Chapter 4 Software Installation System

  • 4-FRC_Control_System-Software-Installation-0.10c.pdf page 11 & 12

  • Section 4.4.1.1

  • Instructions for installing the SVN plug-in for Eclipse / Wind River Workbench

  • http://www.usfirst.org/uploadedFiles/4-FRC_Control_System-Software-Installation-0.10c.pdf


Pushoksvn l.jpg
PushOKSVN System

  • For LabVIEW – PushOKSVN

  • http://www.pushok.com/soft_svn.php


For labview l.jpg
For LabVIEW System

  • Source Code Control and Group Development Practices in LabVIEW for Advanced Configuration Management Tasks

  • http://decibel.ni.com/content/docs/DOC-1681


Text editor l.jpg
Text Editor System

  • Mastering the VI Editor

  • http://www.eng.hawaii.edu/Tutor/vi.html

  • Vi (pronounce: "vee eye", not "six", not "vye") is an editor. An editor is a program to edit files.

  • http://thomer.com/vi/vi.html

  • Don’t panic. You only need a handful of useful commands


Questions l.jpg
Questions? System


Contact information l.jpg
Contact Information System

  • Hugh Meyer

  • [email protected]

  • Work 317 786-9214

  • Home 317 535-1200

  • Be sure to mention you were in this workshop session

  • This power point file will be online at:

  • http://first.wpi.edu/Workshops/index.html

  • Thank you for attending!


ad