Skip to content

Commit 117c467

Browse files
Merge pull request #23 from brianhlin/HTCONDOR-506.evalset-batchruntime
Workaround limited BatchRuntime expressions (HTCONDOR-506)
2 parents c74b3af + 3b09285 commit 117c467

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ RUN chmod 644 /etc/cron.d/fetch-crl
4848
# HTCondor-CE.
4949
COPY base/overrides/condor_ce_jobmetrics /usr/share/condor-ce/condor_ce_jobmetrics
5050

51+
# Workaround BatchRuntime expresion bug (HTCONDOR-506)
52+
COPY base/overrides/HTCONDOR-506.evalset-batchruntime.patch /tmp
53+
RUN patch -d / -p0 < /tmp/HTCONDOR-506.evalset-batchruntime.patch
54+
5155
#################
5256
# osg-ce-condor #
5357
#################
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
--- /usr/share/condor-ce/config.d/01-ce-router-defaults.conf
2+
+++ /usr/share/condor-ce/config.d/01-ce-router-defaults.conf
3+
@@ -255,19 +255,19 @@ JOB_ROUTER_TRANSFORM_Queue @=jrt
4+
5+
JOB_ROUTER_TRANSFORM_BatchRuntime @=jrt
6+
# 'BatchRuntime' is in seconds but admins configure 'default_maxWallTime' and 'ROUTED_JOB_MAX_TIME' and remote
7+
- # submitters set 'maxWallTime' in minutes. Remote submitters set 'BatchRuntime' in minutes
8+
+ # submitters set 'maxWallTime' in minutes. Remote submitters set 'BatchRuntime' in seconds.
9+
# Set the remote batch runtime used by non-HTCondor batch systems to one of the following, in order:
10+
# 1. 'maxWalltime' (minutes) from the source job
11+
# 2. 'BatchRuntime' (seconds) from the source job
12+
# 3. 'default_maxWallTime' (minutes) from the route
13+
# 4. 'ROUTED_JOB_MAX_TIME' (minutes) from the config
14+
if defined MY.maxWallTime
15+
- SET BatchRuntime 60*maxWallTime
16+
- elif defined MY.org_BatchRuntime
17+
+ EVALSET BatchRuntime 60*maxWallTime
18+
+ elif defined MY.orig_BatchRuntime
19+
# do nothing, BatchRuntime already set
20+
elif defined default_maxWallTime
21+
# default_maxWallTime can be an attribute reference here
22+
- SET BatchRuntime 60*$(default_maxWallTime)
23+
+ EVALSET BatchRuntime 60*$(default_maxWallTime)
24+
else
25+
EVALSET BatchRuntime 60*$(ROUTED_JOB_MAX_TIME:4320)
26+
endif
27+
--- /usr/share/condor-ce/condor_ce_router_defaults
28+
+++ /usr/share/condor-ce/condor_ce_router_defaults
29+
@@ -132,13 +132,13 @@ JOB_ROUTER_DEFAULTS_GENERATED @=jrd
30+
31+
/* BatchRuntime is in seconds but users configure default_maxWallTime and ROUTED_JOB_MAX_TIME in minutes */
32+
copy_BatchRuntime = "orig_BatchRuntime";
33+
- set_BatchRuntime = ifThenElse(maxWallTime isnt undefined,
34+
- 60*maxWallTime,
35+
- ifThenElse(orig_BatchRuntime isnt undefined,
36+
- orig_BatchRuntime,
37+
- ifThenElse(default_maxWallTime isnt undefined,
38+
- 60*default_maxWallTime,
39+
- 60*$(ROUTED_JOB_MAX_TIME))));
40+
+ eval_set_BatchRuntime = ifThenElse(maxWallTime isnt undefined,
41+
+ 60*maxWallTime,
42+
+ ifThenElse(orig_BatchRuntime isnt undefined,
43+
+ orig_BatchRuntime,
44+
+ ifThenElse(default_maxWallTime isnt undefined,
45+
+ 60*default_maxWallTime,
46+
+ 60*$(ROUTED_JOB_MAX_TIME))));
47+
48+
set_CondorCE = 1;
49+
eval_set_CERequirements = ifThenElse(default_CERequirements isnt undefined,

0 commit comments

Comments
 (0)