Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
1e3784a
wip fixing error
connorivy Sep 5, 2025
b50ff39
wip adding aot support
connorivy Sep 5, 2025
abb6789
wip adding aot support
connorivy Sep 5, 2025
ca5ad8c
wip AOT
connorivy Sep 5, 2025
9cb71b9
wip AOT: identity
connorivy Sep 5, 2025
09efc1f
wip AOT: common.api
connorivy Sep 5, 2025
b7f5abb
wip aot: application
connorivy Sep 8, 2025
0c213e7
wip aot: contracts
connorivy Sep 8, 2025
f6a9a66
tweak package visibility
connorivy Sep 9, 2025
4ec8fff
remove web dependency in endpoints
connorivy Sep 9, 2025
1c8c2ad
consolidate common
connorivy Sep 9, 2025
ccf92fa
move endpoints back
connorivy Sep 9, 2025
2ed380e
part 2
connorivy Sep 9, 2025
c630bcd
move contracts
connorivy Sep 9, 2025
dea76d3
pt2
connorivy Sep 9, 2025
fc9396f
use contract suffix
connorivy Sep 10, 2025
ee136ce
more contract suffixes
connorivy Sep 10, 2025
4a1e426
move domain over
connorivy Sep 10, 2025
7b1f3a0
build props changes
connorivy Sep 10, 2025
0118932
add application layer
connorivy Sep 10, 2025
c27eafd
Revert "more contract suffixes"
connorivy Sep 10, 2025
a7b19e2
Revert "use contract suffix"
connorivy Sep 10, 2025
c0da488
Revert "pt2"
connorivy Sep 10, 2025
eb6ade9
Revert "move contracts"
connorivy Sep 10, 2025
2c88ff9
fix build
connorivy Sep 10, 2025
c0d7fd2
add endpoints proj
connorivy Sep 10, 2025
7b7e645
add sdk
connorivy Sep 10, 2025
f0f890f
add sdk
connorivy Sep 10, 2025
28e1fa7
add source gen di
connorivy Sep 11, 2025
b590137
fix formatting and devcontainer permissions
connorivy Sep 11, 2025
641a19e
wip: making everything internal
connorivy Sep 11, 2025
65adcb7
remove all command types!
connorivy Sep 11, 2025
232fe3d
wip fix sdk project
connorivy Sep 11, 2025
d080b90
all tests passing except arch
connorivy Sep 12, 2025
85746d9
don't hate me for commenting out tests
connorivy Sep 12, 2025
394e9a0
try build and ignore link errors
connorivy Sep 12, 2025
05d0883
wip on local tests passing
connorivy Sep 12, 2025
553747e
fix local storage error
connorivy Sep 13, 2025
f8eb956
fix original backend version
connorivy Sep 13, 2025
aa50bf2
minor di fix
connorivy Sep 13, 2025
727edb0
wip adding sqlite
connorivy Sep 14, 2025
1f9e825
wip on sqlite backend
connorivy Sep 14, 2025
622269d
sqlite is working
connorivy Sep 15, 2025
8bb879f
wip aot
connorivy Sep 15, 2025
c9dade8
wip aot
connorivy Sep 16, 2025
b2ec3f5
bump ef version
connorivy Sep 16, 2025
79f381d
use source gen serialization
connorivy Sep 17, 2025
c3f0686
wip on aot but I'm blocked
connorivy Sep 18, 2025
da1c6d0
fix web projects
connorivy Sep 18, 2025
64d7941
fix webapp and remove some dependencies
connorivy Sep 19, 2025
a3b8e46
remove test explorer for now to reduce frontend deps
connorivy Sep 19, 2025
b66ac38
add id incrementation for proposal entities
connorivy Sep 19, 2025
815f684
fix ef core compiled model build
connorivy Sep 19, 2025
d89d707
execute sql instead of using ensureCreated
connorivy Sep 19, 2025
c83ac15
wip: switching back to in memory
connorivy Sep 22, 2025
4def082
fix tests for in memory
connorivy Sep 23, 2025
2784e3b
add switch for testing backend inmemory
connorivy Sep 23, 2025
e8fb372
minor fixes
connorivy Sep 23, 2025
28a3bad
wip on fixing python building
connorivy Sep 23, 2025
ee6559b
wip adding python support
connorivy Sep 27, 2025
3a2cdc5
update dotwrap package
connorivy Sep 29, 2025
1637e68
Merge remote-tracking branch 'origin/main' into fix-warnings
connorivy Sep 30, 2025
b1ac674
minor tweaks
connorivy Oct 1, 2025
dae05e7
not ready for package
connorivy Oct 1, 2025
a8418f1
bump tunit
connorivy Oct 2, 2025
5f29830
use sync hook
connorivy Oct 2, 2025
8ec3b95
console logs
connorivy Oct 2, 2025
521ef67
try this
connorivy Oct 2, 2025
37e58e1
undo parallel disable
connorivy Oct 2, 2025
e80da4e
downgrade tunit
connorivy Oct 2, 2025
7446412
Revert "downgrade tunit"
connorivy Oct 3, 2025
04e0fce
some logging
connorivy Oct 3, 2025
5919d62
net 9
connorivy Oct 3, 2025
f124dd0
better logging
connorivy Oct 3, 2025
4f69f58
lock setup method
connorivy Oct 3, 2025
aa9bcc8
add required sdk deps
connorivy Oct 3, 2025
7c3a40c
Merge remote-tracking branch 'origin' into tweak-serialization
connorivy Oct 3, 2025
b5ade59
update ef tool version
connorivy Oct 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"rollForward": false
},
"dotnet-ef": {
"version": "10.0.0-rc.1.25451.107",
"version": "9.0.9",
"commands": [
"dotnet-ef"
],
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -385,4 +385,5 @@ python_project_root/
DotWrap/
# /tests/BeamOs.Tests.Common/SolvedProblems/**/*.g.cs

*.user.props
*.user.props
*.user.cs
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
<PackageVersion Include="Testcontainers.MsSql" Version="4.1.0" />
<PackageVersion Include="Testcontainers.PostgreSql" Version="4.1.0" />
<PackageVersion Include="TngTech.ArchUnitNET" Version="0.11.3" />
<PackageVersion Include="TUnit" Version="0.61.13" />
<PackageVersion Include="TUnit" Version="0.63.3" />
<PackageVersion Include="Verify" Version="30.18.0" />
<PackageVersion Include="Verify.SourceGenerators" Version="2.5.0" />
<PackageVersion Include="Verify.TUnit" Version="30.18.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ public async Task GenerateClients()

if (!Path.Exists(this.DestinationPath))
{
Directory.CreateDirectory(this.DestinationPath);
throw new DirectoryNotFoundException(
$"Destination path '{this.DestinationPath}' not found."
);
}

await File.WriteAllTextAsync(
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "10.0.0",
"version": "9.0.0",
"rollForward": "latestMinor"
}
}
1 change: 1 addition & 0 deletions scripts/codegen.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
BEAMOS_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"

