a3be3489de
Adds scripts/publish.ps1, which produces a self-contained single-file exe plus the headless AE build script, optionally zipped for copying to a render machine. Adds `VFXReviewWorker.exe --check`: resolves every configured path, confirms aerender/AfterFX/the build script exist, verifies each pathMappings target is reachable from that machine, and pings the server to confirm the API key is accepted — exiting non-zero if anything would stop the worker running. Catches a wrong path at install time rather than in the logs later. Verified from the published binary: the single-file exe resolves its scripts folder correctly, so the preview build script ships alongside the exe rather than embedded and can be patched without a rebuild. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
40 lines
1.6 KiB
C#
40 lines
1.6 KiB
C#
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Hosting;
|
|
using Microsoft.Extensions.Logging;
|
|
using VFXReviewWorker;
|
|
|
|
// VFXReview RenderWorker (RenderPipeline2 §7) — Windows service driving
|
|
// aerender.exe on artist workstations / render nodes. All state flows through
|
|
// /api/ext/* with API-key auth; the worker never touches the database.
|
|
//
|
|
// Run interactively for debugging: VFXReviewWorker.exe [path\to\config.json]
|
|
// Install as a service: see RenderWorker/README.md
|
|
|
|
var configPath = args.FirstOrDefault(a => !a.StartsWith('-'));
|
|
|
|
// Install verification on a new machine — resolves paths, checks tools and
|
|
// pings the server, then exits. Never starts the service loop.
|
|
if (args.Any(a => a.Equals("--check", StringComparison.OrdinalIgnoreCase)))
|
|
{
|
|
return await Preflight.RunAsync(configPath);
|
|
}
|
|
|
|
var options = WorkerOptions.Load(configPath);
|
|
|
|
// Positional args (config path) are consumed above and deliberately not
|
|
// forwarded — the command-line configuration provider rejects bare tokens.
|
|
var builder = Host.CreateApplicationBuilder();
|
|
builder.Services.AddWindowsService(o => o.ServiceName = "VFXReviewRenderWorker");
|
|
builder.Logging.AddProvider(new FileLoggerProvider());
|
|
|
|
builder.Services.AddSingleton(options);
|
|
builder.Services.AddSingleton<ApiClient>();
|
|
builder.Services.AddSingleton<ReportSpooler>();
|
|
builder.Services.AddSingleton<AerenderRunner>();
|
|
builder.Services.AddSingleton<PreviewStage>();
|
|
builder.Services.AddSingleton<JobExecutor>();
|
|
builder.Services.AddHostedService<WorkerService>();
|
|
|
|
await builder.Build().RunAsync();
|
|
return 0;
|