4 Commits

Author SHA1 Message Date
amadzarak 252e685d2e OPC # 0009: Gitea and OPC Build Webhooks. Clarity Fixes: 7b80d2e
controlplane/build ✔ Build succeeded.
Co-authored-by: Copilot <copilot@github.com>
2026-04-26 17:19:17 -04:00
amadzarak 7b80d2e071 OPC # 0009: Gitea and OPC Build Webhooks
controlplane/build ✖ Build failed (exit 1).
2026-04-26 16:12:12 -04:00
amadzarak 25c937e41c OPC # 0007: Patch FDEV provisioning for local aspire development
Co-authored-by: Copilot <copilot@github.com>
2026-04-26 12:48:02 -04:00
amadzarak af573a8aff OPC # 0002: Improvements to Client provisioning workflows 2026-04-25 22:24:45 -04:00
7 changed files with 85 additions and 45 deletions
+8 -35
View File
@@ -3,53 +3,27 @@ using Scalar.Aspire;
var builder = DistributedApplication.CreateBuilder(args); var builder = DistributedApplication.CreateBuilder(args);
#region MINIO #region EXTERNAL CONNECTIONS OPC infra (postgres, minio)
var minio = builder.AddMinioContainer("minio"); // Connection strings are declared in appsettings.Development.json and point at the
// fdev tenant on the shared OPC platform infra running via OPC/infra/docker-compose.yml.
var postgresdb = builder.AddConnectionString("postgresdb");
var minio = builder.AddConnectionString("minio");
#endregion #endregion
#region REDIS #region REDIS
var cache = builder.AddRedis("cache"); var cache = builder.AddRedis("cache");
#endregion #endregion
#region POSTGRESQL AND PGADMIN
var postgres = builder.AddPostgres("postgres")
.WithLifetime(ContainerLifetime.Persistent)
.WithHostPort(5432)
.WithPgAdmin();
var postgresdb = postgres.AddDatabase("postgresdb");
#endregion
#region KEYCLOAK
var keycloakDb = postgres.AddDatabase("authdb");
var keycloak = builder.AddKeycloak("keycloak", 8080)
.WithEnvironment(async ctx =>
{
var connString = await keycloakDb.Resource.ConnectionStringExpression.GetValueAsync(CancellationToken.None);
var conn = new Npgsql.NpgsqlConnectionStringBuilder(connString);
ctx.EnvironmentVariables["KC_DB"] = "postgres";
ctx.EnvironmentVariables["KC_DB_URL"] = $"jdbc:postgresql://postgres:5432/{keycloakDb.Resource.DatabaseName}";
ctx.EnvironmentVariables["KC_DB_USERNAME"] = conn.Username!;
ctx.EnvironmentVariables["KC_DB_PASSWORD"] = conn.Password!;
})
.WaitFor(keycloakDb)
.WithRealmImport("KeycloakConfig/");
#endregion
#region EFCORE MIGRATION WORKER #region EFCORE MIGRATION WORKER
var migrations = builder.AddProject<Projects.Clarity_MigrationService>("clarity-migrationservice") var migrations = builder.AddProject<Projects.Clarity_MigrationService>("clarity-migrationservice")
.WithReference(postgresdb) .WithReference(postgresdb);
.WaitFor(postgresdb);
#endregion #endregion
#region REST API #region REST API
var server = builder.AddProject<Projects.Clarity_Server>("server") var server = builder.AddProject<Projects.Clarity_Server>("server")
.WaitFor(keycloak)
.WithReference(cache) .WithReference(cache)
.WithReference(postgresdb) .WithReference(postgresdb)
.WaitFor(cache) .WaitFor(cache)
.WaitFor(postgresdb)
.WithReference(migrations) .WithReference(migrations)
.WithReference(minio) .WithReference(minio)
.WaitForCompletion(migrations) .WaitForCompletion(migrations)
@@ -60,11 +34,10 @@ var server = builder.AddProject<Projects.Clarity_Server>("server")
#region REACT #region REACT
var webfrontend = builder.AddViteApp("webfrontend", "../frontend") var webfrontend = builder.AddViteApp("webfrontend", "../frontend")
.WaitFor(keycloak)
.WithReference(server) .WithReference(server)
.WaitFor(server) .WaitFor(server)
.WithEnvironment("VITE_KEYCLOAK_URL", keycloak.GetEndpoint("http")) .WithEnvironment("VITE_KEYCLOAK_URL", "https://keycloak.clarity.test")
.WithEnvironment("VITE_KEYCLOAK_REALM", "clarity") .WithEnvironment("VITE_KEYCLOAK_REALM", "clarity-fdev-app-clarity-01000000")
.WithEnvironment("VITE_KEYCLOAK_CLIENT_ID", "clarity-web-app"); .WithEnvironment("VITE_KEYCLOAK_CLIENT_ID", "clarity-web-app");
server.PublishWithContainerFiles(webfrontend, "wwwroot"); server.PublishWithContainerFiles(webfrontend, "wwwroot");
@@ -4,5 +4,9 @@
"Default": "Information", "Default": "Information",
"Microsoft.AspNetCore": "Warning" "Microsoft.AspNetCore": "Warning"
} }
},
"ConnectionStrings": {
"postgresdb": "Host=localhost;Port=5432;Database=clarity_fdev_app_clarity_01000000;Username=postgres;Password=postgres",
"minio": "Endpoint=http://localhost:9000/;AccessKey=minioadmin;SecretKey=minioadmin"
} }
} }
+11 -6
View File
@@ -1,11 +1,12 @@
# -- Stage 1: Build Vite frontend --------------------------------------------- # -- Stage 1: Build Vite frontend ---------------------------------------------
# Build context is ClarityStack/ root so Directory.*.props are available.
FROM node:22-alpine AS frontend FROM node:22-alpine AS frontend
WORKDIR /frontend WORKDIR /frontend
COPY frontend/package.json frontend/package-lock.json* ./ COPY Clarity/frontend/package.json Clarity/frontend/package-lock.json* ./
RUN npm ci --legacy-peer-deps RUN npm ci --legacy-peer-deps
COPY frontend/ ./ COPY Clarity/frontend/ ./
RUN npm run build RUN npm run build
# Output lands in /frontend/dist # Output lands in /frontend/dist
@@ -13,13 +14,17 @@ RUN npm run build
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src WORKDIR /src
COPY ["Clarity.Server/Clarity.Server.csproj", "Clarity.Server/"] # Copy central package/build props first (at ClarityStack/ root)
COPY ["Clarity.ServiceDefaults/Clarity.ServiceDefaults.csproj", "Clarity.ServiceDefaults/"] COPY Directory.Packages.props ./
COPY ["Directory.Packages.props", "./"] COPY Directory.Build.props ./
COPY ["Clarity/Clarity.Server/Clarity.Server.csproj", "Clarity.Server/"]
COPY ["Clarity/Clarity.ServiceDefaults/Clarity.ServiceDefaults.csproj", "Clarity.ServiceDefaults/"]
RUN dotnet restore "Clarity.Server/Clarity.Server.csproj" RUN dotnet restore "Clarity.Server/Clarity.Server.csproj"
COPY . . # Copy only the Clarity/ subtree so OPC/, gateway/ etc. are excluded
COPY Clarity/ .
# Embed the Vite build into wwwroot (mirrors Aspire PublishWithContainerFiles) # Embed the Vite build into wwwroot (mirrors Aspire PublishWithContainerFiles)
COPY --from=frontend /frontend/dist ./Clarity.Server/wwwroot/ COPY --from=frontend /frontend/dist ./Clarity.Server/wwwroot/
+10 -3
View File
@@ -5,7 +5,14 @@
"Microsoft.AspNetCore": "Warning" "Microsoft.AspNetCore": "Warning"
} }
}, },
"ConnectionStrings": { "Keycloak": {
"postgresdb": "Host=localhost;Port=56235;Database=postgresdb;Username=postgres;Password=WdW+Q3wzq.Ssuzq6rT4A}_" "Realm": "clarity-fdev-app-clarity-01000000",
} "BaseUrl": "https://keycloak.clarity.test",
"InternalUrl": "http://localhost:8080"
},
"Vault": {
"Address": "http://localhost:8200",
"Token": "hvs.YLYBCUXgeJM3Gq4C10tWBWjw"
},
"Tenant__Id": "fdev-app-clarity-01000000"
} }
+8
View File
@@ -0,0 +1,8 @@
<Project>
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup>
</Project>
+43
View File
@@ -0,0 +1,43 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<!-- Aspire Packages -->
<ItemGroup>
<PackageVersion Include="Aspire.Hosting.PostgreSQL" Version="13.2.2" />
<PackageVersion Include="Aspire.Keycloak.Authentication" Version="13.2.2-preview.1.26207.2" />
<PackageVersion Include="Aspire.Npgsql.EntityFrameworkCore.PostgreSQL" Version="13.2.2" />
<PackageVersion Include="Aspire.StackExchange.Redis.OutputCaching" Version="13.2.2" />
<PackageVersion Include="Aspire.Hosting.JavaScript" Version="13.2.2" />
<PackageVersion Include="Aspire.Hosting.Keycloak" Version="13.2.2-preview.1.26207.2" />
<PackageVersion Include="Aspire.Hosting.Redis" Version="13.2.2" />
<PackageVersion Include="CommunityToolkit.Aspire.Hosting.Minio" Version="13.2.1-beta.532" />
<PackageVersion Include="CommunityToolkit.Aspire.Minio.Client" Version="13.2.1-beta.532" />
<PackageVersion Include="Docker.DotNet" Version="3.125.15" />
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="10.0.6" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.6" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Tools" Version="10.0.6" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="10.0.7" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.7" />
<PackageVersion Include="Npgsql" Version="10.0.2" />
<PackageVersion Include="LibGit2Sharp" Version="0.31.0" />
<PackageVersion Include="Scalar.Aspire" Version="0.9.24" />
<PackageVersion Include="VaultSharp" Version="1.17.5.1" />
<PackageVersion Include="Yarp.ReverseProxy" Version="2.3.0" />
</ItemGroup>
<!-- Clarity.MigrationService -->
<ItemGroup>
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="10.0.6" />
</ItemGroup>
<!-- Clarity.Server -->
<ItemGroup>
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="10.0.6" />
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="10.5.0" />
<PackageVersion Include="Microsoft.Extensions.ServiceDiscovery" Version="10.5.0" />
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.15.2" />
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.15.2" />
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.15.1" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.15.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Runtime" Version="1.15.0" />
</ItemGroup>
</Project>
+1 -1
View File
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.VisualStudio.JavaScript.Sdk/1.0.4110890"> <Project Sdk="Microsoft.VisualStudio.JavaScript.Sdk/1.0.4902498">
<PropertyGroup> <PropertyGroup>
<ShouldRunNpmInstall>false</ShouldRunNpmInstall> <ShouldRunNpmInstall>false</ShouldRunNpmInstall>
<ShouldRunBuildScript>false</ShouldRunBuildScript> <ShouldRunBuildScript>false</ShouldRunBuildScript>