Change Version Management - PowerPoint PPT Presentation

1 / 29
About This Presentation
Title:

Change Version Management

Description:

Renaming files and directories is awkward. Must be deleted and re-added. Branching limitations ... Directories are versioned. Entire directory trees can be ... – PowerPoint PPT presentation

Number of Views:62
Avg rating:3.0/5.0
Slides: 30
Provided by: jds1
Category:

less

Transcript and Presenter's Notes

Title: Change Version Management


1
Change / Version Management
  • A look at
  • CVS, Subversion and cfengine

2
What is Version Management?
  • Management of multiple revisions of the same unit
    of information
  • Application Source Code, Art Resources such as
    blueprints or electronic models
  • SCM (Software Configuration Management) -
    Revision control for software projects

3
Why is it important?
  • Teamwork
  • Allows for information to be worked on by a team
    of people concurrently
  • copy-modify-merge model
  • Prevent overwriting of someone elses change
  • Development
  • Develop two versions of the software concurrently
  • Fix minor bugs in a stable version while adding
    bleeding edge features to another
  • Debugging
  • Retrieve and run different versions of the
    software to determine in which version(s) the
    problem occurs
  • Provides accountability, who made what change when

4
SCM Packages
  • Server Based
  • CVS
  • Subversion
  • Rational Clear Case (proprietary)
  • Distributed
  • GNU Arch
  • Git Used for Linux kernel development
  • BitKeeper (proprietary)
  • Many Others

5
CVS
  • Concurrent Versions System
  • CVS developed from an earlier versioning system
    called Revision Control System (RCS)
  • The code that eventually evolved into the current
    version of CVS started in April 1989
  • CVS is extremely popular, and it does the job.

6
CVS Terminology
  • Module
  • A single project managed by CVS
  • Repository
  • Where a CVS server stores the modules it manages
  • Checking out
  • Acquiring a copy of a module
  • Working copy
  • The checked out files
  • Committing
  • Updating the repository with the changes you made
    on your working copy
  • Update
  • Acquire the latest changes from the repository in
    the working copy

7
CVS Problems
  • Number of awkward limitations
  • Changes are tracked per-file instead of
    per-change
  • Commits aren't atomic
  • Renaming files and directories is awkward
  • Must be deleted and re-added
  • Branching limitations
  • Some of the maintainers of the original CVS have
    declared that the CVS code has become too crusty
    to effectively maintain.

8
Subversion Background
  • Designed specifically to be a modern replacement
    for CVS
  • Dont need to break new ground in version control
    methodology
  • Just fix CVS
  • Match CVS's features, and preserve the same
    development model, but not duplicate CVS's most
    obvious flaws
  • So even though low level implementation is vastly
    different, the higher level view and use of both
    systems is almost identical

9
Advantages over CVS
  • Atomic commits. Interrupted commit operations do
    not cause repository inconsistency or corruption
  • Renamed/copied/removed files retain full revision
    history
  • Native support for binary files, with
    space-efficient binary-diff storage
  • Directories are versioned. Entire directory trees
    can be moved around and/or copied very quickly,
    and retain full revision history
  • Optimized repository accesses. This reduces
    unnecessary network traffic to the repository
    host

10
Subversions Architecture
11
Typical use as client
  • Help
  • svn help subcommand
  • Update your working copy
  • svn update
  • Make changes
  • svn add
  • svn delete
  • svn copy
  • svn move
  • Examine your changes
  • svn status
  • svn diff
  • svn revert
  • Merge others' changes
  • svn merge
  • svn resolved
  • Commit your changes
  • svn commit

12
Repository Setup
  • svnadmin is the main tool used to maintain and
    administer the repository
  • Repository creation
  • svnadmin create /path/to/repos
  • Cannot create repository on a network share
    (NFS/AFS etc.)
  • Recommended directory structure
  • /
  • calc/
  • trunk/
  • tags/
  • branches/

13
Branching and Merging
  • Branch
  • Line of development that exists independently of
    another line, yet still shares a common history
    if you look far enough back in time.
  • svn copy from trunk directory to branches
    directory
  • Merge
  • Copy the changes from the trunk into your branch
    or vice versa

14
Tags
  • Tag is just a snapshot of a project in time
  • Official Releases, version 1.0, 1.1 etc.
  • svn copy ltpathgt/trunk ltpathgt/tags/release-1.0 \
    -m "Tagging the 1.0 release of the project."
  • Same method as creating a branch

