Changeset 32897
- Timestamp:
- Dec 8, 2011, 11:31:08 AM (15 years ago)
- Location:
- trunk/ippdor
- Files:
-
- 6 edited
-
deployment/Deployment.py (modified) (2 diffs)
-
deployment/deploy.py (modified) (5 diffs)
-
quality_metrics.sh (modified) (1 diff)
-
src/executables/ippdor_chip_to_warp.py (modified) (3 diffs)
-
src/ipp/Gpc1Manager.py (modified) (2 diffs)
-
src/ipp/constants/Globals.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippdor/deployment/Deployment.py
r32874 r32897 96 96 """ 97 97 Check different elements 98 TODO: add checks for IppSite definition 98 99 """ 99 100 Deployment.logger.info('Checking Condor-IPP Softwares Configuration') … … 153 154 """ 154 155 Deployment.logger.info('Deploying Condor-IPP Softwares') 156 Deployment.logger.info('... Installing Site definition class to [%s]' 157 % self.target_directory) 158 shutil.copyfile('.tmp_site/IppSite.py', 159 '%s/IppSite.py' % (self.target_directory)) 155 160 Deployment.logger.info('... Installing Python classes to [%s]' % self.target_directory) 156 161 for filename in Deployment.CLASSES_FILENAMES: -
trunk/ippdor/deployment/deploy.py
r32883 r32897 4 4 Utility executable for IPP Condor deployment 5 5 """ 6 def hostname():7 """8 Get the host name9 >>> print hostname()10 neverland11 """12 import socket13 return socket.gethostbyaddr(socket.gethostname())[0].split('.')[0]14 15 # Default values16 class DefaultValues:17 """18 This class contains all default values for the IPP Condor deployment19 """20 if hostname().startswith('ipp'): # Production cluster21 svnSourceUrl = 'https://svn.pan-starrs.ifa.hawaii.edu/repo/ipp/trunk/ippdor/src'22 targetDirectory = '/home/panstarrs/ippdor/local/share/python/ipp'23 targetBinaryDirectory = '/home/panstarrs/ippdor/local/bin'24 else:25 svnSourceUrl = 'file:///home/schastel/svnrepo/ippdor/trunk/src'26 targetDirectory = '/home/schastel/local/share/python/ipp'27 targetBinaryDirectory = '/home/schastel/local/bin'28 29 def __init__(self):30 """Not to be used as a class31 """32 raise Exception('Not to be used as a class')33 34 6 import sys 7 import os 35 8 import logging 36 9 #optparse Deprecated in python 2.7. Will be replaced by argparse … … 39 12 40 13 if __name__ == '__main__': 41 USAGE = """usage: %prog [options] arg1 arg214 USAGE = """usage: %prog [options] <ipp site definition file> 42 15 43 16 Deploy the Condor-IPP softwares … … 53 26 help = 'Be quiet', 54 27 default = False) 55 PARSER.add_option( '-s', '--svnSourceUrl',56 dest = "svnSourceUrl",57 help = 'SVN Source URL [default: %default]',58 default = DefaultValues.svnSourceUrl )59 PARSER.add_option( '-t', '--targetDirectory',60 dest = "targetDirectory",61 help = 'Target Python Directory for classes [default: %default]',62 default = DefaultValues.targetDirectory )63 PARSER.add_option( '-b', '--targetBinaryDirectory',64 dest = "targetBinaryDirectory",65 help = 'Target Executables Directory [default: %default]',66 default = DefaultValues.targetBinaryDirectory )67 28 (OPTIONS, ARGS) = PARSER.parse_args() # ... the values are stored in options 68 29 if len(ARGS) != 1: 30 PARSER.print_help() 31 sys.exit(1) 32 IPP_SITE_FILE = ARGS[0] 33 # Logging setup 69 34 LOGGER = logging.getLogger('ippdor') 70 35 FORMATTER = logging.Formatter('%(asctime)s | %(levelname)7s | %(message)s', … … 81 46 else: 82 47 LOGGER.setLevel(logging.INFO) 48 # Import IppSite definition 49 LOGGER.info('Importing local site definitions') 50 try: 51 os.makedirs('.tmp_site') 52 except OSError: 53 LOGGER.warn('Existing .tmp_site directory') 54 import shutil 55 shutil.copy(IPP_SITE_FILE, '.tmp_site/IppSite.py') 56 INITFILE = open('.tmp_site/__init__.py', 'w') 57 INITFILE.close() 58 sys.path.append('.tmp_site') 59 from IppSite import IppSite 83 60 61 # Deployment 84 62 try: 85 DEPLOYMENT = Deployment( OPTIONS.svnSourceUrl,86 OPTIONS.targetDirectory,87 OPTIONS.targetBinaryDirectory)63 DEPLOYMENT = Deployment(IppSite.SVN_SOURCE_URL, 64 IppSite.TARGET_DIRECTORY, 65 IppSite.TARGET_BINARY_DIRECTORY) 88 66 DEPLOYMENT.check() 89 67 DEPLOYMENT.svn_export() … … 97 75 import traceback 98 76 traceback.print_exc() 77 # Clean temporary site 78 LOGGER.info('Cleaning temporary site definitions') 79 os.remove('.tmp_site/IppSite.py') 80 os.remove('.tmp_site/IppSite.pyc') 81 os.remove('.tmp_site/__init__.py') 82 os.rmdir('.tmp_site') -
trunk/ippdor/quality_metrics.sh
r32883 r32897 10 10 /bin/rm -rf ./test 11 11 mkdir -p ./test/ipp ./test/bin 12 ./deployment/deploy.py -t ./test/ipp -b ./test/bin12 ./deployment/deploy.py IppSiteTest.py 13 13 14 14 echo "\"\"\"Stupido\n\"\"\"" > ./test/__init__.py -
trunk/ippdor/src/executables/ippdor_chip_to_warp.py
r32894 r32897 44 44 def __init__(self, 45 45 label, 46 recipient, 47 host='ippdb01.ifa.hawaii.edu', 48 user='ipp', 49 passwd='ipp'): 46 recipient): 50 47 """ 51 48 The constructor: … … 54 51 - creates a local directory 55 52 """ 56 Gpc1Manager.__init__(self, recipient=recipient , host=host, user=user, passwd=passwd)53 Gpc1Manager.__init__(self, recipient=recipient) 57 54 self.label = label 58 55 if self.is_label_used(): … … 231 228 print 'Aborting' 232 229 sys.exit(4) 233 if os.getenv('USER') == 'ippdor': 234 BUILDER = ChipWarpBuilder(LABEL, RECIPIENT) 235 else: 236 BUILDER = ChipWarpBuilder(LABEL, RECIPIENT, host='ipp0012.ifa.hawaii.edu') 230 BUILDER = ChipWarpBuilder(LABEL, RECIPIENT) 237 231 # Check exposures 238 232 EXPOSURES_IDS = dict() -
trunk/ippdor/src/ipp/Gpc1Manager.py
r32890 r32897 5 5 import sys 6 6 import MySQLdb 7 from ipp.IppSite import Gpc1 7 8 8 9 ################################################################# … … 12 13 """ 13 14 def __init__(self, 14 recipient = 'schastel@ifa.hawaii.edu', 15 host = 'ippdb01.ifa.hawaii.edu', 16 user = 'ipp', 17 passwd = 'ipp'): 15 recipient = 'schastel@ifa.hawaii.edu'): 18 16 """Create a connector to the gpc1 database 19 17 """ 20 18 self.recipient = recipient 21 self.connector = MySQLdb.connect(host, user, passwd, db = 'gpc1') 19 self.connector = MySQLdb.connect(Gpc1.HOST, 20 Gpc1.USER, 21 Gpc1.PASSWORD, 22 db = Gpc1.NAME) 22 23 self.label = None # Set by derived classes 23 24 -
trunk/ippdor/src/ipp/constants/Globals.py
r32892 r32897 17 17 from ipp.helpers import hostname 18 18 from ipp.exceptions.UninstantiableIppException import UninstantiableIppException 19 from ipp.IppSite import IppSite 19 20 20 21 class Globals: … … 27 28 raise UninstantiableIppException() 28 29 29 if hostname().startswith('ipp'): # Production cluster 30 IPPDOR_BINARY_PATH = '/home/panstarrs/ippdor/local/bin' 31 LOCAL_TMP_DIR = '/export/%s.0/ippdor/processing' % hostname() 32 NFS_TMP_DIR = '/home/panstarrs/ippdor/processing' 33 IPP_BIN_PATH = '/home/panstarrs/ippdor/psconfig/20110920/current.lin64/bin' 34 else: # Development 35 IPPDOR_BINARY_PATH = '~/local/bin' 36 LOCAL_TMP_DIR = '/tmp/ippdor_processing' 37 NFS_TMP_DIR = '~/ippdor_processing' 38 IPP_BIN_PATH = '~/ipp/default.linux' 30 IPPDOR_BINARY_PATH = IppSite.TARGET_BINARY_DIRECTORY 31 LOCAL_TMP_DIR = IppSite.LOCAL_TMP_DIR 32 NFS_TMP_DIR = IppSite.NFS_TMP_DIR 33 IPP_BIN_PATH = IppSite.IPP_BIN_PATH 39 34 40 35 # Global requirements … … 42 37 43 38 # Condor scripts 44 GENERATE_EXPOSURE_DAG = '%s/generate_exposure_dag.py %s %s %s' % (IPPDOR_BINARY_PATH, '%s', '%s', '%s') 39 GENERATE_EXPOSURE_DAG = '%s/generate_exposure_dag.py %s %s %s' % (IPPDOR_BINARY_PATH, 40 '%s', '%s', '%s') 45 41 46 42 ################### … … 67 63 # Stack stage 68 64 STACKTOOL = '%s/stacktool' % IPP_BIN_PATH 69
Note:
See TracChangeset
for help on using the changeset viewer.
