How to Add Automatic Job Requirements

Known to work with HTCondor version: 7.0

To have some jobs preferentially run on some machines instead of others, see How to steer jobs towards more desirable machines. To require that specific jobs run on certain machines and not on others, read on.

A user can specify within the job's requirements in the submit description file that the job must run on a specific machine.

requirements = Machine == ""

As an alternative, the administrator may add requirements in the configuration file. These requirements are automatically inserted for every job. For example, suppose that jobs from the special user "appinstaller" are to always run on a specific and reserved machine. The administrator may set that up with the following configuration on the submit machine:

APPEND_REQUIREMENTS = MY.Owner != "appinstaller" || TARGET.IsAppInstallerMachine =?= True

Then, in the local configuration file of the specific and reserved machine, add the following:

IsAppInstallerMachine = True
STARTD_ATTRS = $(STARTD_ATTRS) IsAppInstallerMachine

With this configuration, user "appinstaller" jobs will only run on the correct machine(s). If only jobs from "appinstaller" are to run on the specific machine, then the administrator also modifies the configuration such that this machine only starts jobs from the desired owner:

START = ($(START)) && TARGET.Owner == "appinstaller"

Instead of altering the configuration to modify APPEND_REQUIREMENTS for each and every job's requirements (harmlessly in this example), the administrator may modify the user's login environment. HTCondor configuration is also read from the environment by tools such as condor_submit. User "appinstaller" changes the environment with:

  'MY.Owner != "appinstaller" || TARGET.IsAppInstallerMachine =?= True'

Note that this overrides any use of APPEND_REQUIREMENTS within the configuration file.

If it is the case the administrator does not control the configuration of the submit machine, none of the above options can work. In that case, do things the ugly way: modify all potential execute machines to reject jobs from user "appinstaller", except for the machines that should accept the jobs.