Collect diagnostics for the analysis of a long run and package a Windows trial release (refs #95 #55)
ci / test (postgres) (push) Successful in 6m25s
ci / test (sqlite) (push) Successful in 4m1s
ci / test (postgres) (pull_request) Failing after 6m4s
ci / image (push) Canceled after 0s
ci / test (sqlite) (pull_request) Successful in 4m34s
ci / image (pull_request) Skipped
ci / test (postgres) (push) Successful in 6m25s
ci / test (sqlite) (push) Successful in 4m1s
ci / test (postgres) (pull_request) Failing after 6m4s
ci / image (push) Canceled after 0s
ci / test (sqlite) (pull_request) Successful in 4m34s
ci / image (pull_request) Skipped
The 48-hour soak run at home kept being cut short by the host, never by Anubis.
The user will instead run a release for as long as they like and paste back a
report, so the bot now records what that report needs (ADR 0013).
- Every 5 minutes and at each start, a process sample goes to diagnostic_samples:
memory, GC, threads, handles, CPU, exceptions, database size, log warnings and
errors, and outbound HTTP calls by destination with duration buckets, read from
the System.Net.Http meter without any new package.
- Every scheduled job run goes to job_runs. Both tables keep 30 days.
- The Markdown report (at most 60 KB, redacted, user folders masked) adds
findings, the soak checks, starts and silences, jobs, calls, grouped log
warnings and errors, and resources over time with their slopes. It comes from
"anubis diagnostics", GET /api/diagnostica.md and a button in Diario e sistema.
- New {long} column token: SQLite STRICT tables reject BIGINT.
- "tasks release-win" builds the trial zip with a start script, a script that
writes the report, and Italian instructions. Version 0.7.0.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
32673007a2
commit
6e365673b8
26 files changed
+1678
-18
No files matched your search
@@ -18,6 +18,7 @@ return command switch
|
||||
"hooks" => Step("Attivazione dell'hook pre-commit (.githooks)", "git", ["config", "core.hooksPath", ".githooks"]) ?? 0,
|
||||
"seed-demo" => Run("dotnet", ["run", "--project", "src/Anubis.Server", "-c", "Release", "--", "--demo", .. rest]),
|
||||
"screenshots" => Screenshots(rest),
|
||||
"release-win" => ReleaseWindows(),
|
||||
"desktop-win" => NotYet("desktop-win", 10),
|
||||
_ => Help(),
|
||||
};
|
||||
@@ -182,6 +183,41 @@ static int FreePort()
|
||||
return port;
|
||||
}
|
||||
|
||||
// The zip of a trial release for Windows (ADR 0013, point 6): the server, a start script and the instructions, before
|
||||
// the Phase 10 installer exists. It needs the ASP.NET Core 10 runtime on the computer.
|
||||
int ReleaseWindows()
|
||||
{
|
||||
var props = File.ReadAllText(Path.Combine(root, "Directory.Build.props"));
|
||||
var start = props.IndexOf("<Version>", StringComparison.Ordinal) + "<Version>".Length;
|
||||
var version = props[start..props.IndexOf("</Version>", start, StringComparison.Ordinal)];
|
||||
var name = $"anubis-{version}-win-x64";
|
||||
var output = Path.Combine(root, "artifacts", "release");
|
||||
var folder = Path.Combine(output, name);
|
||||
if (Directory.Exists(folder))
|
||||
{
|
||||
Directory.Delete(folder, recursive: true);
|
||||
}
|
||||
|
||||
var failed = Step($"Pubblicazione del server {version} per Windows", "dotnet",
|
||||
["publish", "src/Anubis.Server", "-c", "Release", "-r", "win-x64", "--self-contained", "false", "-o", folder]);
|
||||
if (failed is { } code)
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
foreach (var file in Directory.EnumerateFiles(Path.Combine(root, "deploy", "windows")))
|
||||
{
|
||||
File.Copy(file, Path.Combine(folder, Path.GetFileName(file)), overwrite: true);
|
||||
}
|
||||
|
||||
var zip = Path.Combine(output, name + ".zip");
|
||||
File.Delete(zip);
|
||||
System.IO.Compression.ZipFile.CreateFromDirectory(folder, zip, System.IO.Compression.CompressionLevel.Optimal, includeBaseDirectory: true);
|
||||
Console.WriteLine();
|
||||
Console.WriteLine($"== Pronto: {zip} ({(new FileInfo(zip).Length / 1048576.0).ToString("0.0", CultureInfo.InvariantCulture)} MB)");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int NotYet(string name, int phase)
|
||||
{
|
||||
Console.Error.WriteLine($"'tasks {name}' arriva nella Fase {phase.ToString(CultureInfo.InvariantCulture)}.");
|
||||
@@ -200,6 +236,7 @@ int Help()
|
||||
tasks hooks attiva l'hook che esegue check prima di ogni commit
|
||||
tasks seed-demo avvia la modalità dimostrativa (dati dell'appendice F, database a parte)
|
||||
tasks screenshots fotografa le schermate dimostrative a 1440 e 390 pixel
|
||||
tasks release-win zip di prova per Windows in artifacts/release (ADR 0013)
|
||||
tasks desktop-win installatore Windows (Fase 10)
|
||||
""");
|
||||
return command == "help" ? 0 : 1;
|
||||
|
||||
Reference in new issue
Block a user