From 0e6d61dd84888a57f97ee68752eac43edf9030a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Fri, 22 Jul 2022 16:05:18 +0200 Subject: [PATCH] Remove the `{ffmpeg}` variable Remove the `{ffmpeg}` variable from the default configuration, and its use from the job compiler scripts. Now that the Worker can find its bundled FFmpeg, it's no longer needed to configure its location on the Manager. --- internal/manager/config/defaults.go | 7 ------- internal/manager/config/settings_test.go | 6 +++--- internal/manager/job_compilers/job_compilers_test.go | 6 +++--- .../scripts-for-unittest/simple_blender_render.js | 2 +- .../manager/job_compilers/scripts/simple_blender_render.js | 2 +- internal/worker/command_ffmpeg.go | 2 +- 6 files changed, 9 insertions(+), 16 deletions(-) diff --git a/internal/manager/config/defaults.go b/internal/manager/config/defaults.go index 7091b1e0..69d48bca 100644 --- a/internal/manager/config/defaults.go +++ b/internal/manager/config/defaults.go @@ -67,13 +67,6 @@ var defaultConfig = Conf{ VariableValue{Platform: "darwin", Value: "blender " + DefaultBlenderArguments}, }, }, - "ffmpeg": { - Values: VariableValues{ - VariableValue{Platform: "linux", Value: "ffmpeg"}, - VariableValue{Platform: "windows", Value: "ffmpeg.exe"}, - VariableValue{Platform: "darwin", Value: "ffmpeg"}, - }, - }, // TODO: determine useful defaults for these. // "job_storage": { // IsTwoWay: true, diff --git a/internal/manager/config/settings_test.go b/internal/manager/config/settings_test.go index 0d59601e..e74fc88f 100644 --- a/internal/manager/config/settings_test.go +++ b/internal/manager/config/settings_test.go @@ -19,9 +19,9 @@ func TestDefaultSettings(t *testing.T) { assert.Equal(t, defaultConfig.LocalManagerStoragePath, config.LocalManagerStoragePath) assert.Equal(t, defaultConfig.DatabaseDSN, config.DatabaseDSN) - assert.Equal(t, false, config.Variables["ffmpeg"].IsTwoWay) - assert.Equal(t, "ffmpeg", config.Variables["ffmpeg"].Values[0].Value) - assert.Equal(t, VariablePlatformLinux, config.Variables["ffmpeg"].Values[0].Platform) + assert.Equal(t, false, config.Variables["blender"].IsTwoWay) + assert.Equal(t, "blender "+DefaultBlenderArguments, config.Variables["blender"].Values[0].Value) + assert.Equal(t, VariablePlatformLinux, config.Variables["blender"].Values[0].Platform) assert.Greater(t, config.BlocklistThreshold, 0) } diff --git a/internal/manager/job_compilers/job_compilers_test.go b/internal/manager/job_compilers/job_compilers_test.go index 8d98eddb..188139c7 100644 --- a/internal/manager/job_compilers/job_compilers_test.go +++ b/internal/manager/job_compilers/job_compilers_test.go @@ -114,7 +114,7 @@ func TestSimpleBlenderRenderHappy(t *testing.T) { assert.Equal(t, 1, len(tVideo.Commands)) assert.Equal(t, "frames-to-video", tVideo.Commands[0].Name) assert.EqualValues(t, AuthoredCommandParameters{ - "exe": "{ffmpeg}", + "exe": "ffmpeg", "inputGlob": "/render/sprites/farm_output/promo/square_ellie/square_ellie.lighting_light_breakdown2__intermediate-2006-01-02_090405/*.png", "outputFile": "/render/sprites/farm_output/promo/square_ellie/square_ellie.lighting_light_breakdown2__intermediate-2006-01-02_090405/scene123-1-10.mp4", "fps": int64(24), @@ -198,7 +198,7 @@ func TestSimpleBlenderRenderWindowsPaths(t *testing.T) { assert.Equal(t, 1, len(tVideo.Commands)) assert.Equal(t, "frames-to-video", tVideo.Commands[0].Name) assert.EqualValues(t, AuthoredCommandParameters{ - "exe": "{ffmpeg}", + "exe": "ffmpeg", "inputGlob": "R:/sprites/farm_output/promo/square_ellie/square_ellie.lighting_light_breakdown2__intermediate-2006-01-02_090405/*.png", "outputFile": "R:/sprites/farm_output/promo/square_ellie/square_ellie.lighting_light_breakdown2__intermediate-2006-01-02_090405/scene123-1-10.mp4", "fps": int64(24), @@ -247,7 +247,7 @@ func TestSimpleBlenderRenderOutputPathFieldReplacement(t *testing.T) { tVideo := aj.Tasks[4] // This should be a video encoding task assert.EqualValues(t, AuthoredCommandParameters{ - "exe": "{ffmpeg}", + "exe": "ffmpeg", "inputGlob": "/root/2006-01-02_090405/jobname__intermediate-2006-01-02_090405/*.png", "outputFile": "/root/2006-01-02_090405/jobname__intermediate-2006-01-02_090405/scene123-1-10.mp4", "fps": int64(24), diff --git a/internal/manager/job_compilers/scripts-for-unittest/simple_blender_render.js b/internal/manager/job_compilers/scripts-for-unittest/simple_blender_render.js index bd5f6f59..934cc995 100644 --- a/internal/manager/job_compilers/scripts-for-unittest/simple_blender_render.js +++ b/internal/manager/job_compilers/scripts-for-unittest/simple_blender_render.js @@ -154,7 +154,7 @@ function authorCreateVideoTask(settings, renderDir) { const task = author.Task('preview-video', 'ffmpeg'); const command = author.Command("frames-to-video", { - exe: "{ffmpeg}", + exe: "ffmpeg", fps: settings.fps, inputGlob: path.join(renderDir, `*${outfileExt}`), outputFile: outfile, diff --git a/internal/manager/job_compilers/scripts/simple_blender_render.js b/internal/manager/job_compilers/scripts/simple_blender_render.js index 0d8a54c7..1cab047c 100644 --- a/internal/manager/job_compilers/scripts/simple_blender_render.js +++ b/internal/manager/job_compilers/scripts/simple_blender_render.js @@ -155,7 +155,7 @@ function authorCreateVideoTask(settings, renderDir) { const task = author.Task('preview-video', 'ffmpeg'); const command = author.Command("frames-to-video", { - exe: "{ffmpeg}", + exe: "ffmpeg", fps: settings.fps, inputGlob: path.join(renderDir, `*${outfileExt}`), outputFile: outfile, diff --git a/internal/worker/command_ffmpeg.go b/internal/worker/command_ffmpeg.go index ee188a87..3dd7c3aa 100644 --- a/internal/worker/command_ffmpeg.go +++ b/internal/worker/command_ffmpeg.go @@ -28,7 +28,7 @@ import ( ) type CreateVideoParams struct { - exe string // Expansion of `{ffmpeg}`: executable path + its CLI parameters defined by the Manager. + exe string // Executable path + its CLI parameters defined by the Manager. fps float64 // Frames per second of the video file. inputGlob string // Glob of input files. outputFile string // File to save the video to.