HTCondor Administration Basics and Architecture

undefined
H
T
C
o
n
d
o
r
 
A
d
m
i
n
i
s
t
r
a
t
i
o
n
B
a
s
i
c
s
G
r
e
g
 
T
h
a
i
n
C
e
n
t
e
r
 
f
o
r
 
H
i
g
h
 
T
h
r
o
u
g
h
p
u
t
 
C
o
m
p
u
t
i
n
g
HTCondor Architecture Overview
Configuration and other nightmares
Setting up a personal condor
Setting up distributed condor
Minor topics
O
v
e
r
v
i
e
w
2
Jobs
Machines
T
w
o
 
B
i
g
 
H
T
C
o
n
d
o
r
 
A
b
s
t
r
a
c
t
i
o
n
s
3
L
i
f
e
 
c
y
c
l
e
 
o
f
 
H
T
C
o
n
d
o
r
 
J
o
b
4
Idle
Xfer In
Running
Complete
Held
Xfer out
History file
Submit
file
Suspend
L
i
f
e
 
c
y
c
l
e
 
o
f
 
H
T
C
o
n
d
o
r
 
M
a
c
h
i
n
e
5
schedd
startd
collector
Config file
negotiator
shadow
Schedd may “split”
S
u
b
m
i
t
 
S
i
d
e
6
Idle
Xfer In
Running
Complete
Held
Suspend
Xfer out
Suspend
Suspend
History file
Submit
file
E
x
e
c
u
t
e
 
S
i
d
e
7
Idle
Xfer In
Running
Complete
Held
Suspend
Xfer out
Suspend
Suspend
History file
Submit
file
T
h
e
 
s
u
b
m
i
t
 
s
i
d
e
8
Submit side managed by 1
 
condor_schedd process
And one shadow per running job
condor_shadow process
The Schedd is a database
Submit points can be
performance bottleneck
Usually a handful per pool
universe = vanilla
executable = compute
request_memory = 70M
arguments = $(ProcID)
should_transfer_input = yes
output = out.$(ProcID)
error = error.$(ProcId)
+IsVerySpecialJob = true
Queue
I
n
 
t
h
e
 
B
e
g
i
n
n
i
n
g
9
HTCondor Submit file
 
10
condor_submit submit_file
 
Submit file in, Job classad out
 
Sends to schedd
 
man condor_submit for full details
Other ways to talk to schedd
 
Python bindings, SOAP, wrappers (like DAGman)
JobUniverse = 5
Cmd = “compute”
Args = “0”
RequestMemory = 70000000
Requirements = Opsys == “Li..
DiskUsage = 0
Output = “out.0”
IsVerySpecialJob = true
F
r
o
m
 
s
u
b
m
i
t
 
t
o
 
s
c
h
e
d
d
One pool, Many schedds
condor_submit –name
 
chooses
Owner Attribute:
 
need authentication
Schedd also called “q”
 
not actually a queue
C
o
n
d
o
r
_
s
c
h
e
d
d
 
h
o
l
d
s
 
a
l
l
 
j
o
b
s
11
JobUniverse = 5
Owner = “gthain”
JobStatus = 1
NumJobStarts = 5
Cmd = “compute”
Args = “0”
RequestMemory = 70000000
Requirements = Opsys == “Li..
DiskUsage = 0
Output = “out.0”
IsVerySpecialJob = true
In memory (big)
h
condor_q expensive
And on disk
h
Fsync’s often
h
Monitor with linux
Attributes in manual
condor_q -l job.id
h
e.g. condor_q -l 5.0
C
o
n
d
o
r
_
s
c
h
e
d
d
 
h
a
s
 
a
l
l
 
j
o
b
s
12
JobUniverse = 5
Owner = “gthain”
JobStatus = 1
NumJobStarts = 5
Cmd = “compute”
Args = “0”
RequestMemory = 70000000
Requirements = Opsys == “Li..
DiskUsage = 0
Output = “out.0”
IsVerySpecialJob = true
Write a wrapper to condor_submit
SUBMIT_ATTRS
condor_qedit
W
h
a
t
 
i
f
 
I
 
d
o
n
t
 
l
i
k
e
 
t
h
o
s
e
A
t
t
r
i
b
u
t
e
s
?
13
C
l
a
s
s
A
d
s
:
 
T
h
e
 
l
i
n
g
u
a
 
f
r
a
n
c
a
 
o
f
H
T
C
o
n
d
o
r
14
ClassAds is a language for objects (jobs and
machines) to
h
Express attributes about themselves
h
Express what they require/desire in a “match”
(similar to personal classified ads)
Structure
 : Set of attribute name/value pairs,
where the value can be a literal or an
expression.  Semi-structured, no fixed
schema.
W
h
a
t
 
a
r
e
 
C
l
a
s
s
A
d
s
?
15
16
E
x
a
m
p
l
e
 
Pet Ad
 
Type  = “Dog”
 
Requirements
 =
    DogLover =?= True
 Color = “Brown”
 Price = 75
 Sex = "Male"
 AgeWeeks = 8
 Breed = "Saint Bernard"
 Size = "Very Large"
 Weight = 27
 
Buyer Ad
 AcctBalance  = 100
 DogLover = True
 
Requirements
 =
  (Type == “Dog”)  &&
  (TARGET.Price <=
   MY.AcctBalance) &&
  ( Size == "Large" ||
    Size == "Very Large" )
 
Rank
 =
  100* (Breed == "Saint
Bernard") - Price
 . . .
Literals
h
Strings ( “RedHat6” ), integers, floats, boolean
(true/false), …
Expressions
h
Similar look to C/C++ or Java : operators, references,
functions
h
References
: to other attributes in the same ad, or
attributes in an ad that is a candidate for a match
h
Operators
: +, -, *, /, <, <=,>, >=, ==, !=, &&, and || all
work as expected
h
Built-in Functions
: if/then/else, string manipulation,
regular expression pattern matching, list operations,
dates, randomization, math (ceil, floor, quantize,…),
time functions, eval, …
C
l
a
s
s
A
d
 
V
a
l
u
e
s
17
17
F
o
u
r
-
v
a
l
u
e
d
 
l
o
g
i
c
ClassAd Boolean expressions can return four values:
h
True
h
False
h
Undefined (a reference can’t be found)
h
Error (Can’t be evaluated)
Undefined enables explicit policy statements 
in the
absence of data 
(common across administrative
domains)
Special meta-equals ( =?= ) and meta-not-equals (=!=)
will never return Undefined
[
  HasBeer = True
  GoodPub1 = HasBeer == True 
  GoodPub2 = HasBeer =?= True
]
[
  GoodPub1 = HasBeer == True 
  GoodPub2 = HasBeer =?= True
]
HTCondor has many types of ClassAds
h
A "
Job Ad
" represents a job to Condor
h
A "
Machine Ad
" represents a computing
resource
h
Others types of ads represent other instances of
other services (daemons), users, accounting
records.
C
l
a
s
s
A
d
 
T
y
p
e
s
19
Two ClassAds can be matched via special
attributes: Requirements and Rank
Two ads match if both their Requirements
expressions evaluate to True
Rank evaluates to a float where higher is
preferred; specifies the which match is desired if
several ads meet the Requirements.
Scoping of attribute references when matching
MY.name – Value for attribute “name” in local ClassAd
TARGET.name – Value for attribute “name” in match candidate
ClassAd
Name – Looks for “name” in the local ClassAd, then the
candidate ClassAd
T
h
e
 
M
a
g
i
c
 
o
f
 
M
a
t
c
h
m
a
k
i
n
g
20
21
E
x
a
m
p
l
e
 
Pet Ad
 
Type  = “Dog”
 
Requirements
 =
    DogLover =?= True
 Color = “Brown”
 Price = 75
 Sex = "Male"
 AgeWeeks = 8
 Breed = "Saint Bernard"
 Size = "Very Large"
 Weight = 27
 
Buyer Ad
 AcctBalance  = 100
 DogLover = True
 
Requirements
 =
  (Type == “Dog”)  &&
  (TARGET.Price <=
   MY.AcctBalance) &&
  ( Size == "Large" ||
    Size == "Very Large" )
 
Rank
 =
  100* (Breed == "Saint
Bernard") - Price
 . . .
B
a
c
k
 
t
o
 
c
o
n
f
i
g
u
r
a
t
i
o
n
22
Not much policy to be configured in schedd
Mainly scalability and security
MAX_JOBS_RUNNING
JOB_START_DELAY
MAX_CONCURRENT_DOWNLOADS
MAX_JOBS_SUBMITTED
C
o
n
f
i
g
u
r
a
t
i
o
n
 
o
f
 
S
u
b
m
i
t
 
s
i
d
e
23
T
h
e
 
E
x
e
c
u
t
e
 
S
i
d
e
24
Primarily managed by
  condor_startd process
With one condor_starter
   per running jobs
Sandboxes the jobs
Usually many per pool
(support 10s of thousands)
Condor makes it up
h
From interrogating the machine
h
And the config file
h
And sends it to the collector
condor_status [-l]
h
Shows the ad
condor_status –direct daemon
h
Goes to the startd
S
t
a
r
t
d
 
a
l
s
o
 
h
a
s
 
a
 
c
l
a
s
s
a
d
25
C
o
n
d
o
r
_
s
t
a
t
u
s
 
l
 
m
a
c
h
i
n
e
26
OpSys = "LINUX“
CustomGregAttribute = “BLUE”
OpSysAndVer = "RedHat6"
TotalDisk = 12349004
Requirements = ( START )
UidDomain = “cheesee.cs.wisc.edu"
Arch = "X86_64"
StartdIpAddr = "<128.105.14.141:36713>"
RecentDaemonCoreDutyCycle = 0.000021
Disk = 12349004
Name = "slot1@chevre.cs.wisc.edu"
State = "Unclaimed"
Start = true
Cpus = 32
Memory = 81920
HTCondor treats multicore as independent
slots
Start can be configured to:
h
Only run jobs based on machine state
h
Only run jobs based on other jobs running
h
Preempt or Evict jobs based on policy
A whole talk just on this
O
n
e
 
S
t
a
r
t
d
,
 
M
a
n
y
 
s
l
o
t
s
27
Mostly policy, whole talk on that
Several directory parameters
EXECUTE – where the sandbox is
CLAIM_WORKLIFE
h
How long to reuse a claim for different jobs
C
o
n
f
i
g
u
r
a
t
i
o
n
 
o
f
 
s
t
a
r
t
d
28
There’s also a “Middle”, the Central
Manager:
h
A condor_negotiator
Provisions machines to schedds
h
A condor_collector
Central nameservice:  like LDAP
condor_status queries this
Please don’t call this “Master node” or head
Not the bottleneck you may think: stateless
T
h
e
 
M
i
d
d
l
e
 
s
i
d
e
29
Pool-wide scheduling policy resides here
Scheduling of one user vs another
Definition of groups of users
Definition of preemption
R
e
s
p
o
n
s
i
b
i
l
i
t
i
e
s
 
o
f
 
C
M
30
Every condor machine needs a master
Like “
systemd
”, or “init”
Starts daemons, restarts crashed daemons
Tunes machine for condor
T
h
e
 
c
o
n
d
o
r
_
m
a
s
t
e
r
31
condor_master:  runs on all machine, always
condor_schedd: runs on submit machine
  condor_shadow: one per job
condor_startd:  runs on execute machine
   condor_starter: one per job
condor_negotiator/condor_collector
Q
u
i
c
k
 
R
e
v
i
e
w
 
o
f
 
D
a
e
m
o
n
s
32
P
r
o
c
e
s
s
 
V
i
e
w
33
c
ondor_master
   (pid: 1740)
c
ondor_schedd
c
ondor_shadow
c
ondor_shadow
c
ondor_shadow
“Condor Kernel”
“Condor Userspace”
fork/exec
fork/exec
condor_procd
c
ondor_q
c
ondor_submit
“Tools”
P
r
o
c
e
s
s
 
V
i
e
w
:
 
E
x
e
c
u
t
e
34
c
ondor_master
   (pid: 1740)
c
ondor_startd
c
ondor_starter
c
ondor_starter
c
ondor_starter
“Condor Kernel”
“Condor Userspace”
fork/exec
condor_procd
c
ondor_status -direct
“Tools”
Job
Job
Job
P
r
o
c
e
s
s
 
V
i
e
w
:
 
C
e
n
t
r
a
l
 
M
a
n
a
g
e
r
35
c
ondor_master
   (pid: 1740)
c
ondor_collector
“Condor Kernel”
fork/exec
condor_procd
condor_userprio
“Tools”
c
ondor_negotiator
 
C
o
n
d
o
r
 
I
n
s
t
a
l
l
a
t
i
o
n
 
B
a
s
i
c
s
36
Either with tarball
h
tar xvf htcondor-8.2.3-redhat6
Or native packages
wget
http://research.cs.wisc.edu/htcondor/yum/repo.d/h
tcondor-stable-rhel6.repo
get 
http://research.cs.wisc.edu/htcondor/yum/RPM-
GPG-KEY-HTCondor
rpm –import RPM_GPG-KEY-HTCondor
Yum install htcondor
L
e
t
s
 
I
n
s
t
a
l
l
 
H
T
C
o
n
d
o
r
37
Major.
minor
.release
h
If minor is even (a.
b
.c): Stable series
Very stable, mostly bug fixes
Current: 8.4
Examples: 8.2.5, 8.0.3
8.6.0 coming soon to a repo near you
h
If minor is odd (a.
b
.c): Developer series
New features, may have some bugs
Current: 8.5
Examples: 8.3.2,
8.5.5  almost released
V
e
r
s
i
o
n
 
N
u
m
b
e
r
 
S
c
h
e
m
e
38
All minor releases in a stable series
interoperate
h
E.g. can have pool with 8.4.0, 8.4.1, etc.
h
But not WITHIN A MACHINE:
Only across machines
The Reality
h
We work really hard to do better
8.4 with 8.2 with 8.5, etc.
Part of HTC ideal: can never upgrade in lock-step
T
h
e
 
G
u
a
r
a
n
t
e
e
39
h
t
t
p
:
/
/
h
t
c
o
n
d
o
r
p
r
o
j
e
c
t
.
o
r
g
40
First need to configure HTCondor
1100+ knobs and parameters!
Don’t need to set all of them…
L
e
t
s
 
M
a
k
e
 
a
 
P
o
o
l
41
BIN = /usr/bin
SBIN = /usr/sbin
LOG = /var/condor/log
SPOOL = /var/lib/condor/spool
EXECUTE = /var/lib/condor/execute
CONDOR_CONFIG =
/etc/condor/condor_config
D
e
f
a
u
l
t
 
f
i
l
e
 
l
o
c
a
t
i
o
n
s
42
(Almost)
all configure is in files, “root”
 
CONDOR_CONFIG env var
 
 
/etc/condor/condor_config
This file points to others
All daemons share same configuration
Might want to share between all machines
(NFS, automated copies, puppet, etc)
C
o
n
f
i
g
u
r
a
t
i
o
n
 
F
i
l
e
43
# I’m a comment!
CREATE_CORE_FILES
=TRUE
MAX_JOBS_RUNNING
 = 50
# HTCondor ignores case:
log
=/var/log/condor
# Long entries:
collector_host
=condor.cs.wisc.edu,\
    secondary.cs.wisc.edu
C
o
n
f
i
g
u
r
a
t
i
o
n
 
F
i
l
e
 
S
y
n
t
a
x
44
LOCAL_CONFIG_FILE
h
C
o
m
m
a
 
s
e
p
a
r
a
t
e
d
,
 
p
r
o
c
e
s
s
e
d
 
i
n
 
o
r
d
e
r
LOCAL_CONFIG_FILE = \
  /var/condor/config.local,\
/shared/condor/config.$(OPSYS)
LOCAL_CONFIG_DIR
h
Files processed IN LEXIGRAPHIC
ORDER
LOCAL_CONFIG_DIR = \
  /etc/condor/config.d
O
t
h
e
r
 
C
o
n
f
i
g
u
r
a
t
i
o
n
 
F
i
l
e
s
45
You reference other macros (settings) with:
h
A
 = $(B)
h
SCHEDD
 = $(SBIN)/condor_schedd
Can create additional macros for
organizational purposes
C
o
n
f
i
g
u
r
a
t
i
o
n
 
F
i
l
e
 
M
a
c
r
o
s
46
Can append to macros:
A
=abc
A
=$(A),def
Don’t let macros recursively define each
other!
A
=$(B)
B
=$(A)
C
o
n
f
i
g
u
r
a
t
i
o
n
 
F
i
l
e
 
M
a
c
r
o
s
47
Later macros in a file overwrite earlier ones
h
B will evaluate to 2:
A
=1
B
=$(A)
A
=2
C
o
n
f
i
g
u
r
a
t
i
o
n
 
F
i
l
e
 
M
a
c
r
o
s
48
CONDOR_CONFIG “root” config file:
h
/etc/condor/condor_config
Local config file:
h
/etc/condor/condor_config.local
Config directory
h
/etc/condor/config.d
C
o
n
f
i
g
 
f
i
l
e
 
d
e
f
a
u
l
t
s
49
For “system” condor, use default
h
Global config file read-only
/etc/condor/condor_config
h
All changes in config.d small snippets
/etc/condor/config.d/05some_example
h
All files begin with 2 digit numbers
Personal condors elsewhere
C
o
n
f
i
g
 
f
i
l
e
 
r
e
c
o
m
m
e
n
d
a
t
i
o
n
s
50
condor_config_val [-v] <KNOB_NAME>
h
Queries config files
condor_config_val -set name value
condor_config_val -dump
Environment overrides:
export _condor_KNOB_NAME=value
h
Trumps all others (so be careful)
c
o
n
d
o
r
_
c
o
n
f
i
g
_
v
a
l
51
Daemons long-lived
h
Only re-read config files condor_reconfig
command
h
Some knobs don’t obey re-config, require restart
DAEMON_LIST, NETWORK_INTERFACE
condor_restart
c
o
n
d
o
r
_
r
e
c
o
n
f
i
g
52
G
o
t
 
a
l
l
 
t
h
a
t
?
53
“Personal Condor”
h
All on one machine:
submit side IS execute side
h
Jobs always run
Use defaults where ever possible
Very handy for debugging and learning
L
e
t
s
 
m
a
k
e
 
a
 
p
o
o
l
!
54
Role
 
 
What daemons run on this machine
CONDOR_HOST
h
Where the central manager is
Security settings
h
Who can do what to whom?
M
i
n
i
m
u
m
 
k
n
o
b
 
s
e
t
t
i
n
g
s
55
LOG = /var/log/condor
 
Where daemons write debugging info
SPOOL = /var/spool/condor
 
Where the schedd stores jobs and data
EXECUTE = /var/condor/execute
 
Where the startd runs jobs
O
t
h
e
r
 
i
n
t
e
r
e
s
t
i
n
g
 
k
n
o
b
s
56
In 
/etc/condor/config.d/50PC.config
# All daemons local
Use ROLE : Personal
CONDOR_HOST = localhost
ALLOW_WRITE = localhost
M
i
n
i
m
u
m
 
k
n
o
b
s
 
f
o
r
 
p
e
r
s
o
n
a
l
C
o
n
d
o
r
57
D
o
e
s
 
i
t
 
W
o
r
k
?
58
$ condor_status
Error: communication error
CEDAR:6001:Failed to connect to <128.105.14.141:4210>
$ condor_submit
ERROR: Can't find address of local schedd
$ condor_q
Error:
Extra Info: You probably saw this error because the
condor_schedd is not running on the machine you are
trying to query…
C
h
e
c
k
i
n
g
59
$ ps auxww | grep [Cc]ondor
$
condor_master –f
service start condor
S
t
a
r
t
i
n
g
 
C
o
n
d
o
r
60
 
61
$ ps auxww | grep [Cc]ondor
$
condor
 
19534  50380          Ss   11:19   0:00 condor_master
root   19535  21692           S    11:19   0:00 condor_procd -A …
condor   19557  69656        Ss   11:19   0:00 condor_collector -f
condor   19559  51272        Ss   11:19   0:00 condor_startd -f
condor   19560  71012        Ss   11:19   0:00 condor_schedd -f
condor   19561  50888        Ss   11:19   0:00 condor_negotiator -f
         Notice the UID of the daemons
Q
u
i
c
k
 
t
e
s
t
 
t
o
 
s
e
e
 
i
t
 
w
o
r
k
s
62
$ condor_status
# Wait a few minutes…
$ condor_status
Name               OpSys      Arch   State     Activity LoadAv Mem
slot1@chevre.cs.wi LINUX      X86_64 Unclaimed Idle      0.190 20480
slot2@chevre.cs.wi LINUX      X86_64 Unclaimed Idle      0.000 20480
slot3@chevre.cs.wi LINUX      X86_64 Unclaimed Idle      0.000 20480
slot4@chevre.cs.wi LINUX      X86_64 Unclaimed Idle      0.000 20480
-bash-4.1$ condor_q
-- Submitter: gthain@chevre.cs.wisc.edu : <128.105.14.141:35019> :
chevre.cs.wisc.edu
 ID      OWNER            SUBMITTED     RUN_TIME ST PRI SIZE CMD
0 jobs; 0 completed, 0 removed, 0 idle, 0 running, 0 held, 0 suspended
$ condor_restart # just to be sure…
NUM_CPUS = X
h
How many cores condor thinks there are
MEMORY = M
h
How much memory (in Mb) there is
STARTD_CRON_...
h
Set of knobs to run scripts and insert attributes
into startd ad (See Manual for full details).
S
o
m
e
 
U
s
e
f
u
l
 
S
t
a
r
t
d
 
K
n
o
b
s
63
Each daemon logs mysterious info to file
$(LOG)/DaemonNameLog
Default:
h
/var/log/condor/SchedLog
h
/var/log/condor/MatchLog
h
/var/log/condor/StarterLog.slotX
Experts-only view of condor
B
r
i
e
f
 
D
i
v
e
r
s
i
o
n
 
i
n
t
o
 
d
a
e
m
o
n
 
l
o
g
s
64
Distributed machines makes it hard
h
Different policies on each machines
h
Different owners
h
Scale
L
e
t
s
 
m
a
k
e
 
a
 
r
e
a
l
 
p
o
o
l
65
Requirements:
h
No firewall
h
Full DNS everywhere (forward and backward)
h
We’ve got root on all machines
HTCondor doesn’t require any of these
h
(but easier with them)
M
o
s
t
 
S
i
m
p
l
e
 
D
i
s
t
r
i
b
u
t
e
d
 
P
o
o
l
66
Three Options (all require root):
h
Nobody UID
Safest from the machine’s perspective
h
The submitting User
Most useful from the user’s perspective
May be required if shared filesystem exists
h
A “Slot User”
Bespoke UID per slot
Good combination of isolation and utility
W
h
a
t
 
U
I
D
 
s
h
o
u
l
d
 
j
o
b
s
 
r
u
n
 
a
s
?
67
UID_DOMAIN = \
same_string_on_submit
TRUST_UID_DOMAIN = true
SOFT_UID_DOMAIN = true
If UID_DOMAINs match, jobs run as user,
otherwise “nobody”
U
I
D
_
D
O
M
A
I
N
 
S
E
T
T
I
N
G
S
68
SLOT1_USER = slot1
SLOT2_USER = slot2
STARTER_ALOW_RUNAS_OWNER = false
EXECUTE_LOGIN_IS_DEDICATED=true
Job will run as slotX Unix user
S
l
o
t
 
U
s
e
r
69
HTCondor can work with NFS
h
But how does it know what nodes have it?
WhenSubmitter & Execute nodes share
h
FILESYSTEM_DOMAIN 
values
e.g 
FILESYSTEM_DOMAIN = domain.name
Or, submit file can always transfer with
h
should_transfer_files = yes
If jobs always idle, first thing to check
F
I
L
E
S
Y
S
T
E
M
_
D
O
M
A
I
N
70
Central Manager
Execute Machine
Submit Machine
3
 
S
e
p
a
r
a
t
e
 
m
a
c
h
i
n
e
s
71
Use ROLE : CentralManager
CONDOR_HOST = cm.cs.wisc.edu
ALLOW_WRITE = *.cs.wisc.edu
# to use a non-default port
# default is 9618
#COLLECTOR_HOST=$(CONDOR_HOST):1234
# ^- set this for ALL machines…
C
e
n
t
r
a
l
 
M
a
n
a
g
e
r
72
Use ROLE : submit
CONDOR_HOST = cm.cs.wisc.edu
ALLOW_WRITE = *.cs.wisc.edu
UID_DOMAIN = cs.wisc.edu
FILESYSTEM_DOMAIN = cs.wisc.edu
S
u
b
m
i
t
 
M
a
c
h
i
n
e
73
Use ROLE : Execute
CONDOR_HOST = cm.cs.wisc.edu
ALLOW_WRITE = *.cs.wisc.edu
UID_DOMAIN = cs.wisc.edu
FILESYSTEM_DOMAIN = cs.wisc.edu
# default is
#FILESYSTEM_DOMAIN=$(FULL_HOSTNAME)
E
x
e
c
u
t
e
 
M
a
c
h
i
n
e
74
Does order matter?
h
Somewhat:  start CM first
How to check:
Every Daemon has classad in collector
h
condor_status -schedd
h
condor_status -negotiator
h
condor_status -any
N
o
w
 
S
t
a
r
t
 
t
h
e
m
 
a
l
l
 
u
p
75
c
o
n
d
o
r
_
s
t
a
t
u
s
 
-
a
n
y
76
MyType             TargetType         Name
Collector          None               Test 
Pool@cm.cs.wisc.edu
Negotiator         None               cm.cs.wisc.edu
DaemonMaster       None               cm.cs.wisc.edu
Scheduler          None               submit.cs.wisc.edu
DaemonMaster       None               submit.cs.wisc.edu
DaemonMaster       None               wn.cs.wisc.edu
Machine            Job                slot1@wn.cs.wisc.edu
Machine            Job                slot2@wn.cs.wisc.edu
Machine            Job                slot3@wn.cs.wisc.edu
Machine            Job                slot4@wn.cs.wisc.edu
condor_q / condor_status
condor_ping ALL –name machine
Or
condor_ping ALL –addr ‘<127.0.0.1:9618>’
D
e
b
u
g
g
i
n
g
 
t
h
e
 
p
o
o
l
77
Check userlog – may be preempted often
run condor_q -better-analyze job_id
W
h
a
t
 
i
f
 
a
 
j
o
b
 
i
s
 
a
l
w
a
y
s
 
i
d
l
e
?
78
 
W
h
e
w
!
79
condor_status –direct –schedd –
statistics 2
(all kinds of output), mostly aggregated
NumJobStarts, RecentJobStarts, etc.
See manual for full details
C
o
n
d
o
r
 
s
t
a
t
i
s
t
i
c
s
80
Most important statistic
Measures time not idle
If over 95%, daemon is probably saturated
D
a
e
m
o
n
C
o
r
e
D
u
t
y
C
y
c
l
e
81
SCHEDD_COLLECT_STATS_FOR_Gthain = (Owner==“gthain")
Schedd will maintain distinct sets of status
per owner, with name as prefix:
GthainJobsCompleted = 7
GthainJobsStarted = 100
D
i
s
a
g
g
r
e
g
a
t
e
d
 
s
t
a
t
s
82
SCHEDD_COLLECT_STATS_BY_Owner = Owner
F
o
r
 
a
l
l
 
o
w
n
e
r
s
,
 
c
o
l
l
e
c
t
 
&
 
p
u
b
l
i
s
h
 
s
t
a
t
s
:
gthainJobsStarted = 7
tannenbaJobsStarted = 100
E
v
e
n
 
b
e
t
t
e
r
83
HTCondor scales to 100,000s of machines
h
With a lot of work
h
Contact us, see wiki page
S
p
e
e
d
s
,
 
F
e
e
d
s
,
R
u
l
e
s
 
o
f
 
T
h
u
m
b
84
Your Mileage may vary:
h
Shared File System vs. File Transfer
h
WAN vs. LAN
h
Strong encryption vs none
h
Good autoclustering
A single schedd can run at 50 Hz
Schedd needs 500k RAM for running job
h
50k per idle jobs
Collector can hold tens of thousands of ads
W
i
t
h
o
u
t
 
H
e
r
o
i
c
s
:
85
Three kinds for submit and execute
-fast:
h
Kill all jobs immediate, and exit
-gracefull
h
Give all jobs 10 minutes to leave, then kill
-peaceful
h
Wait forever for all jobs to exit
c
o
n
d
o
r
_
o
f
f
86
http://htcondorproject.org
htcondor-users email list
Talk to us!
F
o
r
 
m
o
r
e
 
i
n
f
o
87
 
T
h
a
n
k
 
y
o
u
!
88
Slide Note
Embed
Share

Explore the basics of HTCondor administration, architecture overview, setting up personal and distributed Condor systems, key abstractions, job and machine life cycles, and interactions between submit and execute sides. Learn about the components like condor_schedd, condor_shadow, and how jobs are processed in the HTCondor environment.

  • HTCondor
  • Administration
  • Architecture
  • Jobs
  • Machines

Uploaded on Sep 23, 2024 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. HTCondor Administration Basics Greg Thain Center for High Throughput Computing

  2. Overview HTCondor Architecture Overview Configuration and other nightmares Setting up a personal condor Setting up distributed condor Minor topics 2

  3. Two Big HTCondor Abstractions Jobs Machines 3

  4. Life cycle of HTCondor Job Held Complete Running Xfer out Xfer In Idle Submit file Suspend History file 4

  5. Life cycle of HTCondor Machine collector negotiator schedd startd Schedd may split shadow Config file 5

  6. Submit Side Held Complete Running Xfer out Xfer In Idle Submit file Suspend Suspend Suspend History file 6

  7. Execute Side Held Complete Running Xfer out Xfer In Idle Submit file Suspend Suspend Suspend History file 7

  8. The submit side Submit side managed by 1 condor_schedd process And one shadow per running job condor_shadow process The Schedd is a database Submit points can be performance bottleneck Usually a handful per pool 8

  9. In the Beginning universe = vanilla executable = compute request_memory = 70M arguments = $(ProcID) should_transfer_input = yes output = out.$(ProcID) error = error.$(ProcId) +IsVerySpecialJob = true Queue HTCondor Submit file 9

  10. From submit to schedd JobUniverse = 5 Cmd = compute Args = 0 RequestMemory = 70000000 Requirements = Opsys == Li.. DiskUsage = 0 Output = out.0 IsVerySpecialJob = true condor_submit submit_file Submit file in, Job classad out Sends to schedd man condor_submit for full details Other ways to talk to schedd Python bindings, SOAP, wrappers (like DAGman) 10

  11. Condor_schedd holds all jobs JobUniverse = 5 Owner = gthain JobStatus = 1 NumJobStarts = 5 Cmd = compute Args = 0 RequestMemory = 70000000 Requirements = Opsys == Li.. DiskUsage = 0 Output = out.0 IsVerySpecialJob = true One pool, Many schedds condor_submit name chooses Owner Attribute: need authentication Schedd also called q not actually a queue 11

  12. Condor_schedd has all jobs In memory (big) condor_q expensive And on disk Fsync s often Monitor with linux Attributes in manual condor_q -l job.id e.g. condor_q -l 5.0 JobUniverse = 5 Owner = gthain JobStatus = 1 NumJobStarts = 5 Cmd = compute Args = 0 RequestMemory = 70000000 Requirements = Opsys == Li.. DiskUsage = 0 Output = out.0 IsVerySpecialJob = true 12

  13. What if I dont like those Attributes? Write a wrapper to condor_submit SUBMIT_ATTRS condor_qedit 13

  14. ClassAds: The lingua franca of HTCondor 14

  15. What are ClassAds? ClassAds is a language for objects (jobs and machines) to Express attributes about themselves Express what they require/desire in a match (similar to personal classified ads) Structure : Set of attribute name/value pairs, where the value can be a literal or an expression. Semi-structured, no fixed schema. 15

  16. Example Buyer Ad AcctBalance = 100 DogLover = True Requirements = (Type == Dog ) && (TARGET.Price <= MY.AcctBalance) && ( Size == "Large" || Size == "Very Large" ) Rank = 100* (Breed == "Saint Bernard") - Price . . . Pet Ad Type = Dog Requirements = DogLover =?= True Color = Brown Price = 75 Sex = "Male" AgeWeeks = 8 Breed = "Saint Bernard" Size = "Very Large" Weight = 27 16

  17. ClassAd Values Literals Strings ( RedHat6 ), integers, floats, boolean (true/false), Expressions Similar look to C/C++ or Java : operators, references, functions References: to other attributes in the same ad, or attributes in an ad that is a candidate for a match Operators: +, -, *, /, <, <=,>, >=, ==, !=, &&, and || all work as expected Built-in Functions: if/then/else, string manipulation, regular expression pattern matching, list operations, dates, randomization, math (ceil, floor, quantize, ), time functions, eval, 17 17

  18. Four-valued logic ClassAd Boolean expressions can return four values: True False Undefined (a reference can t be found) Error (Can t be evaluated) Undefined enables explicit policy statements in the absence of data (common across administrative domains) Special meta-equals ( =?= ) and meta-not-equals (=!=) will never return Undefined [ HasBeer = True GoodPub1 = HasBeer == True GoodPub2 = HasBeer =?= True ] [ GoodPub1 = HasBeer == True GoodPub2 = HasBeer =?= True ]

  19. ClassAd Types HTCondor has many types of ClassAds A "Job Ad" represents a job to Condor A "Machine Ad" represents a computing resource Others types of ads represent other instances of other services (daemons), users, accounting records. 19

  20. The Magic of Matchmaking Two ClassAds can be matched via special attributes: Requirements and Rank Two ads match if both their Requirements expressions evaluate to True Rank evaluates to a float where higher is preferred; specifies the which match is desired if several ads meet the Requirements. Scoping of attribute references when matching MY.name Value for attribute name in local ClassAd TARGET.name Value for attribute name in match candidate ClassAd Name Looks for name in the local ClassAd, then the candidate ClassAd 20

  21. Example Buyer Ad AcctBalance = 100 DogLover = True Requirements = (Type == Dog ) && (TARGET.Price <= MY.AcctBalance) && ( Size == "Large" || Size == "Very Large" ) Rank = 100* (Breed == "Saint Bernard") - Price . . . Pet Ad Type = Dog Requirements = DogLover =?= True Color = Brown Price = 75 Sex = "Male" AgeWeeks = 8 Breed = "Saint Bernard" Size = "Very Large" Weight = 27 21

  22. Back to configuration 22

  23. Configuration of Submit side Not much policy to be configured in schedd Mainly scalability and security MAX_JOBS_RUNNING JOB_START_DELAY MAX_CONCURRENT_DOWNLOADS MAX_JOBS_SUBMITTED 23

  24. The Execute Side Primarily managed by condor_startd process With one condor_starter per running jobs Sandboxes the jobs Usually many per pool (support 10s of thousands) 24

  25. Startd also has a classad Condor makes it up From interrogating the machine And the config file And sends it to the collector condor_status [-l] Shows the ad condor_status direct daemon Goes to the startd 25

  26. Condor_status l machine OpSys = "LINUX CustomGregAttribute = BLUE OpSysAndVer = "RedHat6" TotalDisk = 12349004 Requirements = ( START ) UidDomain = cheesee.cs.wisc.edu" Arch = "X86_64" StartdIpAddr = "<128.105.14.141:36713>" RecentDaemonCoreDutyCycle = 0.000021 Disk = 12349004 Name = "slot1@chevre.cs.wisc.edu" State = "Unclaimed" Start = true Cpus = 32 Memory = 81920 26

  27. One Startd, Many slots HTCondor treats multicore as independent slots Start can be configured to: Only run jobs based on machine state Only run jobs based on other jobs running Preempt or Evict jobs based on policy A whole talk just on this 27

  28. Configuration of startd Mostly policy, whole talk on that Several directory parameters EXECUTE where the sandbox is CLAIM_WORKLIFE How long to reuse a claim for different jobs 28

  29. The Middle side There s also a Middle , the Central Manager: A condor_negotiator Provisions machines to schedds A condor_collector Central nameservice: like LDAP condor_status queries this Please don t call this Master node or head Not the bottleneck you may think: stateless 29

  30. Responsibilities of CM Pool-wide scheduling policy resides here Scheduling of one user vs another Definition of groups of users Definition of preemption 30

  31. The condor_master Every condor machine needs a master Like systemd , or init Starts daemons, restarts crashed daemons Tunes machine for condor 31

  32. Quick Review of Daemons condor_master: runs on all machine, always condor_schedd: runs on submit machine condor_shadow: one per job condor_startd: runs on execute machine condor_starter: one per job condor_negotiator/condor_collector 32

  33. Process View condor_master (pid: 1740) condor_procd fork/exec Condor Kernel condor_schedd condor_q condor_submit Tools fork/exec condor_shadow condor_shadow condor_shadow Condor Userspace 33

  34. Process View: Execute condor_master (pid: 1740) condor_procd fork/exec Condor Kernel condor_startd condor_status -direct Tools condor_starter condor_starter condor_starter Condor Userspace Job Job Job 34

  35. Process View: Central Manager condor_master (pid: 1740) Condor Kernel condor_procd fork/exec condor_collector condor_negotiator condor_userprio Tools 35

  36. Condor Installation Basics 36

  37. Lets Install HTCondor Either with tarball tar xvf htcondor-8.2.3-redhat6 Or native packages wget http://research.cs.wisc.edu/htcondor/yum/repo.d/h tcondor-stable-rhel6.repo get http://research.cs.wisc.edu/htcondor/yum/RPM- GPG-KEY-HTCondor rpm import RPM_GPG-KEY-HTCondor Yum install htcondor 37

  38. Version Number Scheme Major.minor.release If minor is even (a.b.c): Stable series Very stable, mostly bug fixes Current: 8.4 Examples: 8.2.5, 8.0.3 8.6.0 coming soon to a repo near you If minor is odd (a.b.c): Developer series New features, may have some bugs Current: 8.5 Examples: 8.3.2, 8.5.5 almost released 38

  39. The Guarantee All minor releases in a stable series interoperate E.g. can have pool with 8.4.0, 8.4.1, etc. But not WITHIN A MACHINE: Only across machines The Reality We work really hard to do better 8.4 with 8.2 with 8.5, etc. Part of HTC ideal: can never upgrade in lock-step 39

  40. http://htcondorproject.org 40

  41. Lets Make a Pool First need to configure HTCondor 1100+ knobs and parameters! Don t need to set all of them 41

  42. Default file locations BIN = /usr/bin SBIN = /usr/sbin LOG = /var/condor/log SPOOL = /var/lib/condor/spool EXECUTE = /var/lib/condor/execute CONDOR_CONFIG = /etc/condor/condor_config 42

  43. Configuration File (Almost)all configure is in files, root CONDOR_CONFIG env var /etc/condor/condor_config This file points to others All daemons share same configuration Might want to share between all machines (NFS, automated copies, puppet, etc) 43

  44. Configuration File Syntax # I m a comment! CREATE_CORE_FILES=TRUE MAX_JOBS_RUNNING = 50 # HTCondor ignores case: log=/var/log/condor # Long entries: collector_host=condor.cs.wisc.edu,\ secondary.cs.wisc.edu 44

  45. Other Configuration Files LOCAL_CONFIG_FILE Comma separated, processed in order LOCAL_CONFIG_FILE = \ /var/condor/config.local,\ /shared/condor/config.$(OPSYS) LOCAL_CONFIG_DIR Files processed IN LEXIGRAPHIC ORDER LOCAL_CONFIG_DIR = \ /etc/condor/config.d 45

  46. Configuration File Macros You reference other macros (settings) with: A = $(B) SCHEDD = $(SBIN)/condor_schedd Can create additional macros for organizational purposes 46

  47. Configuration File Macros Can append to macros: A=abc A=$(A),def Don t let macros recursively define each other! A=$(B) B=$(A) 47

  48. Configuration File Macros Later macros in a file overwrite earlier ones B will evaluate to 2: A=1 B=$(A) A=2 48

  49. Config file defaults CONDOR_CONFIG root config file: /etc/condor/condor_config Local config file: /etc/condor/condor_config.local Config directory /etc/condor/config.d 49

  50. Config file recommendations For system condor, use default Global config file read-only /etc/condor/condor_config All changes in config.d small snippets /etc/condor/config.d/05some_example All files begin with 2 digit numbers Personal condors elsewhere 50

More Related Content

giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#