diff --git a/Makefile b/Makefile index d5f77fb..4a6dc6b 100644 --- a/Makefile +++ b/Makefile @@ -82,13 +82,22 @@ clean : clean-packages clean-template-pack @echo Done cleaning @echo -build : - dotnet restore orleans-template-dev.sln - dotnet build --no-restore orleans-template-dev.sln - dotnet test --no-build orleans-template-dev.sln +build : dn-clean-project dn-restore-project dn-build-project dn-test-project @echo Done Building Projects @echo +dn-clean-project : + - dotnet clean orleans-template-dev.sln + +dn-restore-project : + dotnet restore --force orleans-template-dev.sln + +dn-build-project : + dotnet build --no-restore orleans-template-dev.sln + +dn-test-project : + dotnet test --no-build orleans-template-dev.sln + setup-templates : clean-template-pack copy-template-pack pack-template-pack install-template-pack @echo Done Setting Up Templates @echo @@ -136,8 +145,10 @@ copy-single-template.silo-and-client : copy-single-template.% : copy-common.% $(MAKE) source=$(proto_root)-$(lang)/standalone-client target=$(copy_target_root)/$*-$(lang)/Template.Client copy $(MAKE) src_project_file=standalone-silo/standalone-silo.$(projsuffix) dest_project_file=$*-$(lang)/Template.Silo/Template.Silo.$(projsuffix) replace-project-reference-with-nuget-reference $(MAKE) src_project_file=standalone-client/standalone-client.$(projsuffix) dest_project_file=$*-$(lang)/Template.Client/Template.Client.$(projsuffix) replace-project-reference-with-nuget-reference - $(MAKE) replace_pattern=_PROJ_SUFFIX_ replacement_pattern=$(projsuffix) replace_in_file=Template.Silo.Makefile template=$* replace-pattern - $(MAKE) replace_pattern=_PROJ_SUFFIX_ replacement_pattern=$(projsuffix) replace_in_file=Template.Client.Makefile template=$* replace-pattern + $(MAKE) replace_pattern=_PROJ_SUFFIX_ replacement_pattern=$(projsuffix) replace_in_file=Template.Silo.Makefile template=$* replace-pattern + $(MAKE) replace_pattern=_PROJ_SUFFIX_ replacement_pattern=$(projsuffix) replace_in_file=Template.Client.Makefile template=$* replace-pattern + $(MAKE) replace_pattern=_PROJ_SUFFIX_ replacement_pattern=$(projsuffix) replace_in_file=Template.Silo.Dockerfile template=$* replace-pattern + $(MAKE) replace_pattern=_PROJ_SUFFIX_ replacement_pattern=$(projsuffix) replace_in_file=Template.Client.Dockerfile template=$* replace-pattern copy-common.% : copy-grains.% copy-grain-tests.% copy-templates.% copy-ignores.% @echo Copied Common Components For $* [$(lang)] @@ -207,7 +218,12 @@ test-template.% : template=$(basename $*) test-template.% : $(MAKE) lang=$(lang) template=$(template) test-scratch-project -test-scratch-project : create-scratch-project +test-scratch-project : create-scratch-project test-dotnet-flow test-docker-flow + +test-docker-flow : + $(MAKE) -C $(test_install_root)/$(lang)/$(template)/ docker-build + +test-dotnet-flow : $(MAKE) -C $(test_install_root)/$(lang)/$(template)/ dotnet-secrets-init dotnet-build dotnet-test create-scratch-project : diff --git a/proto-csharp/grain-controllers/grain-controllers.csproj b/proto-csharp/grain-controllers/grain-controllers.csproj index a0e761c..c218591 100644 --- a/proto-csharp/grain-controllers/grain-controllers.csproj +++ b/proto-csharp/grain-controllers/grain-controllers.csproj @@ -11,8 +11,8 @@ - - + + diff --git a/proto-csharp/grain-tests/grain-tests.csproj b/proto-csharp/grain-tests/grain-tests.csproj index 069f6c9..6b96a40 100644 --- a/proto-csharp/grain-tests/grain-tests.csproj +++ b/proto-csharp/grain-tests/grain-tests.csproj @@ -10,37 +10,37 @@ - - + + - + - - - - - - - - + + + + + + + + - - + + - + runtime; build; native; contentfiles; analyzers all - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/proto-csharp/grains/grains.csproj b/proto-csharp/grains/grains.csproj index f97fe98..e70ef6c 100644 --- a/proto-csharp/grains/grains.csproj +++ b/proto-csharp/grains/grains.csproj @@ -12,9 +12,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/proto-csharp/standalone-client/standalone-client.csproj b/proto-csharp/standalone-client/standalone-client.csproj index ff4d2bc..3d081c9 100644 --- a/proto-csharp/standalone-client/standalone-client.csproj +++ b/proto-csharp/standalone-client/standalone-client.csproj @@ -6,16 +6,16 @@ - - + + - - - - - + + + + + diff --git a/proto-csharp/standalone-silo/standalone-silo.csproj b/proto-csharp/standalone-silo/standalone-silo.csproj index 723f680..00d3c03 100644 --- a/proto-csharp/standalone-silo/standalone-silo.csproj +++ b/proto-csharp/standalone-silo/standalone-silo.csproj @@ -20,32 +20,32 @@ - - - - - - - - + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - + diff --git a/proto-csharp/webapi-directclient/webapi-directclient.csproj b/proto-csharp/webapi-directclient/webapi-directclient.csproj index 7e62d4c..ba4009f 100644 --- a/proto-csharp/webapi-directclient/webapi-directclient.csproj +++ b/proto-csharp/webapi-directclient/webapi-directclient.csproj @@ -20,41 +20,41 @@ - - - - - - - - + + + + + + + + - + - - + + - - - - - - - - - - - + + + + + + + + + + + - + diff --git a/proto-fsharp/grain-controllers/grain-controllers.fsproj b/proto-fsharp/grain-controllers/grain-controllers.fsproj index e678cbd..1d4417d 100644 --- a/proto-fsharp/grain-controllers/grain-controllers.fsproj +++ b/proto-fsharp/grain-controllers/grain-controllers.fsproj @@ -11,13 +11,13 @@ - + - - - + + + diff --git a/proto-fsharp/grain-tests/grain-tests.fsproj b/proto-fsharp/grain-tests/grain-tests.fsproj index bd4f773..aa64099 100644 --- a/proto-fsharp/grain-tests/grain-tests.fsproj +++ b/proto-fsharp/grain-tests/grain-tests.fsproj @@ -11,42 +11,42 @@ - + - - + + - - + + - - - - - - - - + + + + + + + + - - + + - + runtime; build; native; contentfiles; analyzers all - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/proto-fsharp/grains/grains.fsproj b/proto-fsharp/grains/grains.fsproj index 9533961..8fef358 100644 --- a/proto-fsharp/grains/grains.fsproj +++ b/proto-fsharp/grains/grains.fsproj @@ -12,13 +12,13 @@ - + - - - + + + diff --git a/proto-fsharp/standalone-client/standalone-client.fsproj b/proto-fsharp/standalone-client/standalone-client.fsproj index 5080f8f..60887a0 100644 --- a/proto-fsharp/standalone-client/standalone-client.fsproj +++ b/proto-fsharp/standalone-client/standalone-client.fsproj @@ -7,21 +7,21 @@ - + - - + + - - - - - - + + + + + + diff --git a/proto-fsharp/standalone-silo/standalone-silo.fsproj b/proto-fsharp/standalone-silo/standalone-silo.fsproj index 9459b4b..33f534d 100644 --- a/proto-fsharp/standalone-silo/standalone-silo.fsproj +++ b/proto-fsharp/standalone-silo/standalone-silo.fsproj @@ -19,36 +19,36 @@ - + - - - - - - - - + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - + diff --git a/proto-fsharp/webapi-directclient/webapi-directclient.fsproj b/proto-fsharp/webapi-directclient/webapi-directclient.fsproj index e6a5a00..c90a553 100644 --- a/proto-fsharp/webapi-directclient/webapi-directclient.fsproj +++ b/proto-fsharp/webapi-directclient/webapi-directclient.fsproj @@ -20,46 +20,46 @@ - + - - - - - - - - + + + + + + + + - + - - + + - - - - - - - - - - - - + + + + + + + + + + + + - + diff --git a/templates/silo-and-client/Makefile b/templates/silo-and-client/Makefile index 19e2bef..716e4dc 100644 --- a/templates/silo-and-client/Makefile +++ b/templates/silo-and-client/Makefile @@ -5,7 +5,7 @@ # project name project:=Template -project-lc:=$(shell powershell \"$(project)\".ToLower\(\)) +project-lc:=$(shell echo $(project) | tr A-Z a-z) silo=Template.Silo client=Template.Client diff --git a/templates/silo-and-client/Template.Client.Dockerfile b/templates/silo-and-client/Template.Client.Dockerfile index 020f31d..f805a5e 100644 --- a/templates/silo-and-client/Template.Client.Dockerfile +++ b/templates/silo-and-client/Template.Client.Dockerfile @@ -2,7 +2,7 @@ FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build ARG config=Release COPY . "/src" -RUN dotnet restore "/src/Template.Client/Template.Client._PROJ_SUFFIX_" -c ${config} +RUN dotnet restore "/src/Template.Client/Template.Client._PROJ_SUFFIX_" RUN dotnet build --no-restore "/src/Template.Client/Template.Client._PROJ_SUFFIX_" -c ${config} RUN dotnet test --no-build "/src/Template.Client/Template.Client._PROJ_SUFFIX_" -c ${config} RUN dotnet publish --no-build "/src/Template.Client/Template.Client._PROJ_SUFFIX_" -c ${config} -o /app @@ -13,7 +13,7 @@ WORKDIR /app # # set up variables to allow the docker image to run by default with Azure clustering and Azure persistence on Azure Storage Emulator on the host -ENV ENV_CLUSTER_MODE "Azure" +ENV ENV_CLUSTER_MODE "Azure" # ENV ENV_CLUSTERING_DEV_STORAGE "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://host.docker.internal:10000/devstoreaccount1;TableEndpoint=http://host.docker.internal:10002/devstoreaccount1;QueueEndpoint=http://host.docker.internal:10001/devstoreaccount1;" # diff --git a/templates/silo-and-client/Template.Client.Makefile b/templates/silo-and-client/Template.Client.Makefile index 1d706ef..426d878 100644 --- a/templates/silo-and-client/Template.Client.Makefile +++ b/templates/silo-and-client/Template.Client.Makefile @@ -5,7 +5,7 @@ # project name project:=Template.Client -project-lc:=$(shell powershell \"$(project)\".ToLower\(\)) +project-lc:=$(shell echo $(project) | tr A-Z a-z) # project configuration config:=Debug diff --git a/templates/silo-and-client/Template.Silo.Dockerfile b/templates/silo-and-client/Template.Silo.Dockerfile index 7d1ecca..0c7bf08 100644 --- a/templates/silo-and-client/Template.Silo.Dockerfile +++ b/templates/silo-and-client/Template.Silo.Dockerfile @@ -2,7 +2,7 @@ FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build ARG config=Release COPY . "/src" -RUN dotnet restore "/src/Template.Silo/Template.Silo._PROJ_SUFFIX_" -c ${config} +RUN dotnet restore "/src/Template.Silo/Template.Silo._PROJ_SUFFIX_" RUN dotnet build --no-restore "/src/Template.Silo/Template.Silo._PROJ_SUFFIX_" -c ${config} RUN dotnet test --no-build "/src/Template.Silo/Template.Silo._PROJ_SUFFIX_" -c ${config} RUN dotnet publish --no-build "/src/Template.Silo/Template.Silo._PROJ_SUFFIX_" -c ${config} -o /app diff --git a/templates/silo-and-client/Template.Silo.Makefile b/templates/silo-and-client/Template.Silo.Makefile index 694916a..65241a2 100644 --- a/templates/silo-and-client/Template.Silo.Makefile +++ b/templates/silo-and-client/Template.Silo.Makefile @@ -6,7 +6,7 @@ # project name project:=Template.Silo -project-lc:=$(shell powershell \"$(project)\".ToLower\(\)) +project-lc:=$(shell echo $(project) | tr A-Z a-z) # project configuration config:=Debug diff --git a/templates/standalone-client/Dockerfile b/templates/standalone-client/Dockerfile index 4094972..86043e6 100644 --- a/templates/standalone-client/Dockerfile +++ b/templates/standalone-client/Dockerfile @@ -2,7 +2,7 @@ FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build ARG config=Release COPY . "/src" -RUN dotnet restore "/src/Template/Template._PROJ_SUFFIX_" -c ${config} +RUN dotnet restore "/src/Template/Template._PROJ_SUFFIX_" RUN dotnet build --no-restore "/src/Template/Template._PROJ_SUFFIX_" -c ${config} RUN dotnet test --no-build "/src/Template/Template._PROJ_SUFFIX_" -c ${config} RUN dotnet publish --no-build "/src/Template/Template._PROJ_SUFFIX_" -c ${config} -o /app diff --git a/templates/standalone-client/Makefile b/templates/standalone-client/Makefile index 6eddb10..adbedca 100644 --- a/templates/standalone-client/Makefile +++ b/templates/standalone-client/Makefile @@ -5,7 +5,7 @@ # project name project:=Template -project-lc:=$(shell powershell \"$(project)\".ToLower\(\)) +project-lc:=$(shell echo $(project) | tr A-Z a-z) # project configuration config:=Debug diff --git a/templates/standalone-silo/Dockerfile b/templates/standalone-silo/Dockerfile index e87f297..9e8e823 100644 --- a/templates/standalone-silo/Dockerfile +++ b/templates/standalone-silo/Dockerfile @@ -2,7 +2,7 @@ FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build ARG config=Release COPY . "/src" -RUN dotnet restore "/src/Template/Template._PROJ_SUFFIX_" -c ${config} +RUN dotnet restore "/src/Template/Template._PROJ_SUFFIX_" RUN dotnet build --no-restore "/src/Template/Template._PROJ_SUFFIX_" -c ${config} RUN dotnet test --no-build "/src/Template/Template._PROJ_SUFFIX_" -c ${config} RUN dotnet publish --no-build "/src/Template/Template._PROJ_SUFFIX_" -c ${config} -o /app diff --git a/templates/standalone-silo/Makefile b/templates/standalone-silo/Makefile index 49b87f1..9865731 100644 --- a/templates/standalone-silo/Makefile +++ b/templates/standalone-silo/Makefile @@ -6,7 +6,7 @@ # project name project:=Template -project-lc:=$(shell powershell \"$(project)\".ToLower\(\)) +project-lc:=$(shell echo $(project) | tr A-Z a-z) # project configuration config:=Debug diff --git a/templates/webapi-directclient/Dockerfile b/templates/webapi-directclient/Dockerfile index 7242d5e..86780ae 100644 --- a/templates/webapi-directclient/Dockerfile +++ b/templates/webapi-directclient/Dockerfile @@ -2,7 +2,7 @@ FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build ARG config=Release COPY . "/src" -RUN dotnet restore "/src/Template/Template._PROJ_SUFFIX_" -c ${config} +RUN dotnet restore "/src/Template/Template._PROJ_SUFFIX_" RUN dotnet build --no-restore "/src/Template/Template._PROJ_SUFFIX_" -c ${config} RUN dotnet test --no-build "/src/Template/Template._PROJ_SUFFIX_" -c ${config} RUN dotnet publish --no-build "/src/Template/Template._PROJ_SUFFIX_" -c ${config} -o /app diff --git a/templates/webapi-directclient/Makefile b/templates/webapi-directclient/Makefile index 49b87f1..9865731 100644 --- a/templates/webapi-directclient/Makefile +++ b/templates/webapi-directclient/Makefile @@ -6,7 +6,7 @@ # project name project:=Template -project-lc:=$(shell powershell \"$(project)\".ToLower\(\)) +project-lc:=$(shell echo $(project) | tr A-Z a-z) # project configuration config:=Debug diff --git a/universal-silo/Client.fs b/universal-silo/Client.fs index 4aa0b4c..af8cc7e 100644 --- a/universal-silo/Client.fs +++ b/universal-silo/Client.fs @@ -14,6 +14,8 @@ open System.Net open System.Threading open System.Threading.Tasks open Orleans.Contrib.UniversalSilo.Configuration +open Orleans.Clustering.AzureStorage + type HostBuilderContext = Microsoft.Extensions.Hosting.HostBuilderContext type private ClusterClientHostedService(clusterClient : IClusterClient) = class diff --git a/universal-silo/SiloConfigurator.fs b/universal-silo/SiloConfigurator.fs index dedcbd5..d86a818 100644 --- a/universal-silo/SiloConfigurator.fs +++ b/universal-silo/SiloConfigurator.fs @@ -1,7 +1,6 @@ namespace Orleans.Contrib.UniversalSilo open Microsoft.Extensions.Configuration -open Microsoft.AspNetCore.Diagnostics.HealthChecks open Microsoft.Extensions.Logging open Orleans open Orleans.Configuration @@ -9,6 +8,8 @@ open Orleans.Hosting open Orleans.Contrib.UniversalSilo.Configuration open System open System.Net +open Orleans.Clustering.AzureStorage +open Orleans.Reminders.AzureStorage type HostBuilderContext = Microsoft.Extensions.Hosting.HostBuilderContext @@ -130,21 +131,6 @@ type SiloConfigurator() = class siloSettings.ClusteringConfiguration.ClusteringMode); siloBuilder.UseDashboard(); - abstract ConfigureProcessExitHandlingOptions : IConfiguration -> UniversalSiloConfiguration -> ISiloBuilder -> ISiloBuilder - default __.ConfigureProcessExitHandlingOptions configuration siloSettings siloBuilder = - let fastKillOnProcessExit = - match siloSettings.ClusteringConfiguration.ClusteringMode with - | ClusteringModes.Kubernetes | ClusteringModes.Docker -> true - | _ -> false - - logger.LogInformation( - "`FastKillOnProcessExit = {FastKillOnProcessExit}` for clustering mode {ClusteringMode}", - fastKillOnProcessExit, - siloSettings.ClusteringConfiguration.ClusteringMode) - - siloBuilder.Configure(fun (options : ProcessExitHandlingOptions) -> - options.FastKillOnProcessExit <- fastKillOnProcessExit) - abstract ConfigureApplicationParts : ISiloBuilder -> ISiloBuilder default __.ConfigureApplicationParts siloBuilder = siloBuilder.ConfigureApplicationParts(fun parts -> @@ -183,7 +169,6 @@ type SiloConfigurator() = class |> this.ConfigureStorageProvider hostBuilderContext.Configuration configuration |> this.ConfigureApplicationInsights hostBuilderContext.Configuration configuration |> this.ConfigureDashboard hostBuilderContext.Configuration configuration - |> this.ConfigureProcessExitHandlingOptions hostBuilderContext.Configuration configuration |> this.ConfigureApplicationParts |> ignore end diff --git a/universal-silo/universal-silo.fsproj b/universal-silo/universal-silo.fsproj index 363c6e8..614004d 100644 --- a/universal-silo/universal-silo.fsproj +++ b/universal-silo/universal-silo.fsproj @@ -21,42 +21,42 @@ - - - - - - - - + + + + + + + + - + - - + + - - - - - - - - - - - - + + + + + + + + + + + + - + @@ -65,10 +65,10 @@ - + - +