Project

General

Profile

Condor config file management using subversion

The gpcf condor config files are stored in the ifront subversion project in the ifront/condor_configurations subdirectory.
The actual commands to check this out are

[dbox@gpsn01 ~]$ export SVN_DIR=/some/directory/
[dbox@gpsn01 ~]$ mkdir -p $SVN_DIR
[dbox@gpsn01 ~]$ cd $SVN_DIR
[dbox@gpsn01 ~]$ svn checkout svn+ssh://p-ifront@cdcvs.fnal.gov/cvs/projects/ifront

A few things to note about the directory structure
  • a subdirectory is named for each machine that has archived condor config files, ie:
    [dbox@gpsn01 svndemo]$ ls $SVN_DIR/ifront/condor_configurations/
    condor_hosts  gpsn01   gpwn003  gpwn006  if02  if05          README    sngpvm03
    gpcf028       gpwn001  gpwn004  gpwn007  if03  mnvnearline1  sngpvm01
    gpcf029       gpwn002  gpwn005  if01     if04  mnvnearline2  sngpvm02
    
  • the file $SVN_DIR/ifront/condor_configurations/condor_hosts is a list of all the machines that get archived, it is useful for maintenance scripts so if you add a new machine to the archive scheme add its name to this file as well
  • in each subdirectory there are the condor_configuration files and a file named condor_config_file_locations that list where on that particular machine the config files live ie:
    [dbox@gpsn01 svndemo]$ ls $SVN_DIR/ifront/condor_configurations/gpsn01
    condor_config  condor_config_file_location  condor_config.local.worker.node
    [dbox@gpsn01 svndemo]$ cat $SVN_DIR/ifront/condor_configurations/gpsn01/condor_config_file_location
    /opt/condor-7.4.2/etc/condor_config /opt/condor-7.4.2/etc/condor_config.local.worker.node
    
    [dbox@gpsn01 svndemo]$ ls $SVN_DIR/ifront/condor_configurations/if02
    condor_config  condor_config_file_location  condor_config.local
    [dbox@gpsn01 svndemo]$ cat $SVN_DIR/ifront/condor_configurations/if02/condor_config_file_location
    /etc/condor/condor_config /opt/condor/local/condor_config.local
    
    
  • Yeah, so? You can use these files to automate pushing out these configurations to a list of machines like so:
    [dbox@gpsn01 ifront]$ cd $SVN_DIR/ifront/condor_configurations
    [dbox@gpsn01 condor_configurations]$ for host in if01 if02 if03 if04 ; do cd $host; echo "cd $host"; for file in `cat condor_config_file_location` ; do cfg=`basename $file`; echo "scp $cfg $host.fnal.gov:$file" ; done  ; echo "cd .." ; cd .. ; done > 2_cpy_file.sh
    [dbox@gpsn01 condor_configurations]$ #if you did a sh 2_cpy_file.sh instead of cat, you push out all the files
    [dbox@gpsn01 condor_configurations]$ cat 2_cpy_file.sh 
    cd if01
    scp condor_config if01.fnal.gov:/opt/condor-7.2.3/etc/condor_config
    scp condor_config.local if01.fnal.gov:/opt/condor/local/condor_config.local
    cd ..
    cd if02
    scp condor_config if02.fnal.gov:/etc/condor/condor_config
    scp condor_config.local if02.fnal.gov:/opt/condor/local/condor_config.local
    cd ..
    cd if03
    scp condor_config if03.fnal.gov:/opt/condor-7.2.3/etc/condor_config
    scp condor_config.local if03.fnal.gov:/opt/condor/local/condor_config.local
    cd ..
    cd if04
    scp condor_config if04.fnal.gov:/opt/condor-7.2.3/etc/condor_config
    scp condor_config.local if04.fnal.gov:/opt/condor/local/condor_config.local
    cd ..
    [dbox@gpsn01 condor_configurations]$ 
    
  • Don't forget to do a condor_reconfig to make the new files take effect
  • To check in a change and push it out:
    [dbox@gpsn01 condor_configurations]$ cd gpsn01
    [dbox@gpsn01 gpsn01]$ vi condor_config.local.worker.node 
    [dbox@gpsn01 gpsn01]$ svn commit -m 'added some useful comments'
    Sending        gpsn01/condor_config.local.worker.node
    Transmitting file data .
    Committed revision 51.
    [dbox@gpsn01 gpsn01]$ cat condor_config_file_location 
    /opt/condor-7.4.2/etc/condor_config /opt/condor-7.4.2/etc/condor_config.local.worker.node
    [dbox@gpsn01 gpsn01]$ cp condor_config.local.worker.node /opt/condor-7.4.2/etc/condor_config.local.worker.node
    [dbox@gpsn01 gpsn01]$ sudo /opt/condor/sbin/condor_reconfig
    Sent "Reconfig" command to local master