Expand Down
38 changes: 37 additions & 1 deletion src/Common/BeamOs.Common.Api/BeamOsBaseEndpointExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,26 @@

namespace BeamOs.Common.Api;

public static class BeamOsBaseEndpointExtensions
internal static class BeamOsBaseEndpointExtensions
{
extension<TRequest, TResponse>(BeamOsBaseEndpoint<TRequest, TResponse> result)
{
/// <summary>
/// Do not remove. This method says 0 usages, but that is not true. It is used instead of ExecuteAsync when
/// generating strongly typed api clients
/// </summary>
/// <param name="req"></param>
/// <param name="ct"></param>
/// <returns></returns>
#pragma warning disable CA1822 // Mark members as static
internal TResponse GetResponseTypeForClientGenerationPurposes(
#pragma warning restore CA1822 // Mark members as static
)
{
return default!;
}
}

extension<TResponse>(Result<TResponse> result)
{
/// <summary>
Expand Down Expand Up @@ -66,6 +84,24 @@ [EnumeratorCancellation] CancellationToken ct
}
#endif
}
public static class BeamOsBaseEndpointMoreExtensions
{
extension<TResponse>(Result<TResponse> result)
where TResponse : IResult
{
#pragma warning disable IDE0060 // Remove unused parameter
public IResult ToWebResult(CancellationToken ct = default)
#pragma warning restore IDE0060 // Remove unused parameter
{
if (result.IsSuccess)
{
return TypedResults.Ok(result.Value);
}
return BeamOsErrorUtils.MapErrorToResult(result.Error);
}
}
}


internal static class BeamOsErrorUtils
{
Expand Down
6 changes: 3 additions & 3 deletions src/Identity/BeamOs.Identity/IUserApiTokenService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public interface IUserApiTokenService
{
public Task<Result<ApiTokenResponse>> CreateToken(CreateApiTokenRequest token);

public Task<Result<List<ApiTokenResponse>>> GetTokens();
public Task<Result<ICollection<ApiTokenResponse>>> GetTokens();

public Task RevokeToken(string tokenName);
}
Expand Down Expand Up @@ -46,9 +46,9 @@ public Task<Result<ApiTokenResponse>> CreateToken(CreateApiTokenRequest token)
return Task.FromResult(result);
}

