Configuration Files

The blade.config file specifies server profiles, each of which may apply to one or more renderfarm hosts. The idea is to have a central configuration (policy) file that controls all machines, and to allow a single profile to apply to many machines, as necessary. New servers can be brought online and will join the renderfarm using a simple "plug and play" approach using the settings for whichever profile they match.

The blade.config file is typically copied in its entirety to the site override directory and then customized there. It contains a dictionary with two top-level key entries:

Profile Matching

Because of the "first match wins" policy, profile definitions that are specific to just a few machines should go near the top of the BladeProfiles list, while "catch-all" general profiles should go at the end, ensuring that specialized blades are matched to the appropriate profile.
 

Required Keys

There are several "required" keys that are specified in each profile object (dictionary) in the BladeProfile array. Most of the required keys are specified in the ProfileDefaults dictionary, and overrides are applied from individual profiles. Here's an example for reference:

{

    "ProfileDefaults":
    {   "ProfileName": "default",
        "Provides": ["pixarRender", "pixarNRM"],
        "Hosts": {"Platform": "*"},
        "Access": {
            "Crews": ["*"],
            "NimbyCrews": ["*"],
            "NimbyConnectPolicy": 1.5
        },
        "Capacity": {
            "MaxSlots": 1,    # 0 -> use number of system CPUs
            "MaxLoad":  1.5,  # CPU load avg, normalized by cpu count
            "MinRAM":   1.0,  # gigabytes
            "MinDisk": 20.0,  # gigabytes
        },
        "UDI": 1.0,
        "RecentErrorThrottle": [5, 30, 120],
        #"CmdOutputLogging": "logfile=/fileserver/tractor-logs/%u/J%j/T%t.log",
        "CmdOutputLogging": "logserver=${TRACTOR_ENGINE}:9180",
        #"VersionPin": "@env(TRACTOR_ENGINE_VERSION)",
        # "TaskBidTuning": "immediate",
        "TR_EXIT_STATUS_terminate": 0,
        "SiteModulesPath": "",
        "DirMapZone": "nfs",
        "EnvKeys": [
            {   "keys": ["default"],
                "environment": {},
                "envhandler": "default"
            },
        ]
    },


    "BladeProfiles":
    [
        {   "ProfileName": "BigLinux",
            "Hosts": {
                "Platform": "Linux-*",
                "MinNCPU": 8,      # must have at least 8 CPUs
                "MinPhysRAM": 16,  # must have at least 16 GB
            },
            "UDI": 11,
            "EnvKeys": [
                "@merge('shared.linux.envkeys')"
            ]
        },

        {   "ProfileName": "OtherLinux",
            "Hosts": {"Platform": "Linux-*"},
            "EnvKeys": [
                "@merge('shared.linux.envkeys')"
            ]
        },

        {  "ProfileName": "our_next_profile",
             ...
        }
    ]
}


Key Terms

[
   {
      "keys": ["default"],
      "environment": {
          "REMOTEHOST": "$TR_SPOOLHOST"
     },
     "envhandler": "default"
   },
   {
      "keys": ["prman-*"],
      "environment": {
          "RMANTREE": "/opt/pixar/RenderManProServer-$TR_ENV_RMANVER",
          "PATH": "$RMANTREE/bin:$PATH"
      },
      "envhandler": "rmanhandler"
   },
   {
      "keys": ["JOB=*", "TASK=*", "SCENE=", "PROD=*"],
      "environment": {
      },
      "envhandler": "productionhandler"
   },
]

Each dictionary is a named environment and defines a list of environment keys which are matched against the incoming envkeys from the job to be launched.

The environment entry contains overrides to the default environment variables in which the command will run. The envhandler key contains the name of a Python environment handler that will operate on the command prior to being executed. The envhandlers can be extended by adding modules into the directory defined by the SiteModulePath entry. See the envhandler documentation for more details.