Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Matevz Golob
slapos
Commits
330c3b77
Commit
330c3b77
authored
Oct 26, 2012
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reconfigure condor worker
parent
402899ef
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
20 deletions
+14
-20
slapos/recipe/condor/__init__.py
slapos/recipe/condor/__init__.py
+10
-15
slapos/recipe/condor/configure.py
slapos/recipe/condor/configure.py
+2
-2
slapos/recipe/condor/template/condor_config.generic
slapos/recipe/condor/template/condor_config.generic
+1
-1
software/condor/instance-condor.cfg
software/condor/instance-condor.cfg
+0
-1
software/condor/software.cfg
software/condor/software.cfg
+1
-1
No files found.
slapos/recipe/condor/__init__.py
View file @
330c3b77
...
@@ -74,7 +74,6 @@ class Recipe(GenericBaseRecipe):
...
@@ -74,7 +74,6 @@ class Recipe(GenericBaseRecipe):
self
.
ipv6
=
options
[
'ip'
].
strip
()
self
.
ipv6
=
options
[
'ip'
].
strip
()
self
.
condor_host
=
options
[
'condor_host'
].
strip
()
self
.
condor_host
=
options
[
'condor_host'
].
strip
()
self
.
collector
=
options
[
'collector_name'
].
strip
()
self
.
collector
=
options
[
'collector_name'
].
strip
()
self
.
centralhost
=
self
.
options
[
'central-host'
].
strip
()
def
install
(
self
):
def
install
(
self
):
path_list
=
[]
path_list
=
[]
...
@@ -91,10 +90,8 @@ class Recipe(GenericBaseRecipe):
...
@@ -91,10 +90,8 @@ class Recipe(GenericBaseRecipe):
if
self
.
options
[
'machine-role'
].
strip
()
==
"manager"
:
if
self
.
options
[
'machine-role'
].
strip
()
==
"manager"
:
self
.
role
=
"manager,submit"
self
.
role
=
"manager,submit"
elif
self
.
options
[
'machine-role'
].
strip
()
==
"worker"
:
elif
self
.
options
[
'machine-role'
].
strip
()
==
"worker"
:
if
not
self
.
centralhost
:
raise
Exception
(
"ERROR: Cannot deploy condor worker without specify the central manager"
)
self
.
role
=
"execute"
self
.
role
=
"execute"
install_args
+=
[
'--central-manager='
+
self
.
c
entral
host
,
install_args
+=
[
'--central-manager='
+
self
.
c
ondor_
host
,
'--type='
+
self
.
role
]
'--type='
+
self
.
role
]
configure
=
subprocess
.
Popen
(
install_args
,
env
=
self
.
environ
,
configure
=
subprocess
.
Popen
(
install_args
,
env
=
self
.
environ
,
stdout
=
subprocess
.
PIPE
)
stdout
=
subprocess
.
PIPE
)
...
@@ -115,13 +112,15 @@ class Recipe(GenericBaseRecipe):
...
@@ -115,13 +112,15 @@ class Recipe(GenericBaseRecipe):
self
.
substituteTemplate
(
self
.
getTemplateFilename
(
'condor_config.generic'
),
self
.
substituteTemplate
(
self
.
getTemplateFilename
(
'condor_config.generic'
),
condor_configure
))
condor_configure
))
path_list
.
append
(
config
)
path_list
.
append
(
config
)
#update condor_config.local
with
open
(
config_local
,
'a'
)
as
f
:
f
.
write
(
"
\
n
START = TRUE"
)
#create condor binary launcher for slapos
#create condor binary launcher for slapos
if
not
os
.
path
.
exists
(
self
.
wrapper_bin
):
if
not
os
.
path
.
exists
(
self
.
wrapper_bin
):
os
.
makedirs
(
self
.
wrapper_bin
,
int
(
'0744'
,
8
))
os
.
makedirs
(
self
.
wrapper_bin
,
int
(
'0744'
,
8
))
if
not
os
.
path
.
exists
(
self
.
wrapper_sbin
):
if
not
os
.
path
.
exists
(
self
.
wrapper_sbin
):
os
.
makedirs
(
self
.
wrapper_sbin
,
int
(
'0744'
,
8
))
os
.
makedirs
(
self
.
wrapper_sbin
,
int
(
'0744'
,
8
))
#self.path = wrapper_bin+":"+wrapper_sbin+":"+self.path
#generate script for each file in prefix/bin
#generate script for each file in prefix/bin
for
binary
in
os
.
listdir
(
self
.
prefix
+
'/bin'
):
for
binary
in
os
.
listdir
(
self
.
prefix
+
'/bin'
):
wrapper_location
=
os
.
path
.
join
(
self
.
wrapper_bin
,
binary
)
wrapper_location
=
os
.
path
.
join
(
self
.
wrapper_bin
,
binary
)
...
@@ -172,15 +171,11 @@ class Recipe(GenericBaseRecipe):
...
@@ -172,15 +171,11 @@ class Recipe(GenericBaseRecipe):
#generate script for start condor
#generate script for start condor
start_condor
=
os
.
path
.
join
(
self
.
wrapperdir
,
'start_condor'
)
start_condor
=
os
.
path
.
join
(
self
.
wrapperdir
,
'start_condor'
)
#if self.role == "manager,submit":
# binary = os.path.join(self.wrapper_sbin, 'condor_master')
#elif self.role == "execute":
# binary = os.path.join(self.wrapper_bin, 'condor_run')
start_bin
=
os
.
path
.
join
(
self
.
wrapper_sbin
,
'condor_master'
)
start_bin
=
os
.
path
.
join
(
self
.
wrapper_sbin
,
'condor_master'
)
condor_
status
=
os
.
path
.
join
(
self
.
wrapper_bin
,
'condor_status
'
)
condor_
reconfig
=
os
.
path
.
join
(
self
.
wrapper_sbin
,
'condor_reconfig
'
)
wrapper
=
self
.
createPythonScript
(
start_condor
,
wrapper
=
self
.
createPythonScript
(
start_condor
,
'%s.configure.condorStart'
%
__name__
,
'%s.configure.condorStart'
%
__name__
,
dict
(
start_bin
=
start_bin
,
condor_
status
=
condor_status
)
dict
(
start_bin
=
start_bin
,
condor_
reconfig
=
condor_reconfig
)
)
)
path_list
.
append
(
wrapper
)
path_list
.
append
(
wrapper
)
return
path_list
return
path_list
...
@@ -228,9 +223,9 @@ class AppSubmit(GenericBaseRecipe):
...
@@ -228,9 +223,9 @@ class AppSubmit(GenericBaseRecipe):
if
value
and
(
value
.
startswith
(
'http'
)
or
value
.
startswith
(
'ftp'
)):
if
value
and
(
value
.
startswith
(
'http'
)
or
value
.
startswith
(
'ftp'
)):
self
.
options
[
'name_'
+
pos
]
=
os
.
path
.
basename
(
urlparse
.
urlparse
(
value
)[
2
])
self
.
options
[
'name_'
+
pos
]
=
os
.
path
.
basename
(
urlparse
.
urlparse
(
value
)[
2
])
self
.
options
[
'file_'
+
pos
]
=
self
.
download
(
value
)
self
.
options
[
'file_'
+
pos
]
=
self
.
download
(
value
)
os
.
chmod
(
self
.
options
[
'file_'
+
pos
],
0600
)
else
:
else
:
self
.
options
[
'file_'
+
pos
]
=
value
self
.
options
[
'file_'
+
pos
]
=
value
os
.
chmod
(
self
.
options
[
'file_'
+
pos
],
0600
)
executable
=
self
.
options
[
'executable'
]
executable
=
self
.
options
[
'executable'
]
if
executable
and
(
executable
.
startswith
(
'http'
)
or
executable
.
startswith
(
'ftp'
)):
if
executable
and
(
executable
.
startswith
(
'http'
)
or
executable
.
startswith
(
'ftp'
)):
self
.
options
[
'executable'
]
=
self
.
download
(
executable
,
self
.
options
[
'executable'
]
=
self
.
download
(
executable
,
...
@@ -245,7 +240,7 @@ class AppSubmit(GenericBaseRecipe):
...
@@ -245,7 +240,7 @@ class AppSubmit(GenericBaseRecipe):
path_list
=
[]
path_list
=
[]
#check if curent condor instance is an condor master
#check if curent condor instance is an condor master
if
self
.
options
[
'machine-role'
].
strip
()
!=
"manager"
:
if
self
.
options
[
'machine-role'
].
strip
()
!=
"manager"
:
print
"ERROR: cannot submit a job to
a worker condo
r instance"
print
"ERROR: cannot submit a job to
Condor worke
r instance"
return
[]
return
[]
#Setup directory
#Setup directory
jobdir
=
self
.
options
[
'job-dir'
].
strip
()
jobdir
=
self
.
options
[
'job-dir'
].
strip
()
...
...
slapos/recipe/condor/configure.py
View file @
330c3b77
...
@@ -48,8 +48,8 @@ def submitJob(args):
...
@@ -48,8 +48,8 @@ def submitJob(args):
def
condorStart
(
args
):
def
condorStart
(
args
):
"""Start Condor if deamons is currently stopped"""
"""Start Condor if deamons is currently stopped"""
result
=
os
.
system
(
args
[
'condor_
status
'
])
result
=
os
.
system
(
args
[
'condor_
reconfig
'
])
if
result
!=
0
:
if
result
!=
0
:
#process failled to re
start
that mean that condor deamons is not curently started
#process failled to re
config condor
that mean that condor deamons is not curently started
os
.
system
(
args
[
'start_bin'
])
os
.
system
(
args
[
'start_bin'
])
\ No newline at end of file
slapos/recipe/condor/template/condor_config.generic
View file @
330c3b77
...
@@ -223,7 +223,7 @@ ALLOW_READ = *
...
@@ -223,7 +223,7 @@ ALLOW_READ = *
## but note that this will allow anyone to submit jobs or add
## but note that this will allow anyone to submit jobs or add
## machines to your pool and is a serious security risk.
## machines to your pool and is a serious security risk.
ALLOW_WRITE = $(FULL_HOSTNAME), $(IP_ADDRESS)
ALLOW_WRITE = $(FULL_HOSTNAME), $(IP_ADDRESS)
, %(ipv6)s
#ALLOW_WRITE = *.your.domain, your-friend's-machine.other.domain
#ALLOW_WRITE = *.your.domain, your-friend's-machine.other.domain
#DENY_WRITE = bad-machine.your.domain
#DENY_WRITE = bad-machine.your.domain
...
...
software/condor/instance-condor.cfg
View file @
330c3b77
...
@@ -85,7 +85,6 @@ collector_name = SLAPOS-CONDOR-POOL
...
@@ -85,7 +85,6 @@ collector_name = SLAPOS-CONDOR-POOL
role
=
manager
role
=
manager
diskspace
=
5
diskspace
=
5
#
submit
application
#
submit
application
central
-
manager
=
app
-
name
=
condor_test
app
-
name
=
condor_test
description
-
file
=
${
description
-
file
:
location
}/${
description
-
file
:
filename
}
description
-
file
=
${
description
-
file
:
location
}/${
description
-
file
:
filename
}
executable
=
${
executable
:
location
}/${
executable
:
filename
}
executable
=
${
executable
:
location
}/${
executable
:
filename
}
...
...
software/condor/software.cfg
View file @
330c3b77
...
@@ -30,7 +30,7 @@ md5sum = 9e9db6f4c5e38ce3fd45d43c2bf616a8
...
@@ -30,7 +30,7 @@ md5sum = 9e9db6f4c5e38ce3fd45d43c2bf616a8
recipe = slapos.recipe.template
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-condor.cfg
url = ${:_profile_base_location_}/instance-condor.cfg
output = ${buildout:directory}/template-condor.cfg
output = ${buildout:directory}/template-condor.cfg
md5sum =
9df787cc62e2dc6741c2faf1b1e0f315
md5sum =
2a8a1eec88e960e5af3f121d019fc507
mode = 0644
mode = 0644
[description-file]
[description-file]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment