Commit 4e507c48 authored by Alain Takoudjou's avatar Alain Takoudjou

Update Condor recipe, allow to submit jobs

parent 9d7e9520
......@@ -22,6 +22,6 @@ extends =
[condor]
recipe = hexagonit.recipe.download
url = http://parrot.cs.wisc.edu//symlink/20120818101503/7/7.8/7.8.1/1db87306f7222aa1cb500b4f59b479e8/condor-7.8.1-x86_64_deb_6.0-stripped.tar.gz
md5sum = 83020d420599948dfcbfc3f1f6b52a5e
url = http://vlwjcg.blu.livefilestore.com/y1m01nZ1F3tAe9NX0OCuAYMzhob7YmkIONHi3jrjYNwlfVjqlnWwBMmoYnIKJjJ-abKFFuai57-ffobcFlMKk7v7NmrSDvEcry2/condor-7.9.0-x86_64_deb_6.0-stripped.tar.gz?download&psid=1
md5sum = 630ce96e5c1172391febba2aa1bad8fc
strip-top-level-dir = true
......@@ -58,6 +58,7 @@ setup(name=name,
'cloud9 = slapos.recipe.cloud9:Recipe',
'cloudooo.test = slapos.recipe.erp5_test:CloudoooRecipe',
'condor = slapos.recipe.condor:Recipe',
'condor.submit = slapos.recipe.condor:AppSubmit',
'cron.d = slapos.recipe.dcron:Part',
'cron = slapos.recipe.dcron:Recipe',
'davstorage = slapos.recipe.davstorage:Recipe',
......
......@@ -138,7 +138,7 @@ class Recipe(GenericBaseRecipe):
with open(self.options['pid-file']) as pid_file:
pid = int(pid_file.read().strip(), 10)
try:
os.kill(pid, signal.SIGUSR1) # Graceful restart
os.kill(pid, signal.SIGHUP) #restart now
except OSError:
pass
return path_list
This diff is collapsed.
##############################################################################
#
# Copyright (c) 2010 Vifib SARL and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import os
import subprocess
import time
def submitJob(args):
"""Run condor_submit (if needed) for job deployment"""
time.sleep(10)
print "Check if needed to submit %s job's" % args['appname']
if not os.path.exists(args['sig_install']):
print "Nothing for install or update...Exited"
return
# '-a', "log = out.log", '-a', "error = error.log",
launch_args = [args['submit'], '-verbose', args['submit_file']]
process = subprocess.Popen(launch_args, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT, cwd=args['appdir'])
result = process.communicate()[0]
if process.returncode is None or process.returncode != 0:
print "Failed to execute condor_submit.\nThe error was: %s" % result
else:
os.unlink(args['sig_install'])
def condorStart(args):
"""Start Condor if deamons is currently stopped"""
result = os.system(args['restart_bin'])
if result != 0:
#process failled to restart that mean that condor deamons is not curently started
os.system(args['start_bin'])
\ No newline at end of file
......@@ -46,6 +46,9 @@
######################################################################
######################################################################
NO_DNS = True
DEFAULT_DOMAIN_NAME = %(domain_name)s
ENABLE_IPV6 = TRUE
## What machine is your central manager?
CONDOR_HOST = %(condor_host)s
##--------------------------------------------------------------------
......@@ -57,7 +60,7 @@ RELEASE_DIR = %(releasedir)s
## Where is the local condor directory for each host?
## This is where the local config file(s), logs and
## spool/execute directories are located
LOCAL_DIR = %(localdir)s
LOCAL_DIR = %(localdir)s
#LOCAL_DIR = $(RELEASE_DIR)/hosts/$(HOSTNAME)
## Where is the machine-specific local config file for each host?
......@@ -204,7 +207,7 @@ ALLOW_OWNER = $(FULL_HOSTNAME), $(ALLOW_ADMINISTRATOR)
## will be able to view the status of your pool and more easily help
## you install, configure or debug your Condor installation.
## It is important to have this defined.
ALLOW_READ = %(domain)s
ALLOW_READ = *
#ALLOW_READ = *.your.domain, *.cs.wisc.edu
#DENY_READ = *.bad.subnet, bad-machine.your.domain, 144.77.88.*
......@@ -322,7 +325,7 @@ ALLOW_READ_STARTD = $(ALLOW_READ), $(FLOCK_FROM)
##--------------------------------------------------------------------
## Do you want to use NFS for file access instead of remote system
## calls?
USE_NFS = True
#USE_NFS = False
## Do you want to use AFS for file access instead of remote system
## calls?
......
[buildout]
parts =
condor
app-submit
publish-connection-informations
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
#Enable download
newest = false
offline = false
# Create all needed directories
[rootdirectory]
......@@ -12,6 +16,7 @@ recipe = slapos.cookbook:mkdirectory
etc = $${buildout:directory}/etc/
var = $${buildout:directory}/var/
condor = $${buildout:directory}/condor/
job = $${buildout:directory}/jobs/
bin = $${buildout:directory}/bin/
sbin = $${buildout:directory}/sbin/
srv = $${buildout:directory}/srv/
......@@ -30,32 +35,60 @@ wrapper = $${basedirectory:run}/condor
[condor]
recipe = slapos.cookbook:condor
config_wrapper = $${basedirectory:services}/configure
wrapper-dir = $${basedirectory:services}
ip = $${slap-network-information:global-ipv6}
package = ${condor:location}
rootdirectory = $${buildout:directory}
local-dir = $${rootdirectory:condor}
job-dir = $${rootdirectory:job}
perl-bin = ${perl:location}/bin
java-bin = ${java:location}/bin
bin = $${wrapperdirectory:wrapper}/bin/
sbin = $${wrapperdirectory:wrapper}/sbin/
#additionnal LD_LIBRARY_PATH and PATH for all condor executable files
linkdir = ${libexpat:location}/lib:${kerberos:location}/lib:${openldap:location}/lib:${zlib:location}/lib
path = ${perl:location}/bin:${java:location}/bin:${kerberos:location}/bin:${openldap:location}/bin:$PATH
dash = ${dash:location}/bin/dash
environment =
LD_LIBRARY_PATH=${libexpat:location}/lib:${kerberos:location}/lib:${openldap:location}/lib:${zlib:location}/lib
PATH=${perl:location}/bin:${java:location}/bin:${kerberos:location}/bin:${openldap:location}/bin:%(PATH)s
HOME=$${rootdirectory:condor}
HOSTNAME=$${slap-parameter:host_manager_name}
#Condor user parameter
central-host = $${slap-parameter:central-manager}
condor_host = $${slap-parameter:host_manager_name}
domain = $${slap-parameter:domain}
collector_name = $${slap-parameter:collector_name}
#Condor machine role: worker=submit,execute manager=manager,submit
machine-role = $${slap-parameter:role}
disk-space = $${slap-parameter:diskspace}
[app-submit]
<= condor
recipe = slapos.cookbook:condor.submit
app-name = $${slap-parameter:app-name}
#user can specifie a list files to use in application, one per line
files = $${slap-parameter:files}
description-file = $${slap-parameter:description-file}
executable = $${slap-parameter:executable}
executable-name = $${slap-parameter:executable-name}
# Publish all instance parameters (url of instance)
[publish-connection-informations]
recipe = slapos.cookbook:publish
ipv6_address = $${condor:ip}
instance_type = $${condor:machine-role}
condor_host = $${condor:condor_host}
[slap-parameter]
# Default values if not specified
host_manager_name = [$${slap-network-information:global-ipv6}]
domain = *
collector_name = SLAPOS-CONDOR-POOL
role = worker
diskspace = 5
\ No newline at end of file
role = manager
diskspace = 5
#submit application
central-manager =
app-name = condor_test
description-file = ${description-file:location}/${description-file:filename}
executable = ${executable:location}/${executable:filename}
executable-name = ${executable:filename}
#user can specifie a list of input file, one per line
files =
[buildout]
develop =
/srv/slapgrid/slappart19/srv//runner/project/slapos.github
parts =
condor
instance-egg
template
template-condor
description-file
executable
extends =
../../component/condor/buildout.cfg
download-cache = ${buildout:directory}/cache
[template]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg
......@@ -25,8 +22,24 @@ md5sum = 9e9db6f4c5e38ce3fd45d43c2bf616a8
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-condor.cfg
output = ${buildout:directory}/template-condor.cfg
md5sum = d74e38da04650ad70a8c0e909ccd6be0
md5sum = 9df787cc62e2dc6741c2faf1b1e0f315
mode = 0644
[description-file]
recipe = slapos.recipe.download
mode = 0644
url = ${:_profile_base_location_}/template/submit
filename = submit
location = ${buildout:parts-directory}/${:_buildout_section_name_}
md5sum = 8180d88348b89b55216f8dd4475a9eea
[executable]
recipe = slapos.recipe.download
mode = 0644
url = ${:_profile_base_location_}/template/simple
filename = simple
location = ${buildout:parts-directory}/${:_buildout_section_name_}
md5sum = c512f495cdd112bceb04feab7c909a10
[instance-egg]
recipe = zc.recipe.egg
......
Universe = vanilla
Executable = simple
Arguments = 4 10
Log = simple.log
Output = simple.$(Process).out
Error = simple.$(Process).error
Queue
Arguments = 4 11
Queue
Arguments = 4 12
Queue
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment