feat(pipeline): report deployed tool versions from the tools themselves
"What is running where" was answerable only by asking someone. Each tool now reports its own version on startup into a ToolVersion registry, shown on Pipeline → Machines. The worker's version moves out of config.json and into the assembly: a hand-maintained string on each machine is exactly the thing that goes stale, and a machine reporting a version it is not running is worse than no version at all. publish.ps1 stamps the git SHA via SourceRevisionId, so a deployed exe traces back to a commit (1.1.0+feb1c7b). The panel gains PANEL_VERSION, shown in its title and every diagnostics report, and pings on load. Staleness is derived rather than declared: the newest version seen for a tool is the benchmark, so updating one machine is what flags the rest. There is no expected-version list to keep in sync — which would have been one more thing to forget. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -176,6 +176,36 @@ public sealed class ApiClient
|
||||
public Task<string?> UploadLogAsync(string jobId, string machineId, string logFilePath, CancellationToken ct) =>
|
||||
UploadArtifactAsync(jobId, machineId, "log", logFilePath, "text/plain", ct);
|
||||
|
||||
/// <summary>
|
||||
/// Reports the deployed worker version so the web UI can show what is
|
||||
/// running where. Fire-and-forget — never worth failing a startup over.
|
||||
/// </summary>
|
||||
public async Task ReportVersionAsync(WorkerOptions o, CancellationToken ct)
|
||||
{
|
||||
try
|
||||
{
|
||||
await _http.PostAsJsonAsync("api/ext/tools/ping", new
|
||||
{
|
||||
tool = "RENDER_WORKER",
|
||||
machineName = o.MachineName,
|
||||
version = o.WorkerVersion,
|
||||
hostUser = Environment.UserName,
|
||||
hostApp = $"{Environment.OSVersion.VersionString} ({Dns.GetHostName()})",
|
||||
details = new
|
||||
{
|
||||
aeVersion = o.AeVersion,
|
||||
aerenderPath = o.AerenderPath,
|
||||
ffmpeg = o.FfmpegPath is not null,
|
||||
plateSearchRoots = o.PlateSearchRoots,
|
||||
},
|
||||
}, Json, ct);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_log.LogDebug(ex, "Version ping failed (non-fatal)");
|
||||
}
|
||||
}
|
||||
|
||||
// E3 — used by crash-recovery reconcile (§7.5)
|
||||
public async Task<ExportDetail?> GetExportAsync(string exportId, CancellationToken ct)
|
||||
{
|
||||
|
||||
@@ -31,6 +31,7 @@ public static class Preflight
|
||||
return 1;
|
||||
}
|
||||
|
||||
Console.WriteLine($" worker version : {options.WorkerVersion}");
|
||||
Console.WriteLine($" machine name : {options.MachineName}");
|
||||
Console.WriteLine($" server : {options.ServerUrl}");
|
||||
Console.WriteLine($" api key : {(string.IsNullOrWhiteSpace(options.ApiKey) ? "(missing)" : "set")}");
|
||||
|
||||
@@ -8,6 +8,14 @@
|
||||
<AssemblyName>VFXReviewWorker</AssemblyName>
|
||||
<!-- Single self-contained exe for render nodes: dotnet publish -r win-x64 (see README) -->
|
||||
<InvariantGlobalization>true</InvariantGlobalization>
|
||||
<!--
|
||||
The version is a property of the build, not of the machine it lands on:
|
||||
it is stamped here and read back from the assembly at runtime, so a
|
||||
workstation cannot report a version it is not actually running. Bump on
|
||||
every change that gets published. publish.ps1 appends the git SHA via
|
||||
SourceRevisionId, giving "1.1.0+feb1c7b".
|
||||
-->
|
||||
<Version>1.1.0</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System.Reflection;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
@@ -27,7 +28,18 @@ public sealed class WorkerOptions
|
||||
/// Leave empty and old manifests simply fall through to the API fallback.
|
||||
/// </summary>
|
||||
public List<string> PlateSearchRoots { get; set; } = new();
|
||||
public string WorkerVersion { get; set; } = "1.0.0";
|
||||
/// <summary>
|
||||
/// Read from the assembly, not from config.json: a hand-maintained version
|
||||
/// string is exactly the thing that goes stale, and a machine reporting a
|
||||
/// version it is not running is worse than no version at all.
|
||||
/// Includes the git SHA when publish.ps1 stamped one ("1.1.0+feb1c7b").
|
||||
/// </summary>
|
||||
public string WorkerVersion =>
|
||||
typeof(WorkerOptions).Assembly
|
||||
.GetCustomAttribute<System.Reflection.AssemblyInformationalVersionAttribute>()?.InformationalVersion
|
||||
?? typeof(WorkerOptions).Assembly.GetName().Version?.ToString()
|
||||
?? "unknown";
|
||||
|
||||
public string? AeVersion { get; set; }
|
||||
|
||||
public static string DataDir =>
|
||||
|
||||
@@ -40,6 +40,7 @@ public sealed class WorkerService : BackgroundService
|
||||
_ = Task.Run(() => _spooler.RunAsync(stoppingToken), stoppingToken);
|
||||
|
||||
await RegisterWithRetryAsync(stoppingToken);
|
||||
await _api.ReportVersionAsync(_options, stoppingToken);
|
||||
await _executor.ReconcileAsync(_machineId!, stoppingToken);
|
||||
|
||||
_ = Task.Run(() => HeartbeatLoopAsync(stoppingToken), stoppingToken);
|
||||
|
||||
Reference in New Issue
Block a user