Coverage for python/lsst/ctrl/execute/condorConfig.py: 90%

20 statements  

« prev     ^ index     » next       coverage.py v7.2.7, created at 2023-06-22 09:47 +0000

1#!/usr/bin/env python 

2 

3# 

4# LSST Data Management System 

5# Copyright 2008-2016 LSST Corporation. 

6# 

7# This product includes software developed by the 

8# LSST Project (http://www.lsst.org/). 

9# 

10# This program is free software: you can redistribute it and/or modify 

11# it under the terms of the GNU General Public License as published by 

12# the Free Software Foundation, either version 3 of the License, or 

13# (at your option) any later version. 

14# 

15# This program is distributed in the hope that it will be useful, 

16# but WITHOUT ANY WARRANTY; without even the implied warranty of 

17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 

18# GNU General Public License for more details. 

19# 

20# You should have received a copy of the LSST License Statement and 

21# the GNU General Public License along with this program. If not, 

22# see <http://www.lsstcorp.org/LegalNotices/>. 

23# 

24 

25import lsst.pex.config as pexConfig 

26 

27 

28class PlatformConfig(pexConfig.Config): 

29 """Platform specific information""" 

30 

31 defaultRoot = pexConfig.Field( 

32 doc="remote root for working directories", dtype=str, default=None 

33 ) 

34 localScratch = pexConfig.Field( 

35 doc="local Condor scratch directory", dtype=str, default=None 

36 ) 

37 idsPerJob = pexConfig.Field( 

38 doc="number of ids to work on per job", dtype=int, default=1 

39 ) 

40 dataDirectory = pexConfig.Field( 

41 doc="remote directory where date that jobs will use is kept", 

42 dtype=str, 

43 default=None, 

44 ) 

45 fileSystemDomain = pexConfig.Field( 

46 doc="network domain name of remote system", dtype=str, default=None 

47 ) 

48 eupsPath = pexConfig.Field( 

49 doc="location of remote EUPS stack", dtype=str, default=None 

50 ) 

51 nodeSetRequired = pexConfig.Field( 

52 doc="is the nodeset required", dtype=bool, default=False 

53 ) 

54 scheduler = pexConfig.Field(doc="scheduler type", dtype=str, default=None) 

55 manager = pexConfig.Field(doc="workflow manager", dtype=str, default=None) 

56 setup_using = pexConfig.Field(doc="environment setup type", dtype=str, default=None) 

57 manager_software_home = pexConfig.Field( 

58 doc="location of workflow manager software", dtype=str, default=None 

59 ) 

60 

61 

62class CondorConfig(pexConfig.Config): 

63 """A pex_config file describing the platform specific information required 

64 to fill out templates for running ctrl_orca jobs 

65 """ 

66 

67 platform = pexConfig.ConfigField("platform configuration", PlatformConfig) 

68 

69 

70class FakeTypeMap(dict): 

71 def __init__(self, configClass): 

72 self.configClass = configClass 

73 

74 def __getitem__(self, k): 

75 return self.setdefault(k, self.configClass)