Browse Source

Merge pull request #598 from mvelosop/fix/reenable-ordering-background-tasks

Include back ordering background tasks project and container
pull/604/head
Miguel Veloso 6 years ago
committed by GitHub
parent
commit
cffaf7dfd1
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 130 additions and 24 deletions
  1. +20
    -0
      docker-compose.override.yml
  2. +20
    -0
      docker-compose.prod.yml
  3. +9
    -0
      docker-compose.yml
  4. +51
    -0
      eShopOnContainers-ServicesAndWebApps.sln
  5. +1
    -0
      src/Web/WebStatus/Startup.cs
  6. +28
    -24
      src/Web/WebStatus/Views/Home/Index.cshtml
  7. +1
    -0
      src/Web/WebStatus/appsettings.json

+ 20
- 0
docker-compose.override.yml View File

@ -88,6 +88,25 @@ services:
- "5102:80" # Important: In a production environment your should remove the external port (5102) kept here for microservice debugging purposes.
# The API Gateway redirects and access through the internal port (80).
ordering.backgroundtasks:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://0.0.0.0:80
- ConnectionString=${ESHOP_AZURE_ORDERING_DB:-Server=sql.data;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word}
- EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq}
- EventBusUserName=${ESHOP_SERVICE_BUS_USERNAME}
- EventBusPassword=${ESHOP_SERVICE_BUS_PASSWORD}
- UseCustomizationData=True
- AzureServiceBusEnabled=False
- CheckUpdateTime=30000
- GracePeriodTime=1
- ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
- OrchestratorType=${ORCHESTRATOR_TYPE}
- UseLoadTest=${USE_LOADTEST:-False}
ports:
- "5111:80"
marketing.api:
environment:
- ASPNETCORE_ENVIRONMENT=Development
@ -158,6 +177,7 @@ services:
- ASPNETCORE_URLS=http://0.0.0.0:80
- CatalogUrl=http://catalog.api/hc
- OrderingUrl=http://ordering.api/hc
- OrderingBackgroundTasksUrl=http://ordering.backgroundtasks/hc
- BasketUrl=http://basket.api/hc
- IdentityUrl=http://identity.api/hc
- LocationsUrl=http://locations.api/hc


+ 20
- 0
docker-compose.prod.yml View File

@ -92,6 +92,25 @@ services:
ports:
- "80" # The API Gateway redirects and access through the internal port (80).
ordering.backgroundtasks:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://0.0.0.0:80
- ConnectionString=${ESHOP_AZURE_ORDERING_DB:-Server=sql.data;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word}
- EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq}
- EventBusUserName=${ESHOP_SERVICE_BUS_USERNAME}
- EventBusPassword=${ESHOP_SERVICE_BUS_PASSWORD}
- UseCustomizationData=True
- AzureServiceBusEnabled=False
- CheckUpdateTime=30000
- GracePeriodTime=1
- ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
- OrchestratorType=${ORCHESTRATOR_TYPE}
- UseLoadTest=${USE_LOADTEST:-False}
ports:
- "5111:80"
marketing.api:
environment:
- ASPNETCORE_ENVIRONMENT=Development
@ -161,6 +180,7 @@ services:
- ASPNETCORE_URLS=http://0.0.0.0:80
- CatalogUrl=http://catalog.api/hc
- OrderingUrl=http://ordering.api/hc
- OrderingBackgroundTasksUrl=http://ordering.backgroundtasks/hc
- BasketUrl=http://basket.api/hc
- IdentityUrl=http://identity.api/hc
- LocationsUrl=http://locations.api/hc


+ 9
- 0
docker-compose.yml View File

@ -38,6 +38,15 @@ services:
- sql.data
- rabbitmq
ordering.backgroundtasks:
image: eshop/ordering.backgroundtasks:${TAG:-latest}
build:
context: .
dockerfile: src/Services/Ordering/Ordering.BackgroundTasks/Dockerfile
depends_on:
- sql.data
- rabbitmq
marketing.api:
image: eshop/marketing.api:${TAG:-latest}
build:


+ 51
- 0
eShopOnContainers-ServicesAndWebApps.sln View File

@ -128,6 +128,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mobile.Shopping.HttpAggrega
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Web.Shopping.HttpAggregator", "src\ApiGateways\Web.Bff.Shopping\aggregator\Web.Shopping.HttpAggregator.csproj", "{AF0828DB-8BDD-411A-AEEF-B780FBB8D8C1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ordering.BackgroundTasks", "src\Services\Ordering\Ordering.BackgroundTasks\Ordering.BackgroundTasks.csproj", "{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Ad-Hoc|Any CPU = Ad-Hoc|Any CPU
@ -1486,6 +1488,54 @@ Global
{AF0828DB-8BDD-411A-AEEF-B780FBB8D8C1}.Release|x64.Build.0 = Release|Any CPU
{AF0828DB-8BDD-411A-AEEF-B780FBB8D8C1}.Release|x86.ActiveCfg = Release|Any CPU
{AF0828DB-8BDD-411A-AEEF-B780FBB8D8C1}.Release|x86.Build.0 = Release|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.Ad-Hoc|x64.Build.0 = Debug|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.Ad-Hoc|x86.Build.0 = Debug|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.AppStore|Any CPU.Build.0 = Debug|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.AppStore|ARM.ActiveCfg = Debug|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.AppStore|ARM.Build.0 = Debug|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.AppStore|iPhone.Build.0 = Debug|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.AppStore|x64.ActiveCfg = Debug|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.AppStore|x64.Build.0 = Debug|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.AppStore|x86.ActiveCfg = Debug|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.AppStore|x86.Build.0 = Debug|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.Debug|ARM.ActiveCfg = Debug|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.Debug|ARM.Build.0 = Debug|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.Debug|iPhone.Build.0 = Debug|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.Debug|x64.ActiveCfg = Debug|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.Debug|x64.Build.0 = Debug|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.Debug|x86.ActiveCfg = Debug|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.Debug|x86.Build.0 = Debug|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.Release|Any CPU.Build.0 = Release|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.Release|ARM.ActiveCfg = Release|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.Release|ARM.Build.0 = Release|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.Release|iPhone.ActiveCfg = Release|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.Release|iPhone.Build.0 = Release|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.Release|x64.ActiveCfg = Release|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.Release|x64.Build.0 = Release|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.Release|x86.ActiveCfg = Release|Any CPU
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -1541,6 +1591,7 @@ Global
{3F79558C-485D-49E1-BD3E-E12538D3D308} = {EC91ADE9-3D66-4AB2-9FB4-2B585E1F3531}
{BEA37D6D-4CF2-4AE8-9575-72388E54FBD0} = {0189E4FB-6E2B-4F2E-9B1D-5473D23FC6DB}
{AF0828DB-8BDD-411A-AEEF-B780FBB8D8C1} = {28C0F5C8-4849-4035-80AB-45639424E73F}
{2F2796B3-6386-4BD6-9A0D-BB3F2FB52404} = {0BD0DB92-2D98-44D9-9AC0-C59186D59B0B}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {25728519-5F0F-4973-8A64-0A81EB4EA8D9}


+ 1
- 0
src/Web/WebStatus/Startup.cs View File

@ -39,6 +39,7 @@ namespace WebStatus
}
checks.AddUrlCheckIfNotNull(Configuration["OrderingUrl"], TimeSpan.FromMinutes(minutes));
checks.AddUrlCheckIfNotNull(Configuration["OrderingBackgroundTasksUrl"], TimeSpan.FromMinutes(minutes));
checks.AddUrlCheckIfNotNull(Configuration["BasketUrl"], TimeSpan.Zero); //No cache for this HealthCheck, better just for demos
checks.AddUrlCheckIfNotNull(Configuration["CatalogUrl"], TimeSpan.FromMinutes(minutes));
checks.AddUrlCheckIfNotNull(Configuration["IdentityUrl"], TimeSpan.FromMinutes(minutes));


+ 28
- 24
src/Web/WebStatus/Views/Home/Index.cshtml View File

@ -1,13 +1,29 @@
@model WebStatus.Viewmodels.HealthStatusViewModel
@using Microsoft.AspNetCore.Html
@using Microsoft.Extensions.HealthChecks
@model WebStatus.Viewmodels.HealthStatusViewModel
@{
ViewData["Title"] = "System Status";
}
@functions
{
static readonly string[] LabelClass = new[] { "default", "danger", "success", "warning" };
public HtmlString StatusLabel(CheckStatus status)
{
return new HtmlString($@"<span class=""label label-{LabelClass[(int) status]}"">{status}</span>");
}
}
<style>.label {font-size: 100%}</style>
<div class="row">
<div class="col-md-12">
<h2 class="overall-status-title">Overall Status: @Model.OverallStatus</h2>
<h2 class="overall-status-title">Overall Status: @StatusLabel(Model.OverallStatus)</h2>
</div>
</div>
@ -15,33 +31,21 @@
@foreach (var result in Model.Results)
{
<div class="row list-group-status-item">
<div class="col-md-10">
<div class="col-md-9">
<h4 class="list-group-status-item-title">@result.Name</h4>
<p class="list-group-item-text">
@if (result.Result.Data.ContainsKey("url")) {
<p>@result.Result.Data["url"]</p>
@if (result.Result.Data.ContainsKey("url"))
{
<p>@result.Result.Data["url"]</p>
}
@result.Result.Description
<p class="text-@(LabelClass[(int)result.Result.CheckStatus])" style="font-weight:bold">
@result.Result.Description
</p>
</p>
</div>
<div class="col-md-2 list-group-status-item-label">
@if (@result.Result.CheckStatus == Microsoft.Extensions.HealthChecks.CheckStatus.Healthy)
{
<span class="label label-success">@result.Result.CheckStatus</span>
}
else if (@result.Result.CheckStatus == Microsoft.Extensions.HealthChecks.CheckStatus.Unhealthy)
{
<span class="label label-danger">@result.Result.CheckStatus</span>
}
else if (@result.Result.CheckStatus == Microsoft.Extensions.HealthChecks.CheckStatus.Warning)
{
<span class="label label-warning">@result.Result.CheckStatus</span>
}
else
{
<span class="label label-default">@result.Result.CheckStatus</span>
}
<div class="col-md-3">
<h3>@StatusLabel(result.Result.CheckStatus)</h3>
</div>
</div>
</div>
}
</div>

+ 1
- 0
src/Web/WebStatus/appsettings.json View File

@ -8,6 +8,7 @@
}
},
"OrderingUrl": "http://localhost:5102/hc",
"OrderingBackgroundTasksUrl": "http://localhost:5111/hc",
"BasketUrl": "http://localhost:5103/hc",
"CatalogUrl": "http://localhost:5101/hc",
"IdentityUrl": "http://localhost:5105/hc",


Loading…
Cancel
Save