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

Re: [HTCondor-users] variation on HAS_MY_SOFTWARE classad parameter setup



Yes. As of HTCondor 8.2.x you can do this.  The 8.2.x and late config parser supports include scripts.

Include : $(LIBEXEC)/test_for_my_software.sh |

The trailing | tells the include statement that test_for_my_software.sh is an executable.   The script should write
to stdout  statements in config syntax.   So it might be something like

#!/bin/sh
if [ -e my_software ]; then echo MY_SOFTWARE=true; fi

Note that this script will run *every* time that a HTCondor daemon starts or reconfigs, and also whenever a condor tool
such as condor_status or condor_submit executes.  With tools The current directory can vary so the path to the script must be absolute.

You can have the script execute only when the startd is parsing the config, by wrapping it in a if/else config statements.

if $(IsStartd)
  Include : $(LIBEXEC)/test_for_my_software.sh |
endif

But be aware, if you do this, the script will not execute when you run condor_config_val unless you use the -subsystem argument
to condor_config_val so that it reads the config as if it were the startd.

Run these commands to see what I mean.

condor_config_val -dump ^Is ^My

condor_config_val -subsystem startd -dump ^Is ^My

-tj

On 7/2/2015 11:00 AM, Mary Romelfanger wrote:
Hi,

This is a follow on question to a discussion that we had with a couple of you guys at the conference.

We would like to add a local variation of a HAS_MY_SOFTWARE parameter to our local configuration files, so that we can use the matching Requirements = statement in our submit files.

The question is — we are using virtual machines that come and go, and software that occasionally moves from one virtual machine to a different machine, and with that we currently have just two condor_config.local files that we create links to as we install HTCondor on a machine.   In this case the software is one of our side packages and is typically only running on one machine.  The jobs that need that package need to be directed to that one machine.

Is there any way to put a test into the condor_config.local file to test to see if the software is running on that machine so set HAS_MY_SOFTWARE = True?
   I was envisioning something like testing if a file exists?      But I am not finding any if options in the config file?

And if this is not possible I am open to any suggestions for any other way to add this classed parameter other than creating another set of condor_config.local files and then having a more complex installation decision tree for the HTCondor installer.     I really would prefer a solution that tests the machine and finds the one that has the software running when HTCondor is started.

Mary Romelfanger
Sr. Systems Software Engineer
.___.      
{o,o}      Phone 410-338-6708
/)__)     Cell      443-244-0191
-"-"-          mary@xxxxxxxxx

Space Telescope Science Institute
3700 San Martin Drive
Baltimore, MD 21218



_______________________________________________
HTCondor-users mailing list
To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
subject: Unsubscribe
You can also unsubscribe by visiting
https://lists.cs.wisc.edu/mailman/listinfo/htcondor-users

The archives can be found at:
https://lists.cs.wisc.edu/archive/htcondor-users/