Skip to content

Commit

Permalink
dataclass changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dsschult committed Jul 28, 2023
1 parent b66c35b commit 44eccc6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions iceprod/core/dataclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ def __init__(self,*args,**kwargs):
self['trays'] = []
self['requirements'] = Requirement()
self['task_files'] = False
self['container'] = None
super(Task,self).__init__(*args,**kwargs)

def output(self):
Expand Down Expand Up @@ -363,6 +364,7 @@ def valid(self):
and isinstance(self['requirements'],Requirement)
and self['requirements'].valid()
and isinstance(self['task_files'],bool)
and self['container'] is None or isinstance(self['container'], str)
)
except Exception:
return False
Expand Down
10 changes: 9 additions & 1 deletion iceprod/server/plugins/condor_direct.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from iceprod.core.exe_json import ServerComms
from iceprod.server import grid
from iceprod.server.globus import SiteGlobusProxy
from iceprod.server.plugins.condor import condor_os_reqs

logger = logging.getLogger('plugin-condor_direct')

Expand Down Expand Up @@ -85,6 +84,15 @@ def __init__(self, **kwargs):
super(TaskInfo, self).__init__(**kwargs)


def condor_os_reqs(os_arch):
"""Convert from OS_ARCH to Condor OS requirements"""
os_arch = os_arch.rsplit('_',2)[0].rsplit('.',1)[0]
reqs = 'OpSysAndVer =?= "{}"'.format(os_arch.replace('RHEL','CentOS').replace('_',''))
reqs = reqs + '|| OpSysAndVer =?= "{}"'.format(os_arch.replace('RHEL','SL').replace('_',''))
reqs = reqs + ' || OSGVO_OS_STRING =?= "{}"'.format(os_arch.replace('_',' '))
return '('+reqs+')'


def run_async(func,*args,**kwargs):
async def myfunc():
return_obj = {'args':args,'kwargs':kwargs}
Expand Down

0 comments on commit 44eccc6

Please sign in to comment.