Houdini HQueue集群渲染文档

Resources

On this page
Overview
How to
Custom Resources

Overview

Resources are things required by certain jobs to run, such as Houdini licenses and Mantra Render licenses. You can specify the resources available on clients so HQueue can properly schedule jobs that require certain resources.

HQueue will only schedule jobs requiring a license if there is at least one unused license available, or if another job can be run on a machine that is already using a license. (Houdini and Render licenses are a “per machine resource”. That is, the licenses are consumed per machine rather than per job.)

You can register custom resources of your own to guide scheduling of jobs that require other types of external resources, such as third-party licenses, database locks, and so on.

How to

In a web browser, connect to the HQueue server (http://hostname:5000/). Hover over the menu icon, then click Resources.

The Resources page shows a summary of the available resources and resources in use.

To… Do this
Change the number of licenses available to HQueue If you decrease the number of a licenses available, make sure the new amount is not less than the number of licenses currently in use.

  1. On the Resource page, click Manage resources.
  2. Set the maximum number of Houdini licenses and Render licenses HQueue can use, then click Save.

Custom Resources

Custom resources can be per machine or per job.

Per machine

A resource that is used by a single machine, and can be shared across all jobs running on that machine. For example, a Houdini license is used by a workstation, and then you can run multiple instances of Houdini on that workstation.

Per job

A resource that is consumed by a single job. For example, a database connection can only be used by one job at a time.

To… Do this
Create and a custom resource
  1. On the Resources page, click Manage resources.
  2. Under Custom Resources, click Add.
  3. Set the resource name and the maximum number of resources. If the resource is per-machine, turn on Per machine resource.
  4. Click Save.

For example, you might have a set of jobs that connect to a database and you want to limit the number of concurrent connections. Create a custom per job resource to represent the connections, name it db_connection, and give it a limit amount, say 5.

Then when you submit jobs requiring the connection, add a "resources": {"db_connection": 1} property in the job specification to tell HQueue that the job will consume one db_connection resource.

Edit a custom resource
  1. On the Resources page, click Manage resources.
  2. Under custom resources, do one of the following:
    • Edit the resource name text box.

    • Change the maximum number of available resources. (Do not make this less than the number of resources of this type currently in use.)

    • Change whether the resource is per-machine. (None of the resources of this type may be in use.)

    • Click Delete to delete the resource.

  3. Click Save.
Submitting jobs that require custom resources When you submit custom jobs using the /hqueue/XML/RPC interface, you can specify that the job requires custom resources.

In the job specification, add a "resources" key. The value is a dictionary mapping custom resource names to the number of that resource needed by the job.

job_spec = { 
    "name": "Hello World",
    "shell": "bash",
    "command": 'echo "Hello World"'
    "resources": {"db_connection": 1}
}

(See job properties for more information about the job specification.)

点击分享到: