Phase 10: new course and Docker only
Record the course the user chose on 2 December 2026 and make the container the only form of Anubis. - ADR 0021-0026: new roadmap (phases 10-24, readings per phase, the spec-to-ADR table, merge and tag only after the user's yes), Docker only, maths-only decisions, bans turned into limits on margin accounts, eToro Demo as currency venue and forward tests, strategy championship. ROADMAP rewritten from phase 10; STATE, CLAUDE.md, SVILUPPO, README, API-NOTES and the manuals without the desktop. - Remove the desktop: Anubis.Desktop, Anubis.Setup, deploy/windows, release-win and desktop-win, config.toml, PlatformKind, ANUBIS_PLATFORM, DPAPI with the ProtectedData package and the first-run wizard. Outside a container the server needs --data-dir, listens on 127.0.0.1 only and refuses foreign hosts; server and guard refuse --platform desktop with an Italian message and exit code 2. The demo keeps its key in a file and its error-page choices need no startup password. The diagnostics report says where the server runs from its own environment. - Lighter image: restore and publish for linux-x64 only, and leave out the Windows libraries ONNX Runtime copies anyway (829 MB to 410 MB on disk, /app from 282 MB to 42 MB). Rotating Docker logs in the Unraid template, the manual and the compose; backtest and learning run as one-shot commands. tasks dev uses artifacts/dev-data. refs #113 #114 #115 #78 #80 #81 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3c57b3e84c
commit
e9ac6dccc9
95 files changed
+1426
-1604
No files matched your search
@@ -121,6 +121,9 @@ public sealed partial class DeliveryTests
|
||||
Assert.AreEqual("/mnt/user/appdata/anubis", fields["/data"].Value);
|
||||
var extra = template.Element("ExtraParams")!.Value;
|
||||
StringAssert.Contains(extra, "--memory=4g");
|
||||
StringAssert.Contains(extra, "--log-opt max-size=10m --log-opt max-file=3", "Docker's own log files rotate (ADR 0022).");
|
||||
StringAssert.Contains(Text("docs/MANUALE.md"), "--log-opt max-size=10m --log-opt max-file=3");
|
||||
StringAssert.Contains(Text("docker-compose.yml"), "max-size: 10m");
|
||||
var stop = int.Parse(StopTimeout().Match(extra).Groups[1].Value, System.Globalization.CultureInfo.InvariantCulture);
|
||||
Assert.AreEqual(60, stop);
|
||||
Assert.IsGreaterThan(new GuardOptions().GracefulStop, TimeSpan.FromSeconds(stop));
|
||||
@@ -223,15 +226,34 @@ public sealed partial class DeliveryTests
|
||||
StringAssert.Contains(docker, "org.opencontainers.image.revision=\"$ANUBIS_COMMIT\"");
|
||||
var publish = docker.Split('\n').Where(l => l.StartsWith("RUN dotnet publish", StringComparison.Ordinal)).ToList();
|
||||
Assert.HasCount(2, publish);
|
||||
Assert.IsTrue(publish.All(l => l.EndsWith("${ANUBIS_COMMIT:+-p:SourceRevisionId=$ANUBIS_COMMIT}", StringComparison.Ordinal)));
|
||||
Assert.IsTrue(publish.All(l => l.EndsWith(" -o /app ${ANUBIS_COMMIT:+-p:SourceRevisionId=$ANUBIS_COMMIT}", StringComparison.Ordinal)),
|
||||
"Into /app, with the commit as a separate argument: without the space the output folder would swallow it.");
|
||||
StringAssert.Contains(docker, "COPY global.json Directory.Build.props Directory.Build.targets Directory.Packages.props ./");
|
||||
Assert.Contains("grep -qiE '^onnxruntime", docker, "The build stops if the Windows libraries of ONNX Runtime come back into /app.");
|
||||
CollectionAssert.AreEquivalent(new[] { "mcr.microsoft.com/dotnet/sdk:10.0", "mcr.microsoft.com/dotnet/aspnet:10.0" },
|
||||
docker.Split('\n').Where(l => l.StartsWith("FROM ", StringComparison.Ordinal)).Select(l => l.Split(' ')[1]).ToList());
|
||||
StringAssert.Contains(docker, "${PORT:-8787}");
|
||||
StringAssert.Contains(docker, "EXPOSE 8787\n");
|
||||
StringAssert.Contains(docker, "--timeout=10s", "Longer than the 5 seconds the page waits for the database, so its answer arrives.");
|
||||
|
||||
// Only what Linux x64 needs (ADR 0022): the native libraries of the other 23 platforms stay out of the image.
|
||||
var restore = docker.Split('\n').Where(l => l.Contains("dotnet restore", StringComparison.Ordinal)).ToList();
|
||||
Assert.HasCount(2, restore);
|
||||
Assert.IsTrue(restore.Concat(publish).All(l => l.Contains(" -r linux-x64 ", StringComparison.Ordinal)), string.Join("\n", restore.Concat(publish)));
|
||||
Assert.IsTrue(publish.All(l => l.Contains("--self-contained false", StringComparison.Ordinal)));
|
||||
Assert.DoesNotContain("ANUBIS_PLATFORM", docker, "The guard and the server recognise the container by themselves.");
|
||||
|
||||
var entry = Text("deploy/docker/entrypoint.sh");
|
||||
StringAssert.Contains(entry, "PUID=0");
|
||||
StringAssert.Contains(entry, "--no-new-privs");
|
||||
|
||||
// Every one-shot command of the server runs outside the guard, which would restart it when it ends.
|
||||
var oneShot = OneShot().Match(entry);
|
||||
Assert.IsTrue(oneShot.Success, "The entrypoint routes the one-shot commands.");
|
||||
var routed = oneShot.Groups[1].Value.Split('|');
|
||||
var commands = CommandOfTheServer().Matches(Text("src/Anubis.Server/Program.cs")).Select(m => m.Groups[1].Value).ToList();
|
||||
Assert.IsNotEmpty(commands);
|
||||
CollectionAssert.AreEquivalent(commands, routed);
|
||||
}
|
||||
|
||||
// ---- the workflow ----
|
||||
@@ -574,6 +596,12 @@ public sealed partial class DeliveryTests
|
||||
[GeneratedRegex(@"--stop-timeout (\d+)")]
|
||||
private static partial Regex StopTimeout();
|
||||
|
||||
[GeneratedRegex(@"\r?\n\s*([a-z|]+)\)\r?\n\s*app=""/app/Anubis\.Server\.dll""")]
|
||||
private static partial Regex OneShot();
|
||||
|
||||
[GeneratedRegex(@"args\[0\] == ""([a-z]+)""")]
|
||||
private static partial Regex CommandOfTheServer();
|
||||
|
||||
[GeneratedRegex(@"publish\.sh|docker (push|login)")]
|
||||
private static partial Regex PublishCommand();
|
||||
}
|
||||
Reference in new issue
Block a user