Skip to content

collect_royalrender_job_nev_vars

CollectRoyalRenderJobEnvVars

Bases: ContextPlugin

Collect set of environment variables to submit with RR jobs

Source code in client/ayon_royalrender/plugins/publish/collect_royalrender_job_nev_vars.py
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
class CollectRoyalRenderJobEnvVars(pyblish.api.ContextPlugin):
    """Collect set of environment variables to submit with RR jobs"""
    order = pyblish.api.CollectorOrder
    label = "RoyalRender Farm Environment Variables"
    targets = ["local"]

    ENV_KEYS = [
        # applications addon
        "AYON_APP_NAME",

        # Not sure how this is usefull for farm, scared to remove
        "PYBLISHPLUGINPATH",
    ]

    def process(self, context):
        env = context.data.setdefault(FARM_JOB_ENV_DATA_KEY, {})
        for key in self.ENV_KEYS:
            # Skip already set keys
            if key in env:
                continue
            value = os.getenv(key)
            if value:
                self.log.debug(f"Setting job env: {key}: {value}")
                env[key] = value

        if os.environ.get("AYON_USE_STAGING"):
            env["AYON_USE_STAGING"] = "1"