Job selection policy
When running a node, you can choose which jobs you want to run by using configuration options, environment variables or flags to specify a job selection policy.
Config property |
| Default value | Meaning |
Node.Compute.JobSelection.Locality |
| Anywhere | Only accept jobs that reference data we have locally ("local") or anywhere ("anywhere"). |
Node.Compute.JobSelection.ProbeExec |
| unused | Use the result of an external program to decide if we should take on the job. |
Node.Compute.JobSelection.ProbeHttp |
| unused | Use the result of a HTTP POST to decide if we should take on the job. |
Node.Compute.JobSelection.RejectStatelessJobs |
| False | Reject jobs that don't specify any input data. |
Node.Compute.JobSelection.AcceptNetworkedJobs |
| False | Accept jobs that require network connections. |
Job selection probes
If you want more control over making the decision to take on jobs, you can use the --job-selection-probe-exec
and --job-selection-probe-http
flags.
These are external programs that are passed the following data structure so that they can make a decision about whether or not to take on a job:
The exec
probe is a script to run that will be given the job data on stdin
, and must exit with status code 0 if the job should be run.
The http
probe is a URL to POST the job data to. The job will be rejected if the HTTP request returns a non-positive status code (e.g. >= 400).
If the HTTP response is a JSON blob, it should match the following schema and will be used to respond to the bid directly:
For example, the following response will reject the job:
If the HTTP response is not a JSON blob, the content is ignored and any non-error status code will accept the job.