Skip to main content

Command line reference for the worker agent

Run the worker

Go to https://metapage.io/settings/queues to get the terminal command to run a worker agent.

GPUs

Use the command line argument --gpus=x to set the number of GPUs to x. This should not exceed the number of gpus on your machine.

Env vars

These are the environment variables that can be used instead of cli arguments, also some advanced options are only available via env vars:

Env varcli command exampleDescription
METAPAGE_IO_CPUS—cpus 1The max number CPU cores the worker will claim for jobs
METAPAGE_IO_GPUS—gpus 1The max number GPUs the worker will claim for jobs
METAPAGE_IO_MODE—mode localDefault: remote. remote mode means the queue is in the cloud. local means all compute runs on the local machine, no scaling possible, but does not require any external API.
METAPAGE_IO_QUEUEThe queue the worker connects to for jobs to complete
METAPAGE_IO_PORT—port 8000Default: 8000. When in --mode local, this is the port the worker uses to connect.
METAPAGE_IO_API_ADDRESS—api-address https://container.mtfm.ioAdvanced or development use only. Allows connecting the worker to a different API queue server
(tbd)--data-directoryDefault: /tmp/worker-metapage-io. The base directory where jobs and the file cache are stored. Use your home directory if you want this persisted.
METAPAGE_IO_GENERATE_WORKER_IDIf set to true then the worker will always generate a new unique id on every start.
METAPAGE_IO_WORKER_RUN_STANDALONEIf set to true, will start a docker daemon process as a subprocess.
METAPAGE_IO_DEBUG—debugDefault: false. Adds a lot of extra logging.

Automatic local upgrades

A deno command to automatically upgrade the worker to the latest version:

deno run -A --unstable jsr:@metapages/cli@0.2.0 worker upgrade

High Level Security

  • Job containers do not have host network access
  • Job containers only have host files mounted in at /inputs and /outputs
  • Job containers are only configurable by a restricted set of options