work_queue_factory(1)
π work_queue_factory β the manual, but make it make sense π
okay bestie, welcome to work_queue_factory(1), straight out of the Cooperative Computing Tools. this is the page that runs your little worker army on a batch system. sit down, hydrate, let's go β¨
πΈ SYNOPSIS πΈ
work_queue_factory -M <project-name> -T <batch-type> [options]
π¦ DESCRIPTION π¦
so basically, work_queue_factory submits and babysits a whole bunch of work_queue_worker(1) processes across all the batch systems you could ever want β think Condor, SGE, the whole roster. every worker under one work_queue_factory is pointed at one specific manager, or at any set of managers that match a given project name. and it doesn't just guess β it automatically figures out the right number of workers to have running, based on the criteria you set on the command line. it reconsiders that decision once per minute. iconic behavior, no notes.
by default, work_queue_factory runs as many workers as the indicated managers have tasks ready to run. got multiple managers? then it starts enough workers to satisfy their collective needs. fr fr, here's the math: if you have two managers with the same project name, each with 10 tasks to run, work_queue_factory starts 20 workers total. slay.
if the number of needed workers goes up, work_queue_factory submits more workers to meet the desired need. but β and this is important β it will not run more than a fixed maximum number of workers, and that max is set by the -W option.
if the need for workers drops, work_queue_factory does not remove them immediately. it waits for them to exit on their own. (that happens when the worker has been idle for a certain time.) and a minimum number of workers is maintained, set by the -w option. we keep a lil baseline, always. π
if you give it the -c option, then work_queue_factory will consider the capacity reported by each manager. capacity = the estimated number of workers that the manager thinks it can handle, based on the task execution and data transfer times currently observed at that manager. with -c on, work_queue_factory treats the manager's capacity as the maximum number of workers to run.
and if work_queue_factory receives a terminating signal, it will attempt to remove all running workers before exiting. clean exit, bestie, we don't leave mess.
β¨ OPTIONS β¨
π General options π
-Tβ batch system type, and it's required. pick one of:local,wq,condor,sge,pbs,lsf,torque,moab,mpi,slurm,chirp,amazon,amazon-batch,lambda,mesos,k8s,dryrun-Cβ use configuration file<file>.-Mβ project name of the managers to serve; can be a regex.-Fβ foremen to serve; can be a regular expression.--catalog=<host:port>β catalog server to query for managers.-Pβ password file for workers to authenticate.-Sβ use this scratch dir for the factory.- (default:)
/tmp/wq-factory-$uid
- (default:)
--run-factory-as-managerβ force the factory to run itself as a manager.--parent-deathβ exit if the parent process dies.-dβ enable debugging for this subsystem.-oβ send debugging to this file.-Oβ specify the size of the debug file.-vβ show the version string.-hβ show this screen.
π§ Concurrent control options π§
-wβ minimum workers running (default=5).-Wβ maximum workers running (default=100).--workers-per-cycleβ max number of new workers per 30s (default=5).-tβ workers abort after idle time (default=300).--factory-timeoutβ exit after no manager seen in<n>seconds.--tasks-per-workerβ average tasks per worker (default=one per core).-cβ use worker capacity reported by managers.
π Resource management options π
--cores=<n>β set the number of cores requested per worker.--gpus=<n>β set the number of GPUs requested per worker.--memory=<mb>β set the amount of memory (in MB) per worker.--disk=<mb>β set the amount of disk (in MB) per worker.--autosizeβ autosize worker to slot (Condor, Mesos, K8S).
π Worker environment options π
--env=<variable=value>β environment variable to add to worker.-Eβ extra options to give to worker.--worker-binary=<file>β alternate binary instead ofwork_queue_worker.--wrapperβ wrap factory with this command prefix.--wrapper-inputβ add this input file needed by the wrapper.--runos=<img>β userunostool to create environment (ND only).--python-packageβ run each worker inside this python package.
π Options specific to batch systems π
-Bβ generic batch system options.--amazon-configβ specify Amazon config file.--condor-requirementsβ set requirements for the workers as Condor jobs.--mesos-masterβ host name of mesos manager node.--mesos-pathβ path to mesos python library.--mesos-preloadβ libraries for running mesos.--k8s-imageβ container image for Kubernetes.--k8s-worker-imageβ container image with worker for Kubernetes.
π EXIT STATUS π
- on success? returns zero. π
- on failure? returns non-zero. π
π₯ EXAMPLES π₯
say you've got a Work Queue manager with the project name "barney". to keep workers alive for barney, you do:
work_queue_factory -T condor -M barney
to keep a maximum of 100 workers on an SGE batch system, you do:
work_queue_factory -T sge -M barney -W 100
to start workers that exit after 5 minutes (300s) of idleness:
work_queue_factory -T condor -M barney -t 300
if you want to start workers that match any project that begins with barney, use a regular expression:
work_queue_factory -T condor -M barney.-t 300
if you're running on condor, you may manually specify condor requirements:
work_queue_factory -T condor -M barney --condor-requirements 'MachineGroup == "disc"' --condor-requirements 'has_matlab == true'
repeated uses of condor-requirements are and-ed together. the previous example produces a statement equivalent to:
requirements = ((MachineGroup == "disc") && (has_matlab == true))
use the configuration file my_conf:
work_queue_factory -Cmy_conf
my_conf should be a proper JSON document, like:
{
"manager-name": "my_manager.*",
"max-workers": 100,
"min-workers": 0
}
valid configuration fields are:
manager-name
foremen-name
min-workers
max-workers
workers-per-cycle
task-per-worker
timeout
worker-extra-options
condor-requirements
cores
memory
disk
π KNOWN BUGS π
not me having to report this but: the capacity measurement currently assumes single-core tasks running on single-core workers, and it behaves unexpectedly with multi-core tasks or multi-core workers. soβ¦ yeah. be aware bestie. π
π COPYRIGHT π
The Cooperative Computing Tools are Copyright (C) 2005-2019 The University of Notre Dame. This software is distributed under the GNU General Public License. See the file COPYING for details.
π«Ά SEE ALSO π«Ά
- Cooperative Computing Tools Documentation
- Work Queue User Manual
work_queue_worker(1)work_queue_status(1)work_queue_factory(1)condor_submit_workers(1)sge_submit_workers(1)torque_submit_workers(1)
and that's the whole page, bestie!! this lil masterpiece is from the CCTools 8.0.0 DEVELOPMENT era, and it's literally titled work_queue_factory(1) β go forth and maintain your worker pool, you absolute main character πβ¨ππ¦πΈπ
π¦ where this page comes from
- debian bookworm: coop-computing-tools 9.9-2+b4 Β· GPL-2.0-only
- ubuntu jammy: coop-computing-tools 9.9-2ubuntu3 Β· GPL-2.0-only
- ubuntu noble: coop-computing-tools 9.9-4ubuntu4 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms