By default, any FireWorker can pull and run any FireWork. However, in some cases you might want to control which computing resources should run a FireWork. For example, if some of your FireWorks require a lot of memory and fast processors, you might want to direct those jobs to only a subset of FireWorkers that have sufficiently high computing specifications.
There are two methods to control where FireWorks are executed.
A simple method to direct FireWorks to FireWorks is by assigning categories. You can do this by:
Note
Recall the my_fworker.yaml file from the FireWorker tutorial. To set the FireWorker category, modify this file so that the category key is non-empty.
Once you’ve set these values, job execution occurs as follows:
And finally, a few final notes and limitations about this method:
A more flexible, but less intuitive method to restrict the FireWorks that a FireWorker through a raw MongoDB query. The query will restrict the FireWorker to only running FireWorks matching the query. For example, your query might specify that the spec.parameter1 is under 100. In this case, FireWorks with spec.parameter1 greater than 100 must be run elsewhere.
To set up a raw query:
Note
Recall the my_fworker.yaml file from the FireWorker tutorial. To set the FireWorker query, modify this file so that the query key is non-empty. An example of a query string in YAML format would be '{"spec.parameter1": {"$lte":100}}'
Note that if you set both a category and a query for a FireWorker, both constraints will be used.