15
Server Configuration
  • svnserve lightweight custom TCP/IP server
  • Makes every repository on your system available
    to the network
  • svnserve.conf controls authentication and
    authorization
  • httpd use Apache WebDAV module
  • Get httpd 2.0 up and running with the mod_dav
    module
  • Install the mod_dav_svn plugin to mod_dav, which
    uses Subversion's libraries to access the
    repository
  • Configure your httpd.conf file to export the
    repository

16
Sys Admin uses for Subversion
  • Create a repository to store all configuration
    files for the system
  • Provides a traceable history of all changes made
    to the system
  • No easy way to do this
  • Must have 2 copies
  • Real in use files
  • Copy of them to checkout/commit to repository
  • Up to the sys admin to make sure the repository
    is always updated when a config file is changed

17
What is cfengine
  • Environment for turning system policy into
    automated action
  • Defining the way you want all hosts on your
    network to be configured
  • Writing this in a single program which is read
    by every host on the network
  • Running this program on every host in order to
    check and possibly fix the setup of the host
  • Ability to specify general rules for large groups
    of hosts and special rules for exceptional hosts

18
Why cfengine?
  • Lots of repetitive and menial jobs involved in
    system maintenance
  • cfengine allows these tasks to be fully automated
    which saves time and makes the admin available
    for more interesting work

19
What about shell scripts?
  • Heterogeneous environment
  • Shell-scripts work very poorly
  • Shell commands have differing syntax across
    different operating systems
  • Locations and names of key files differ
  • Scripts become unreadable because they contain so
    many tests to determine what kind of OS it was
    being run on
  • Scripts distributed, placed only on the systems
    where they were relevant, out of sight and out of
    mind

20
What can cfengine do?
  • Check and configure the network interface on
    network hosts
  • Edit text files for the system or for all users
  • Make and maintain symbolic links
  • Check and set the permissions and ownership of
    files
  • Delete junk files which clutter the system
  • Systematic, automated mounting of NFS filesystems
  • Checking for the presence or absence of important
    files and filesystems
  • Controlled execution of user scripts and shell
    commands
  • Process management

21
What is a cfengine program?
  • Not an imperative language like Perl, but a
    declarative language that resembles Prolog
  • Actions not listed in order but listed in bulk
  • action-sequence defines the order
  • cfagent.conf text file which contains cfengine
    program

22
cfengine program cont.
  • action-type
  • classes
  • list of actions

23
Sample program
  • control
  • domain ( mydomain )
  • actionsequence ( shellcommands )
  • shellcommands
  • All GNU/Linux machines
  • linux
  • /usr/bin/updatedb
  • Just one host
  • myhost
  • /bin/echo Hi there

24
Classes
  • A class can be one of several things
  • OS architecture, ultrix, sun4 etc.
  • Unqualified name of a particular host
  • Name of user-defined group of hosts
  • Day of the week
  • Hour of the day
  • Etc.
  • Compound Class
  • myclass.sun4.Monday
  • sun4ultrixosf
  • mygroup.!myhost

25
Cfengine services
  • cfagent
  • This component does the configuring of the system
    based on rules specified in the file cfagent.conf
  • cfservd
  • A daemon which acts as both a file server and a
    remote-cfengine executor. This daemon
    authenticates requests from the network and
    processes them according to rules specified in
    cfservd.conf. It works as a file server and as a
    mechanism for starting cfengine on a local host
    and piping its output back to the network
    connection
  • cfrun
  • This is a simple initiation program which can be
    used to run cfengine on a number of remote hosts.
    It can only ask cfengine on the remote host to
    run the configuration file it already has

26
cfengine .conf files
  • cfagent.conf Contains the program to be run
    on the local machine
  • update.conf Where does cfagent get the master
    program?
  • cfservd.conf Grant access to hosts who need
    master program. Only needed on the master
    system that is running cfservd

27
Running cfengine
  • Use cron as a front end to cfengine to run it
    regularly (every 10 mins, hourly etc.)
  • Only need one entry in cron for every system
  • Replace anything that was scheduled by cron in
    cfengine

28
Combine cfengine and Subversion?
  • Use Subversion to manage your cfengine
    programs. A mistake in a cfengine program can
    have extreme effects
  • Use cfengine to manage all of the configuration
    files as described
  • Use cfengine to also ensure that every change is
    committed to the Subversion repository

29
More Info on cfengine
  • http//www.gnu.org/software/cfengine/docs/cfengine
    -Tutorial.html
Write a Comment
User Comments (0)
About PowerShow.com