public Task<Result<List<ApiTokenResponse>>> GetTokens()
public Task<Result<ICollection<ApiTokenResponse>>> GetTokens()
{
Result<List<ApiTokenResponse>> result = this.apiTokenResponses;
Result<ICollection<ApiTokenResponse>> result = this.apiTokenResponses;
return Task.FromResult(result);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Reflection;
using BeamOs.Common.Api;
using BeamOs.StructuralAnalysis.Infrastructure;
using BeamOs.StructuralAnalysis.Sdk;
using Microsoft.EntityFrameworkCore;
using ServiceScan.SourceGenerator;

Expand Down Expand Up @@ -84,6 +85,17 @@ public static async Task InitializeBeamOsDb(this WebApplication app)
{
using var scope = app.Services.CreateScope();
await BeamOs.StructuralAnalysis.Infrastructure.DependencyInjection.MigrateDb(scope);

var apiClient = scope.ServiceProvider.GetRequiredService<BeamOsResultApiClient>();
foreach (var model in Tests.Common.AllSolvedProblems.ModelFixtures())
{
if (await model.CreateOnly(apiClient))
{
await apiClient
.Models[model.Id]
.Analyze.Opensees.RunOpenSeesAnalysisAsync(new());
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ private async Task RunTclWithOpenSees(string tclFileWithPath, string outputDir)
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
if (Directory.Exists("/root/OpenSees/build/bin"))
if (Directory.Exists("/opt/OpenSees/build/bin"))
{
// i don't know why, but the executable is much faster when built in the docker container
exePath = "/root/OpenSees/build/bin/OpenSees";
exePath = "/opt/OpenSees/build/bin/OpenSees";
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

namespace BeamOs.StructuralAnalysis.Domain.PhysicalModel.ModelAggregate;

internal record struct ModelCreatedEvent(Guid ModelId, int? UserId = null)
public record struct ModelCreatedEvent(Guid ModelId, int? UserId = null)
: IDomainEvent,
INotification;
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@
}

private ApiUsageResponse? UsageSummary;
private List<ApiTokenResponse>? ApiTokens;
private ICollection<ApiTokenResponse>? ApiTokens;

protected override async Task OnInitializedAsync()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,29 @@ public ModelPageState(IReadOnlyCollection<ModelInfoResponse> modelResponses)

static ModelPageState()
{
List<ModelInfoResponse> sampleModels = [];
SampleModelResponses =
[
new(
Guid.Parse("4ce66084-4ac1-40bc-99ae-3d0f334c66fa"),
"Twisty Bowl Framing",
"A crazy twisting bowl type structure. Made by Bjorn Steinhagen in grasshopper and then sent to beamOS using Speckle",
new ModelSettings(
unitSettings: new UnitSettingsContract
{
LengthUnit = LengthUnitContract.Inch,
ForceUnit = ForceUnitContract.KilopoundForce,
AngleUnit = AngleUnitContract.Radian,
},
analysisSettings: new AnalysisSettings
{
Element1DAnalysisType = Element1dAnalysisType.Timoshenko,
},
yAxisUp: true
),
DateTimeOffset.Parse("2023-11-01T12:00:00Z"),
"Sample"
),
];
// foreach (var modelBuilder in AllSolvedProblems.ModelFixtures())
// {
// // Only add sample models from SAP2000 because they look the coolest
Expand All @@ -43,6 +65,5 @@ static ModelPageState()
// )
// );
// }
SampleModelResponses = sampleModels;
}
}
3 changes: 2 additions & 1 deletion tests/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
<PropertyGroup>
<TUnitImplictUsings>false</TUnitImplictUsings>
<BeamOsStructuralAnalysisSdkRef>false</BeamOsStructuralAnalysisSdkRef>
<UseBeamOsPackage Condition="'$(ContinuousIntegrationEnv)' == 'true' or '$(BeamOsVersion)' != ''">true</UseBeamOsPackage>
<!-- <UseBeamOsPackage Condition="'$(ContinuousIntegrationEnv)' == 'true' or '$(BeamOsVersion)' != ''">true</UseBeamOsPackage> -->
<UseBeamOsPackage>false</UseBeamOsPackage>
</PropertyGroup>

<!-- Use project references locally, but use nuget package in CI -->
Expand Down
Loading
Loading