OAPI: when submitting a job, include the submitter's platform

The submitter's platform is used to perform two-way variable
replacement. The variables of that submitter's platform are looked up,
and their values are replaced with the variable names. This only applies
to the job's settings and metadata, and is only performed on prefixes.

For example, if the submitter's platform has a variable
`render = /shared/frames`, a job setting
`output = "/shared/frames/shot123"` will be stored as
`output = "{render}/shot123".

When a Worker gets a task of this job, `{render}` will be expanded to
the value appropriate for their platform, hence the "two-way" name.
This commit is contained in:
Sybren A. Stüvel 2022-07-21 16:35:05 +02:00
parent 585c886bd5
commit 4c1a21f4a0

View File

@ -1431,11 +1431,25 @@ components:
"priority": { type: integer, default: 50 }
"settings": { $ref: "#/components/schemas/JobSettings" }
"metadata": { $ref: "#/components/schemas/JobMetadata" }
required: [name, type, priority]
"submitter_platform":
type: string
description: >
Operating system of the submitter. This is used to recognise two-way
variables. This should be a lower-case version of the platform, like
"linux", "windows", "darwin", "openbsd", etc. Should be ompatible
with Go's `runtime.GOOS`; run `go tool dist list` to get a list of
possible platforms.
As a special case, the platform "manager" can be given, which will
be interpreted as "the Manager's platform". This is mostly to make
test/debug scripts easier, as they can use a static document on all
platforms.
required: [name, type, priority, submitter_platform]
example:
type: "simple-blender-render"
name: 3Д рендеринг
priority: 50
submitter_platform: linux
settings:
blender_cmd: "{blender}"
filepath: "/render/sf/jobs/scene123.blend"