refactor!: rename Titano to Chronos and move CI and releases to Gitea (#6)
CI / Build and test (push) Successful in 8m14s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 7s
Release / Build, test and publish (push) Successful in 13m19s
CI / PostgreSQL 16 integration (push) Successful in 4m49s
CI / PostgreSQL 17 integration (push) Successful in 5m28s
CI / Docker image (push) Successful in 53s
Release / Server image (push) Failing after 10s
CI / Build and test (push) Successful in 8m14s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 7s
Release / Build, test and publish (push) Successful in 13m19s
CI / PostgreSQL 16 integration (push) Successful in 4m49s
CI / PostgreSQL 17 integration (push) Successful in 5m28s
CI / Docker image (push) Successful in 53s
Release / Server image (push) Failing after 10s
The owner renamed the product and moved the repository to the self-hosted Gitea (https://gitea.encke-hake.ts.net/BalboSoft/Chronos) for more control, and asked for Actions and a first automatic release with the server package and the Windows exe (docs/requests/2026-10-23-chronos-gitea.md). - Chronos everywhere: a byte-exact rename of contents and paths, then a per-language review of the forms the old name's ending had dictated. - Gitea instead of GitHub: the update check, licence, issue and support links read ChronosReleasesUrl; the update check takes the highest stable version, offers a pre-release build its final release and reports a repository it cannot see as a failed check. EULA, security policy and Gitea issue forms live at the repository root. - Gitea Actions for the Linux act_runner (.gitea/workflows): CI, release, nightly image and performance gates in the .NET SDK container with git checkout and the system SQLite. The release cross-compiles the Windows programs, checks their icon, version and DPI manifest, packs installers and zips, publishes the Gitea release and pushes the server image (REGISTRY_TOKEN). Windows-only tests run in an opt-in job on a Windows runner (WINDOWS_RUNNER). - New Chronos.Tools commands: zip, gitea-release, postgres-ci (replaces the docker-exec script, which Gitea's service containers do not allow; the throw-away server runs without durability) and pe-check. - Timed tests take their budget from TestTiming (CHRONOS_TEST_TIME_FACTOR, 3 on the shared runner; the weekly performance gates keep theirs). BREAKING CHANGE: programs, settings, data folders, file types, environment variables and the Docker image use the new name; nothing is migrated from Titano, which never had a release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Alberto Balbo <alberto.balbo.96@gmail.com>
This commit was merged in pull request #6.
This commit is contained in:
1 parent
c99842cc86
commit
f2b58522b9
1801 files changed
+11804
-10676
No files matched your search
@@ -0,0 +1,179 @@
|
||||
using Chronos.Core.Analysis;
|
||||
using Chronos.Core.Analysis.Deep;
|
||||
using Chronos.Core.Export;
|
||||
using Chronos.Core.Imaging;
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Core.Model;
|
||||
using Chronos.Core.Project;
|
||||
using Chronos.Core.Render;
|
||||
|
||||
namespace Chronos.Data.Processing;
|
||||
|
||||
/// <summary>One output of a render job: the resolved export values and the preset name recorded with the render.</summary>
|
||||
internal sealed record ExportTarget(ResolvedExport Export, string PresetName);
|
||||
|
||||
/// <summary>How one target of <see cref="SequenceRender.RenderAllAsync"/> ended: a result, or the localised reason it failed.</summary>
|
||||
internal sealed record TargetOutcome(ExportTarget Target, RenderResult? Result, string? Error);
|
||||
|
||||
/// <summary>
|
||||
/// The render of one sequence (BRIEF §11): the frame source, the clock-corrected capture metadata, the project with the
|
||||
/// frames that cannot be rendered excluded, and the pipeline with the host's encoders. Targets share one preparation
|
||||
/// pass; each is named once its encoder (and so its codec and size) is known, and failures of one target do not stop
|
||||
/// the others. Outputs are written by the encoder sessions to temporary names and renamed on completion, so a
|
||||
/// cancelled or failed target leaves nothing behind. A target gets the hardware encoders only when the user allows them
|
||||
/// for its preset (<see cref="ProcessingOptions.AllowsHardware"/>).
|
||||
/// </summary>
|
||||
internal sealed class SequenceRender : IAsyncDisposable
|
||||
{
|
||||
private readonly SequenceFrameSource _source;
|
||||
private readonly ProcessingOptions _processing;
|
||||
private readonly Dictionary<bool, RenderPipeline> _pipelines = [];
|
||||
private readonly RenderOptions _options;
|
||||
|
||||
/// <param name="analysis">The sequence's deep report, when current: its luminance spares the preparation a decode pass.</param>
|
||||
/// <param name="originals">The frames' files are the archive's originals (no proxies), so <see cref="Decoded"/> describes them.</param>
|
||||
/// <param name="companions">The JPEG of each GPR frame kept in another sequence, by frame id (<see cref="Archiving.GprCompanions"/>).</param>
|
||||
public SequenceRender(SequenceFrames frames, ProjectSettings project, DeepAnalysisReport? analysis, ProcessingOptions options, bool originals = false,
|
||||
IReadOnlyDictionary<Guid, string>? companions = null)
|
||||
{
|
||||
// The host's tuning as it is now (memory budget, quality profile): a change applies from the next render.
|
||||
options = options.Current;
|
||||
var metadata = frames.LightFrames();
|
||||
var planned = project with { ExcludedFrames = [.. project.ExcludedFrames.Union(frames.NotRenderable()).Order()] };
|
||||
// A frame that turns out not to decode is shown as its nearest planned neighbour instead of failing the render.
|
||||
_source = new SequenceFrameSource(frames, metadata, options.Archive.Decoder, options.FrameWindow)
|
||||
{
|
||||
Originals = originals,
|
||||
RenderExcluded = planned.ExcludedFrames.ToHashSet(),
|
||||
Companions = companions,
|
||||
};
|
||||
_processing = options;
|
||||
_options = options.Render;
|
||||
Input = new RenderInput
|
||||
{
|
||||
Source = _source,
|
||||
Frames = SourceFrameInfo.From(frames.Frames, LightAnalyzer.Analyze(metadata).AdjustedTimes),
|
||||
Project = planned,
|
||||
Analysis = analysis?.FrameCount == frames.Count ? new PrecomputedAnalysis { LogLuminance = Luminance(analysis.Frames) } : null,
|
||||
};
|
||||
}
|
||||
|
||||
public RenderInput Input { get; }
|
||||
|
||||
/// <summary>Positions that did not decode during the render; a neighbour stood in for each (ascending).</summary>
|
||||
public IReadOnlyList<int> StandIns => _source.StandIns;
|
||||
|
||||
/// <summary>The decode tier each frame was read at so far (unavailable when it did not decode); originals only.</summary>
|
||||
public IReadOnlyDictionary<int, FileTier> Decoded => _source.Observed;
|
||||
|
||||
/// <summary>Encoder, geometry and plan of an export before its output is named.</summary>
|
||||
public RenderSetup Setup(ResolvedExport export) => Pipeline(export).Setup(Input, new RenderTarget(export, ExportNaming.FallbackName), _options);
|
||||
|
||||
/// <summary>
|
||||
/// Prepares the sequence once and renders every target. <paramref name="name"/> gives the output path of a target
|
||||
/// from its setup; <paramref name="starting"/> runs before a target writes anything (checkpoints),
|
||||
/// <paramref name="finished"/> after its output is complete (record it, upload it). Progress counts measured and
|
||||
/// rendered frames over the whole call.
|
||||
/// </summary>
|
||||
public async Task<IReadOnlyList<TargetOutcome>> RenderAllAsync(
|
||||
IReadOnlyList<(int Index, ExportTarget Target)> targets,
|
||||
Func<ExportTarget, RenderSetup, string> name,
|
||||
Func<int, string, ValueTask> starting,
|
||||
Func<int, ExportTarget, RenderResult, ValueTask> finished,
|
||||
Func<long, long, string?, ValueTask> progress,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
var outcomes = new List<TargetOutcome>(targets.Count);
|
||||
var ready = new List<(int Index, ExportTarget Target, RenderSetup Setup)>();
|
||||
foreach (var (index, target) in targets)
|
||||
{
|
||||
RenderSetup setup;
|
||||
try
|
||||
{
|
||||
setup = Setup(target.Export);
|
||||
}
|
||||
catch (RenderException ex)
|
||||
{
|
||||
// The source size could not be measured (no renderable frame decodes).
|
||||
outcomes.Add(new TargetOutcome(target, null, Reason(ex)));
|
||||
continue;
|
||||
}
|
||||
if (setup.Encoder.IsReady && setup.Plan.Frames.Count > 0) ready.Add((index, target, setup));
|
||||
else outcomes.Add(new TargetOutcome(target, null, Reason(setup)));
|
||||
}
|
||||
if (ready.Count == 0) return outcomes;
|
||||
|
||||
var preparing = ready[0].Setup.NeedsPreparation ? ready[0].Setup.Plan.IncludedFrames.Count : 0;
|
||||
var total = preparing + ready.Sum(r => (long)r.Setup.Plan.Frames.Count);
|
||||
var stage = Loc.L("Export.Job.Preparing");
|
||||
var chain = new ProgressChain(progress);
|
||||
var corrections = await RenderPreparation.PrepareAsync(Input, _options, Stage(chain, 0, preparing, total, stage), cancellationToken).ConfigureAwait(false);
|
||||
await chain.FlushAsync().ConfigureAwait(false);
|
||||
|
||||
long done = preparing;
|
||||
foreach (var (index, target, setup) in ready)
|
||||
{
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
var output = name(target, setup);
|
||||
await starting(index, output).ConfigureAwait(false);
|
||||
try
|
||||
{
|
||||
var result = await Pipeline(target.Export).RenderAsync(Input, corrections, new RenderTarget(target.Export, output), _options,
|
||||
Stage(chain, done, setup.Plan.Frames.Count, total, target.PresetName), cancellationToken).ConfigureAwait(false);
|
||||
await chain.FlushAsync().ConfigureAwait(false);
|
||||
await finished(index, target, result).ConfigureAwait(false);
|
||||
outcomes.Add(new TargetOutcome(target, result, null));
|
||||
}
|
||||
catch (Exception ex) when (!(ex is OperationCanceledException && cancellationToken.IsCancellationRequested))
|
||||
{
|
||||
Core.Diagnostics.Log.Warning("processing", $"Render of {target.PresetName} to {output} failed", ex);
|
||||
outcomes.Add(new TargetOutcome(target, null, Reason(ex)));
|
||||
}
|
||||
done += setup.Plan.Frames.Count;
|
||||
}
|
||||
return outcomes;
|
||||
}
|
||||
|
||||
/// <summary>Values of the output name tokens: the shoot date and title of the sequence, the codec and size the encoder will use.</summary>
|
||||
public static ExportNameContext NameContext(Sequence sequence, ExportTarget target, RenderSetup setup) => new()
|
||||
{
|
||||
Date = sequence.FirstCapture ?? DateTime.Now,
|
||||
Title = sequence.DisplayTitle,
|
||||
PresetName = target.PresetName,
|
||||
Width = setup.Encoder.Settings.Width,
|
||||
Height = setup.Encoder.Settings.Height,
|
||||
FrameRate = setup.Encoder.Settings.FrameRate,
|
||||
Codec = setup.Encoder.Settings.Codec,
|
||||
};
|
||||
|
||||
/// <summary>Localised text of a render failure.</summary>
|
||||
public static string Reason(Exception exception) =>
|
||||
exception is RenderException render ? Loc.L(render.ReasonKey, [.. render.Args]) : exception.Message;
|
||||
|
||||
/// <summary>Localised remarks of a finished render (encoder fallbacks, ignored settings…), without repeats.</summary>
|
||||
public static IEnumerable<string> Remarks(RenderResult result) => result.Warnings.Select(w => Loc.L(w.Key, [.. w.Args])).Distinct();
|
||||
|
||||
public ValueTask DisposeAsync() => _source.DisposeAsync();
|
||||
|
||||
/// <summary>The pipeline with the encoders <paramref name="export"/> may use.</summary>
|
||||
private RenderPipeline Pipeline(ResolvedExport export)
|
||||
{
|
||||
var hardware = _processing.AllowsHardware(export.BasePresetId);
|
||||
if (!_pipelines.TryGetValue(hardware, out var pipeline))
|
||||
_pipelines[hardware] = pipeline = new RenderPipeline(hardware ? _processing.Encoders : _processing.SoftwareEncoders, _processing.Host);
|
||||
return pipeline;
|
||||
}
|
||||
|
||||
private static string Reason(RenderSetup setup)
|
||||
{
|
||||
if (setup.Plan.Frames.Count == 0) return Loc.L("Export.Render.NoFrames");
|
||||
var notice = setup.Encoder.Notices.LastOrDefault() ?? new EncoderNotice(EncoderNotices.NoEncoder, setup.Encoder.Settings.Codec.ToString());
|
||||
return Loc.L(notice.Key, [.. notice.Args]);
|
||||
}
|
||||
|
||||
private static double[] Luminance(DeepFrameColumns columns) => [.. columns.LogLuminance.Select(v => v ?? double.NaN)];
|
||||
|
||||
/// <summary>One stage's progress (frames measured, or rendered for one target) as frames of the whole call.</summary>
|
||||
private static IProgress<RenderProgress> Stage(ProgressChain chain, long offset, long length, long total, string message) =>
|
||||
chain.For<RenderProgress>(p => (offset + long.Min(length, p.Done), total, message));
|
||||
}
|
||||
Reference in new issue
Block a user