From 4c1a21f4a037cc81a0e983a30aa720e5a539c178 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 21 Jul 2022 16:35:05 +0200 Subject: [PATCH] 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. --- pkg/api/flamenco-openapi.yaml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/pkg/api/flamenco-openapi.yaml b/pkg/api/flamenco-openapi.yaml index 7a97294f..d683c63e 100644 --- a/pkg/api/flamenco-openapi.yaml +++ b/pkg/api/flamenco-openapi.yaml @@ -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"