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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Rafael Monnerat
slapos
Commits
b600c614
Commit
b600c614
authored
Jan 10, 2013
by
Alain Takoudjou
Committed by
Cédric de Saint Martin
Feb 11, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BonjourGrid: Setup condor instance
parent
332ccd39
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
17 deletions
+48
-17
slapos/recipe/bonjourgrid/__init__.py
slapos/recipe/bonjourgrid/__init__.py
+2
-2
slapos/recipe/bonjourgrid/condor.py
slapos/recipe/bonjourgrid/condor.py
+37
-8
slapos/recipe/condor/__init__.py
slapos/recipe/condor/__init__.py
+6
-4
software/bonjourgrid-client/bonjourgrid-instance.cfg
software/bonjourgrid-client/bonjourgrid-instance.cfg
+2
-2
software/bonjourgrid-client/software.cfg
software/bonjourgrid-client/software.cfg
+1
-1
No files found.
slapos/recipe/bonjourgrid/__init__.py
View file @
b600c614
...
...
@@ -147,8 +147,8 @@ class Client(GenericBaseRecipe):
condor_wrapper
=
self
.
createPythonScript
(
condor_script
,
'%s.condor.runCondor'
%
__name__
,
dict
(
ipv6
=
self
.
options
[
'ipv6'
].
strip
(),
condor_
host
=
self
.
options
[
'condor_host
'
].
strip
(),
co
llector_name
=
self
.
options
[
'collector_name
'
].
strip
(),
condor_
bin
=
self
.
options
[
'condor_bin
'
].
strip
(),
co
ndor_sbin
=
self
.
options
[
'condor_sbin
'
].
strip
(),
condor_wrapper
=
self
.
options
[
'condor_wrapper'
].
strip
(),
condor_config
=
self
.
options
[
'condor_config'
].
strip
(),
condor_config_local
=
self
.
options
[
'condor_config_local'
].
strip
(),
...
...
slapos/recipe/bonjourgrid/condor.py
View file @
b600c614
...
...
@@ -6,15 +6,44 @@ import re
import
subprocess
import
time
def
startProcess
(
launch_args
,
env
=
None
,
cwd
=
None
,
stdout
=
subprocess
.
PIPE
):
process
=
subprocess
.
Popen
(
launch_args
,
stdout
=
stdout
,
stderr
=
subprocess
.
STDOUT
,
env
=
env
,
cwd
=
cwd
)
result
=
process
.
communicate
()[
0
]
if
process
.
returncode
is
None
or
process
.
returncode
!=
0
:
raise
NameError
(
"Failed to execute executable.
\
n
The error was: %s"
%
result
)
def
writeFile
(
file
,
content
):
f
=
open
(
file
,
'w'
)
f
.
write
(
content
)
f
.
close
()
def
updateCondorConfig
(
path
,
path_local
,
hostname
,
ipv6
):
"""Replace Static information into condor_config and condor_config.local files"""
#replace condor host into condor_config
text
=
open
(
path
,
'r'
).
read
()
text
=
re
.
sub
(
r'\
[%s
\]'
%
ipv6
,
hostname
,
text
,
flags
=
re
.
IGNORECASE
)
writeFile
(
path
,
text
)
#replace condor host into condor_config.local
text
=
open
(
path_local
,
'r'
).
read
()
text
=
re
.
sub
(
r'\
[%s
\]'
%
ipv6
,
hostname
,
text
,
flags
=
re
.
IGNORECASE
)
writeFile
(
path_local
,
text
)
def
updateCondorWrapper
(
folder
,
hostname
,
ipv6
):
"""Replace slapos generated value by the true value"""
for
file
in
os
.
listdir
(
folder
):
path
=
os
.
path
.
join
(
folder
,
file
)
if
os
.
path
.
exists
(
path
)
and
not
os
.
path
.
isdir
(
path
):
text
=
re
.
sub
(
r'\
[%s
\]'
%
ipv6
,
hostname
,
open
(
path
,
'r'
).
read
(),
flags
=
re
.
IGNORECASE
)
writeFile
(
path
,
text
)
def
runCondor
(
config
):
if
len
(
sys
.
argv
)
<
2
:
print
"Argument Error: uses %s hostname
projectname
"
%
sys
.
argv
[
0
]
print
"Argument Error: uses %s hostname"
%
sys
.
argv
[
0
]
exit
(
1
)
hostname
=
sys
.
argv
[
1
]
updateCondorConfig
(
config
[
'condor_config'
],
config
[
'condor_config_local'
],
hostname
,
config
[
'ipv6'
])
updateCondorWrapper
(
config
[
'condor_bin'
],
hostname
,
config
[
'ipv6'
])
updateCondorWrapper
(
config
[
'condor_sbin'
],
hostname
,
config
[
'ipv6'
])
#launch Boinc Client
condor
=
subprocess
.
Popen
([
config
[
'condor_wrapper'
]],
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
)
condor
.
wait
()
slapos/recipe/condor/__init__.py
View file @
b600c614
...
...
@@ -93,8 +93,8 @@ class Recipe(GenericBaseRecipe):
self
.
role
=
"manager,submit"
elif
self
.
options
[
'machine-role'
].
strip
()
==
"worker"
:
self
.
role
=
"execute"
install_args
+=
[
'--central-manager='
+
self
.
condor_host
,
'--type='
+
self
.
role
]
install_args
+=
[
'--central-manager='
+
self
.
condor_host
]
install_args
+=
[
'--type='
+
self
.
role
]
configure
=
subprocess
.
Popen
(
install_args
,
env
=
self
.
environ
,
stdout
=
subprocess
.
PIPE
)
configure
.
communicate
()[
0
]
...
...
@@ -144,10 +144,11 @@ class Recipe(GenericBaseRecipe):
export CONDOR_LOCATION=%s
export CONDOR_IDS=%s
export HOME=%s
export HOSTNAME=%s
exec %s $*"""
%
(
self
.
dash
,
self
.
environ
[
'LD_LIBRARY_PATH'
],
self
.
environ
[
'PATH'
],
condor_config
,
self
.
prefix
,
slapuser
,
self
.
environ
[
'HOME'
],
current_exe
)
self
.
environ
[
'HOSTNAME'
],
current_exe
)
wrapper
.
write
(
content
)
wrapper
.
close
()
path_list
.
append
(
wrapper_location
)
...
...
@@ -165,10 +166,11 @@ class Recipe(GenericBaseRecipe):
export CONDOR_LOCATION=%s
export CONDOR_IDS=%s
export HOME=%s
export HOSTNAME=%s
exec %s $*"""
%
(
self
.
dash
,
self
.
environ
[
'LD_LIBRARY_PATH'
],
self
.
environ
[
'PATH'
],
condor_config
,
self
.
prefix
,
slapuser
,
self
.
environ
[
'HOME'
],
current_exe
)
self
.
environ
[
'HOSTNAME'
],
current_exe
)
wrapper
.
write
(
content
)
wrapper
.
close
()
path_list
.
append
(
wrapper_location
)
...
...
software/bonjourgrid-client/bonjourgrid-instance.cfg
View file @
b600c614
...
...
@@ -54,8 +54,8 @@ redis-port = $${slap-parameter:server-port}
#Boinc and Condor parameters
ipv6 = $${slap-network-information:global-ipv6}
email = $${slap-parameter:user-email}
condor_
host = $${condor:condor_host
}
co
llector_name = $${condor:collector_name
}
condor_
sbin = $${condor:sbin
}
co
ndor_bin = $${condor:bin
}
boinc_wrapper = $${boinc-client:client-wrapper}
condor_wrapper = $${condor:wrapper-dir}/start_condor
boinc_cmd = $${boinc-client:cmd-bin}
...
...
software/bonjourgrid-client/software.cfg
View file @
b600c614
...
...
@@ -28,7 +28,7 @@ recipe = slapos.recipe.template
url = ${:_profile_base_location_}/bonjourgrid-instance.cfg
output = ${buildout:directory}/template-bonjourgrid.cfg
mode = 0644
md5sum =
3d470d742a690a2959d376f4d978d407
md5sum =
59b55246b2813bc162f528734132df02
[bonjourgrid]
recipe = hexagonit.recipe.download
...
...
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