[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Condor-users] do I have to use custom classad functions?



> I've been playing around with job submission policies in my 
> submit files and I have a few scenarios that I can't see a 
> way around except by using custom classad functions:
> 
> - I'd like to submit a job that will only go to those 
> machines that are also running some other application...for 
> instance, a daemon whose service my task would use.  The idea 
> is to make a "service-sensitive" policy.  I suppose I could 
> do this by writing a classad function but I don't have access 
> to the source code (yet).
> 
> - I'd like to submit a job that will only go to machines that 
> have a certain shared filesystem mounted.  Again, a classad 
> function might work...but I don't think I can do that (...can 
> I?  or do I really need the source code to add my own functions?)
> 
> Both of these could be done if I had the ability to run a 
> shell command and assign the output to an attribute in my 
> machine classad.  Is there a way to do this without getting 
> the source code and writing a new classad function?  Or has 
> someone written a classad function that I can use to do this? 
>  Are there libraries of contributed functions out there that 
> I might tap into?

Just let me make sure I'm understanding what you want here: you have
machines that have different shared file systems mounted on them. You
want to steer your jobs towards these machines. You also have machines
that are running (or just have installed/access) particular software
packages and you'd like your jobs to use only these machines.

Are these the two, not necessarily mutually exclusive, scenarios?

If they are the answer to your questions does not require source code
access to condor.

On the machines that have the certain FS or software installed you need
to tell the Condor world about this fact by creating custom ClassAd
attributes and advertising them in the startd ClassAds for the machines.

Lets say MachineA has one processor and has the /foo shared filesystem
mounted and the 'bar' software package installed. In the
condor_config.local file for this machine I would add two new classad
attributes (one for the filesystem, and one for the software package) by
addng the following lines:

	MySharedFilesystem = /foo
	MyHasBarSoftware = True

And to make sure my startd(s) for this machine had these attributes in
their classad advertisements:

	START_EXPRS = $(STARTD_EXPRS), MySharedFilesystem,
MyHasBarSoftware

And now, on my job side if I need the /foo filesystem AND the 'bar'
software package I would say in my submission ticket file:

	requirements = (MySharedFilesystem =?= "/foo") &&
(MyHasBarSoftware =?= True)

Now my job will only run on a machine that has those ClassAd attributes
advertised AND set to "/foo" and True.

If you wanted some sort of realtime monitoring and control over the
value of MySharedFilesystem and MyHasBarSoftware you have two options:

1) Take a look at the Hawkeye Monitoring tool;
2) Take a look at using condor_config_val in conjuncton with cron and
some glue like a Perl script.

Hope that helps.

- Ian