background

This commit is contained in:
Erik Pique 2019-08-07 09:28:08 +02:00
parent 51070db87b
commit 0988dcd8c2
30 changed files with 467 additions and 16 deletions

View File

@ -13,6 +13,7 @@ $services = @(
@{ Name="eshopcatalog"; Image="eshop/catalog.api"; File="src/Services/Catalog/Catalog.API/Dockerfile" },
@{ Name="eshopidentity"; Image="eshop/identity.api"; File="src/Services/Identity/Identity.API/Dockerfile" },
@{ Name="eshopordering"; Image="eshop/ordering.api"; File="src/Services/Ordering/Ordering.API/Dockerfile" },
@{ Name="eshoporderingbg"; Image="eshop/ordering.backgroundtasks"; File="src/Services/Ordering/Ordering.BackgroundTasks/Dockerfile" },
@{ Name="eshopmarketing"; Image="eshop/marketing.api"; File="src/Services/Marketing/Marketing.API/Dockerfile" },
@{ Name="eshopwebspa"; Image="eshop/webspa"; File="src/Web/WebSPA/Dockerfile" },
@{ Name="eshopwebmvc"; Image="eshop/webmvc"; File="src/Web/WebMVC/Dockerfile" },

View File

@ -12,7 +12,7 @@ Write-Host "Tags used are linux-master, win-master, linux-dev, win-dev, linux-la
Write-Host "Multiarch images tags will be master, dev, latest" -ForegroundColor Yellow
$services = "identity.api", "basket.api", "catalog.api", "ordering.api", "marketing.api", "payment.api", "locations.api", "webhooks.api", "ocelotapigw", "mobileshoppingagg", "webshoppingagg", "ordering.signalrhub", "webstatus", "webspa", "webmvc", "webhooks.client"
$services = "identity.api", "basket.api", "catalog.api", "ordering.api", "ordering.backgroundtasks", "marketing.api", "payment.api", "locations.api", "webhooks.api", "ocelotapigw", "mobileshoppingagg", "webshoppingagg", "ordering.signalrhub", "webstatus", "webspa", "webmvc", "webhooks.client"
foreach ($svc in $services) {
Write-Host "Creating manifest for $svc and tags :latest, :master, and :dev"

View File

@ -68,6 +68,17 @@ services:
- AzureServiceBusEnabled=False
ports:
- "5102:80"
ordering.backgroundtasks:
environment:
- ASPNETCORE_ENVIRONMENT=Production
- 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}
- UseCustomizationData=True
- AzureServiceBusEnabled=False
ports:
- "5111:80"
webspa:
environment:

View File

@ -37,6 +37,11 @@ services:
- EventBusUserName=admin
- EventBusPassword=password
ordering.backgroundtasks:
environment:
- EventBusUserName=admin
- EventBusPassword=password
payment.api:
environment:
- EventBusUserName=admin

View File

@ -113,7 +113,26 @@ services:
- Serilog__MinimumLevel__Override__Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ=Verbose
- Serilog__MinimumLevel__Override__Ordering.API=Verbose
ports:
- "5102:80"
- "5102: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}
- Serilog__MinimumLevel__Override__Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ=Verbose
ports:
- "5111:80"
marketing.api:
environment:

View File

@ -91,6 +91,24 @@ 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

View File

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

View File

@ -57,7 +57,7 @@ if (-not [string]::IsNullOrEmpty($dockerUser)) {
# Push images to Docker registry
if ($pushImages) {
Write-Host "Pushing images to $registry/$dockerOrg..." -ForegroundColor Yellow
$services = ("basket.api", "catalog.api", "identity.api", "ordering.api", "marketing.api","payment.api","locations.api", "webmvc", "webspa", "webstatus", "ocelotapigw", "mobileshoppingagg", "webshoppingagg", "ordering.signalrhub")
$services = ("basket.api", "catalog.api", "identity.api", "ordering.api", "ordering.backgroundtasks", "marketing.api","payment.api","locations.api", "webmvc", "webspa", "webstatus", "ocelotapigw", "mobileshoppingagg", "webshoppingagg", "ordering.signalrhub")
foreach ($service in $services) {
$imageFqdn = if ($useDockerHub) {"$dockerOrg/${service}"} else {"$registry/$dockerOrg/${service}"}

View File

@ -68,7 +68,7 @@ if ($buildImages) {
if ($pushImages) {
Write-Host "Pushing images to $registry/$dockerOrg..." -ForegroundColor Yellow
$services = ("basket.api", "catalog.api", "identity.api", "ordering.api", "marketing.api","payment.api","locations.api", "webmvc", "webspa", "webstatus", "ocelotapigw", "mobileshoppingagg", "webshoppingagg", "ordering.signalrhub")
$services = ("basket.api", "catalog.api", "identity.api", "ordering.api", "ordering.backgroundtasks", "marketing.api","payment.api","locations.api", "webmvc", "webspa", "webstatus", "ocelotapigw", "mobileshoppingagg", "webshoppingagg", "ordering.signalrhub")
foreach ($service in $services) {
$imageFqdn = if ($useDockerHub) {"$dockerOrg/${service}"} else {"$registry/$dockerOrg/${service}"}

View File

@ -265,6 +265,65 @@ spec:
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: ordering-backgroundtasks
spec:
paused: true
template:
metadata:
labels:
app: eshop
component: ordering-backgroundtasks
spec:
containers:
- name: ordering-backgroundtasks
image: eshop/ordering.backgroundtasks
imagePullPolicy: Always
env:
- name: ConnectionString
valueFrom:
configMapKeyRef:
name: externalcfg
key: ordering__ConnectionString
- name: EventBusConnection
valueFrom:
configMapKeyRef:
name: externalcfg
key: all__EventBusConnection
- name: AzureServiceBusEnabled
valueFrom:
configMapKeyRef:
name: externalcfg
key: all__UseAzureServiceBus
- name: CheckUpdateTime
valueFrom:
configMapKeyRef:
name: externalcfg
key: GracePeriodManager__CheckUpdateTime
- name: GracePeriodTime
valueFrom:
configMapKeyRef:
name: externalcfg
key: GracePeriodManager__GracePeriodTime
- name: ApplicationInsights__InstrumentationKey
valueFrom:
configMapKeyRef:
name: externalcfg
key: all__InstrumentationKey
- name: UseLoadTest
valueFrom:
configMapKeyRef:
name: externalcfg
key: all__EnableLoadTest
- name: OrchestratorType
value: 'K8S'
ports:
- containerPort: 80
imagePullSecrets:
- name: registry-key
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: ordering-signalrhub
spec:

View File

@ -28,6 +28,7 @@ app: # app global settings
basket: basket # service name for basket api
catalog: catalog # service name for catalog api
ordering: ordering # service name for ordering api
orderingbackgroundtasks: orderingbackgroundtasks # service name for orderingbackgroundtasks
orderingsignalrhub: ordering-signalrhub # service name for orderingsignalrhub
identity: identity # service name for identity api
mvc: webmvc # service name for web mvc

View File

@ -80,7 +80,7 @@ if (-not [string]::IsNullOrEmpty($registry)) {
Write-Host "Begin eShopOnContainers installation using Helm" -ForegroundColor Green
$infras = ("sql-data", "nosql-data", "rabbitmq", "keystore-data", "basket-data")
$charts = ("eshop-common", "apigwmm", "apigwms", "apigwwm", "apigwws", "basket-api","catalog-api", "identity-api", "locations-api", "marketing-api", "mobileshoppingagg","ordering-api","ordering-signalrhub", "payment-api", "webmvc", "webshoppingagg", "webspa", "webstatus", "webhooks-api", "webhooks-web")
$charts = ("eshop-common", "apigwmm", "apigwms", "apigwwm", "apigwws", "basket-api","catalog-api", "identity-api", "locations-api", "marketing-api", "mobileshoppingagg","ordering-api","ordering-backgroundtasks","ordering-signalrhub", "payment-api", "webmvc", "webshoppingagg", "webspa", "webstatus", "webhooks-api", "webhooks-web")
if ($deployInfrastructure) {
foreach ($infra in $infras) {

View File

@ -62,7 +62,7 @@ if (-not [string]::IsNullOrEmpty($registry)) {
Write-Host "Begin eShopOnContainers installation using Helm" -ForegroundColor Green
$infras = ("sql-data", "nosql-data", "rabbitmq", "keystore-data", "basket-data")
$charts = ("eshop-common", "apigwmm", "apigwms", "apigwwm", "apigwws", "basket-api","catalog-api", "identity-api", "locations-api", "marketing-api", "mobileshoppingagg","ordering-api","ordering-signalrhub", "payment-api", "webmvc", "webshoppingagg", "webspa", "webstatus", "webhooks-api", "webhooks-web")
$charts = ("eshop-common", "apigwmm", "apigwms", "apigwwm", "apigwws", "basket-api","catalog-api", "identity-api", "locations-api", "marketing-api", "mobileshoppingagg","ordering-api","ordering-backgroundtasks","ordering-signalrhub", "payment-api", "webmvc", "webshoppingagg", "webspa", "webstatus", "webhooks-api", "webhooks-web")
if ($deployInfrastructure) {
foreach ($infra in $infras) {

View File

@ -185,7 +185,7 @@ fi
echo "#################### Begin $app_name installation using Helm ####################"
infras=(sql-data nosql-data rabbitmq keystore-data basket-data)
charts=(eshop-common apigwmm apigwms apigwwm apigwws basket-api catalog-api identity-api locations-api marketing-api mobileshoppingagg ordering-api ordering-signalrhub payment-api webmvc webshoppingagg webspa webstatus webhooks-api webhooks-web)
charts=(eshop-common apigwmm apigwms apigwwm apigwws basket-api catalog-api identity-api locations-api marketing-api mobileshoppingagg ordering-api ordering-backgroundtasks ordering-signalrhub payment-api webmvc webshoppingagg webspa webstatus webhooks-api webhooks-web)
if [[ !$skip_infrastructure ]]; then
for infra in "${infras[@]}"

View File

@ -258,6 +258,7 @@ fec1e3499416 a3f21ec4bd11 "/entrypoint.sh /ngi…"
76485867f032 eshop/payment.api "dotnet Payment.API.…" 2 hours ago Up 2 hours k8s_payment-api_eshop-payment-api-75d5f9bdf6-6zx2v_default_4a3cdab4-e67f-11e8-b4b6-00155d016146_1
c2c4640ed610 eshop/marketing.api "dotnet Marketing.AP…" 2 hours ago Up 2 hours k8s_marketing-api_eshop-marketing-api-6b8c5989fd-jpxqv_default_45780626-e67f-11e8-b4b6-00155d016146_1
85301d538574 eshop/ordering.signalrhub "dotnet Ordering.Sig…" 2 hours ago Up 2 hours k8s_ordering-signalrhub_eshop-ordering-signalrhub-58cf5ff6-cnlm8_default_4932c344-e67f-11e8-b4b6-00155d016146_1
7a408a98000e eshop/ordering.backgroundtasks "dotnet Ordering.Bac…" 2 hours ago Up 2 hours k8s_ordering-backgroundtasks_eshop-ordering-backgroundtasks-cc8f6d4d8-ztfk7_default_47f9cf10-e67f-11e8-b4b6-00155d016146_1
12c64b3a13e0 eshop/basket.api "dotnet Basket.API.d…" 2 hours ago Up 2 hours k8s_basket-api_eshop-basket-api-658546684d-6hlvd_default_4262d022-e67f-11e8-b4b6-00155d016146_1
133fccfeeff3 eshop/webstatus "dotnet WebStatus.dll" 2 hours ago Up 2 hours k8s_webstatus_eshop-webstatus-7f46479dc4-bqnq7_default_4dc13eb2-e67f-11e8-b4b6-00155d016146_0
00c6e4c52135 eshop/webspa "dotnet WebSPA.dll" 2 hours ago Up 2 hours k8s_webspa_eshop-webspa-64cb8df9cb-dcbwg_default_4cd47376-e67f-11e8-b4b6-00155d016146_0

View File

@ -0,0 +1,21 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj

View File

@ -0,0 +1,5 @@
apiVersion: v1
appVersion: "1.0"
description: A Helm chart for Kubernetes
name: ordering-backgroundtasks
version: 0.1.0

View File

@ -0,0 +1,3 @@
eShop Ordering Background Tasks installed.
------------------------------------------

View File

@ -0,0 +1,32 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "ordering-backgroundtasks.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "ordering-backgroundtasks.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "ordering-backgroundtasks.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

View File

@ -0,0 +1,51 @@
{{- define "suffix-name" -}}
{{- if .Values.app.name -}}
{{- .Values.app.name -}}
{{- else -}}
{{- .Release.Name -}}
{{- end -}}
{{- end -}}
{{- define "sql-name" -}}
{{- if .Values.inf.sql.host -}}
{{- .Values.inf.sql.host -}}
{{- else -}}
{{- printf "%s" "sql-data" -}}
{{- end -}}
{{- end -}}
{{- define "mongo-name" -}}
{{- if .Values.inf.mongo.host -}}
{{- .Values.inf.mongo.host -}}
{{- else -}}
{{- printf "%s" "nosql-data" -}}
{{- end -}}
{{- end -}}
{{- define "url-of" -}}
{{- $name := first .}}
{{- $ctx := last .}}
{{- if eq $name "" -}}
{{- $ctx.Values.inf.k8s.dns -}}
{{- else -}}
{{- printf "%s/%s" $ctx.Values.inf.k8s.dns $name -}} {{/*Value is just <dns>/<name> */}}
{{- end -}}
{{- end -}}
{{- define "pathBase" -}}
{{- if .Values.inf.k8s.suffix -}}
{{- $suffix := include "suffix-name" . -}}
{{- printf "%s-%s" .Values.pathBase $suffix -}}
{{- else -}}
{{- .Values.pathBase -}}
{{- end -}}
{{- end -}}
{{- define "fqdn-image" -}}
{{- if .Values.inf.registry -}}
{{- printf "%s/%s" .Values.inf.registry.server .Values.image.repository -}}
{{- else -}}
{{- .Values.image.repository -}}
{{- end -}}
{{- end -}}

View File

@ -0,0 +1,21 @@
{{- $name := include "ordering-backgroundtasks.fullname" . -}}
{{- $sqlsrv := include "sql-name" . -}}
{{- $cfgname := printf "cfg-%s" $name | trunc 63 }}
apiVersion: v1
kind: ConfigMap
metadata:
name: "{{ $cfgname }}"
labels:
app: {{ template "ordering-backgroundtasks.name" . }}
chart: {{ template "ordering-backgroundtasks.chart" .}}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
ordering__ConnectionString: Server={{ $sqlsrv }};Initial Catalog={{ .Values.inf.sql.ordering.db }};User Id={{ .Values.inf.sql.common.user }};Password={{ .Values.inf.sql.common.pwd }};
ordering__EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}"
all__EventBusConnection: {{ .Values.inf.eventbus.constr }}
all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}"
all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}"
graceperiodmanager__CheckUpdateTime: "{{ .Values.cfg.checkUpdateTime }}"
graceperiodmanager__GracePeriodTime: "{{ .Values.cfg.gracePeriodTime }}"

View File

@ -0,0 +1,92 @@
{{- $name := include "ordering-backgroundtasks.fullname" . -}}
{{- $cfgname := printf "cfg-%s" $name | trunc 63 }}
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: {{ template "ordering-backgroundtasks.fullname" . }}
labels:
app: {{ template "ordering-backgroundtasks.name" . }}
chart: {{ template "ordering-backgroundtasks.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ template "ordering-backgroundtasks.name" . }}
release: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ template "ordering-backgroundtasks.name" . }}
release: {{ .Release.Name }}
spec:
{{ if .Values.inf.registry -}}
imagePullSecrets:
- name: {{ .Values.inf.registry.secretName }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
{{ if .Values.probes -}}
{{- if .Values.probes.liveness -}}
livenessProbe:
httpGet:
port: {{ .Values.probes.liveness.port }}
path: {{ .Values.probes.liveness.path }}
initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.liveness.periodSeconds }}
{{- end -}}
{{- end -}}
{{- if .Values.probes -}}
{{- if .Values.probes.readiness }}
readinessProbe:
httpGet:
port: {{ .Values.probes.readiness.port }}
path: {{ .Values.probes.readiness.path }}
initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.readiness.periodSeconds }}
timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }}
{{- end -}}
{{- end }}
image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: PATH_BASE
value: {{ include "pathBase" . }}
- name: k8sname
value: {{ .Values.clusterName }}
{{- if .Values.env.values -}}
{{- range .Values.env.values }}
- name: {{ .name }}
value: {{ .value | quote }}
{{- end -}}
{{- end -}}
{{- if .Values.env.configmap -}}
{{- range .Values.env.configmap }}
- name: {{ .name }}
valueFrom:
configMapKeyRef:
name: {{ $cfgname }}
key: {{ .key }}
{{- end -}}
{{- end }}
ports:
- name: http
containerPort: 80
protocol: TCP
resources:
{{ toYaml .Values.resources | indent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}

View File

@ -0,0 +1,19 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.app.svc.orderingbackgroundtasks }}
labels:
app: {{ template "ordering-backgroundtasks.name" . }}
chart: {{ template "ordering-backgroundtasks.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
app: {{ template "ordering-backgroundtasks.name" . }}
release: {{ .Release.Name }}

View File

@ -0,0 +1,70 @@
replicaCount: 1
clusterName: eshop-aks
pathBase: /ordering-backgroundtasks
image:
repository: eshop/ordering.backgroundtasks
tag: latest
pullPolicy: IfNotPresent
service:
type: ClusterIP
port: 80
ingress:
enabled: false
annotations: {}
hosts:
- chart-example.local
tls: []
cfg:
checkUpdateTime: "15000"
gracePeriodTime: "1"
resources: {}
nodeSelector: {}
tolerations: []
affinity: {}
# env defines the environment variables that will be declared in the pod
env:
urls:
# configmap declares variables which value is taken from the config map defined in template configmap.yaml (name is name of var and key the key in configmap).
configmap:
- name: ConnectionString
key: ordering__ConnectionString
- name: ApplicationInsights__InstrumentationKey
key: all__InstrumentationKey
- name: EventBusConnection
key: all__EventBusConnection
- name: AzureServiceBusEnabled
key: all__UseAzureServiceBus
- name: UseLoadTest
key: ordering__EnableLoadTest
- name: CheckUpdateTime
key: graceperiodmanager__CheckUpdateTime
- name: GracePeriodTime
key: graceperiodmanager__GracePeriodTime
# values define environment variables with a fixed value (no configmap involved) (name is name of var, and value is its value)
values:
- name: ASPNETCORE_ENVIRONMENT
value: Development
- name: OrchestratorType
value: 'K8S'
probes:
liveness:
path: /liveness
initialDelaySeconds: 10
periodSeconds: 15
port: 80
readiness:
path: /hc
timeoutSeconds: 5
initialDelaySeconds: 90
periodSeconds: 60
port: 80

View File

@ -1,16 +1,23 @@
FROM mcr.microsoft.com/dotnet/core/runtime:3.0-buster-slim AS base
WORKDIR /app
EXPOSE 80
FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build
WORKDIR /src
COPY ["src/Services/Ordering/Ordering.BackgroundTasks/Ordering.BackgroundTasks.csproj", "src/Services/Ordering/Ordering.BackgroundTasks/"]
RUN dotnet restore "src/Services/Ordering/Ordering.BackgroundTasks/Ordering.BackgroundTasks.csproj"
COPY scripts scripts/
COPY src/ApiGateways/*/*.csproj /src/csproj-files/
COPY src/ApiGateways/*/*/*.csproj /src/csproj-files/
COPY src/BuildingBlocks/*/*/*.csproj /src/csproj-files/
COPY src/Services/*/*/*.csproj /src/csproj-files/
COPY src/Web/*/*.csproj /src/csproj-files/
COPY . .
WORKDIR "/src/src/Services/Ordering/Ordering.BackgroundTasks"
RUN dotnet build "Ordering.BackgroundTasks.csproj" -c Release -o /app
WORKDIR /src/src/Services/Ordering/Ordering.BackgroundTasks
RUN dotnet publish -c Release -o /app
FROM build AS publish
RUN dotnet publish "Ordering.BackgroundTasks.csproj" -c Release -o /app
FROM base AS final
WORKDIR /app

View File

@ -94,6 +94,7 @@ namespace Ordering.BackgroundTasks.Extensions
}
var retryCount = 5;
if (!string.IsNullOrEmpty(configuration["EventBusRetryCount"]))
{
retryCount = int.Parse(configuration["EventBusRetryCount"]);

View File

@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFramework>$(NetCoreTargetVersion)</TargetFramework>
<UserSecretsId>dotnet-Ordering.BackgroundTasks-9D3E1DD6-405B-447F-8AAB-1708B36D260E</UserSecretsId>
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<LangVersion>$(LangVersion)</LangVersion>
</PropertyGroup>

View File

@ -18,11 +18,11 @@ namespace Ordering.BackgroundTasks
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureAppConfiguration((hostContext, builder) =>
.ConfigureAppConfiguration((host, builder) =>
{
builder.SetBasePath(Directory.GetCurrentDirectory());
builder.AddJsonFile("appsettings.json", optional: true);
builder.AddJsonFile($"appsettings.{hostContext.HostingEnvironment.EnvironmentName}.json", optional: true);
builder.AddJsonFile($"appsettings.{host.HostingEnvironment.EnvironmentName}.json", optional: true);
builder.AddEnvironmentVariables();
builder.AddCommandLine(args);
})
@ -35,6 +35,7 @@ namespace Ordering.BackgroundTasks
services.AddHostedService<GracePeriodManagerService>();
services.AddEventBus(host.Configuration);
services.AddAutofac(container => container.Populate(services));
});
})
.UseServiceProviderFactory(new AutofacServiceProviderFactory());
}
}

View File

@ -20,6 +20,7 @@ COPY src/Services/Location/Locations.FunctionalTests/*.csproj /src/src/Services/
COPY src/Services/Marketing/Marketing.API/*.csproj /src/src/Services/Marketing/Marketing.API/
COPY src/Services/Marketing/Marketing.FunctionalTests/*.csproj /src/src/Services/Marketing/Marketing.FunctionalTests/
COPY src/Services/Ordering/Ordering.API/*.csproj /src/src/Services/Ordering/Ordering.API/
COPY src/Services/Ordering/Ordering.BackgroundTasks/*.csproj /src/src/Services/Ordering/Ordering.BackgroundTasks/
COPY src/Services/Ordering/Ordering.Domain/*.csproj /src/src/Services/Ordering/Ordering.Domain/
COPY src/Services/Ordering/Ordering.FunctionalTests/*.csproj /src/src/Services/Ordering/Ordering.FunctionalTests/
COPY src/Services/Ordering/Ordering.Infrastructure/*.csproj /src/src/Services/Ordering/Ordering.Infrastructure/

View File

@ -52,6 +52,9 @@ Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\Services\Ordering\Ordering.API"
Copy-Item "..\k8s\helm\app.yaml" -Destination ".\Services\Ordering\Ordering.SignalrHub" -Force
Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\Services\Ordering\Ordering.SignalrHub" -Force
Copy-Item "..\k8s\helm\app.yaml" -Destination ".\Services\Ordering\Ordering.BackgroundTasks" -Force
Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\Services\Ordering\Ordering.BackgroundTasks" -Force
Write-Host "Copying app.yaml and inf.yaml to Payment API" -ForegroundColor Yellow
Copy-Item "..\k8s\helm\app.yaml" -Destination ".\Services\Payment\Payment.API" -Force
Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\Services\Payment\Payment.API" -Force