Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Commit d1c5eb7

Browse files
committed
2 parents 4267d24 + f3a2d2f commit d1c5eb7

File tree

49 files changed

+953
-147
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+953
-147
lines changed

ServiceFabric/Linux/eShopOnServiceFabric/ApplicationPackageRoot/ApplicationManifest.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
66
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
77
<Parameters>
8+
<Parameter Name="OrderingBackground_InstanceCount" DefaultValue="-1" />
89
<Parameter Name="MarketingApi_InstanceCount" DefaultValue="-1" />
910
<Parameter Name="LocationsApi_InstanceCount" DefaultValue="-1" />
1011
<Parameter Name="PaymentApi_InstanceCount" DefaultValue="-1" />
@@ -19,6 +20,18 @@
1920
<!-- Import the ServiceManifest from the ServicePackage. The ServiceManifestName and ServiceManifestVersion
2021
should match the Name and Version attributes of the ServiceManifest element defined in the
2122
ServiceManifest.xml file. -->
23+
<ServiceManifestImport>
24+
<ServiceManifestRef ServiceManifestName="OrderingBackgroundPkg" ServiceManifestVersion="1.0.0" />
25+
<ConfigOverrides />
26+
<EnvironmentOverrides CodePackageRef="Code">
27+
<EnvironmentVariable Name="ApplicationInsights__InstrumentationKey" Value="[InstrumentationKey]"/>
28+
</EnvironmentOverrides>
29+
<Policies>
30+
<ContainerHostPolicies CodePackageRef="Code">
31+
<PortBinding ContainerPort="80" EndpointRef="OrderingBackgroundTypeEndpoint"/>
32+
</ContainerHostPolicies>
33+
</Policies>
34+
</ServiceManifestImport>
2235

2336
<ServiceManifestImport>
2437
<ServiceManifestRef ServiceManifestName="MarketingApiPkg" ServiceManifestVersion="1.0.0" />
@@ -99,6 +112,11 @@
99112
ServiceFabric PowerShell module.
100113
101114
The attribute ServiceTypeName below must match the name defined in the imported ServiceManifest.xml file. -->
115+
<Service Name="OrderingBackground" ServicePackageActivationMode="ExclusiveProcess">
116+
<StatelessService ServiceTypeName="OrderingBackgroundType" InstanceCount="[OrderingBackground_InstanceCount]">
117+
<SingletonPartition />
118+
</StatelessService>
119+
</Service>
102120

103121
<Service Name="MarketingApi" ServiceDnsName="marketingapi.eshoponservicefabric" ServicePackageActivationMode="ExclusiveProcess">
104122
<StatelessService ServiceTypeName="MarketingApiType" InstanceCount="[MarketingApi_InstanceCount]">

ServiceFabric/Linux/eShopOnServiceFabric/ApplicationPackageRoot/OrderingApiPkg/ServiceManifest.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
<EnvironmentVariable Name="EventBusConnection" Value="rabbitmq.eshoponservicefabricbus"/>
2929
<EnvironmentVariable Name="AzureServiceBusEnabled" Value="False"/>
3030
<EnvironmentVariable Name="UseCustomizationData" Value="True"/>
31-
<EnvironmentVariable Name="GracePeriodTime" Value="1"/>
32-
<EnvironmentVariable Name="CheckUpdateTime" Value="30000"/>
3331
<EnvironmentVariable Name="ApplicationInsights__InstrumentationKey" Value=""/>
3432
<EnvironmentVariable Name="OrchestratorType" Value="SF"/>
3533
<EnvironmentVariable Name="UseLoadTest" Value="True"/>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<Settings xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/2011/01/fabric">
3+
<!-- Add your custom configuration sections and parameters here -->
4+
<!--
5+
<Section Name="MyConfigSection">
6+
<Parameter Name="MyParameter" Value="Value1" />
7+
</Section>
8+
-->
9+
</Settings>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<ServiceManifest Name="OrderingBackgroundPkg"
3+
Version="1.0.0"
4+
xmlns="http://schemas.microsoft.com/2011/01/fabric"
5+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
6+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
7+
<ServiceTypes>
8+
<!-- This is the name of your ServiceType.
9+
The UseImplicitHost attribute indicates this is a guest service. -->
10+
<StatelessServiceType ServiceTypeName="OrderingBackgroundType" UseImplicitHost="true" />
11+
</ServiceTypes>
12+
13+
<!-- Code package is your service executable. -->
14+
<CodePackage Name="Code" Version="1.0.0">
15+
<EntryPoint>
16+
<!-- Follow this link for more information about deploying Windows containers to Service Fabric: https://aka.ms/sfguestcontainers -->
17+
<ContainerHost>
18+
<ImageName>eshop/ordering.backgroundtasks</ImageName>
19+
</ContainerHost>
20+
</EntryPoint>
21+
<!-- Pass environment variables to your container: -->
22+
<EnvironmentVariables>
23+
<EnvironmentVariable Name="ASPNETCORE_ENVIRONMENT" Value="Development"/>
24+
<EnvironmentVariable Name="ASPNETCORE_URLS" Value="http://0.0.0.0:80"/>
25+
<EnvironmentVariable Name="ConnectionString" Value="Data Source=sqlserver.eshoponservicefabricsql,5433;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word"/>
26+
<EnvironmentVariable Name="EventBusConnection" Value="rabbitmq.eshoponservicefabricbus"/>
27+
<EnvironmentVariable Name="AzureServiceBusEnabled" Value="False"/>
28+
<EnvironmentVariable Name="GracePeriodTime" Value="1"/>
29+
<EnvironmentVariable Name="CheckUpdateTime" Value="30000"/>
30+
<EnvironmentVariable Name="ApplicationInsights__InstrumentationKey" Value=""/>
31+
<EnvironmentVariable Name="OrchestratorType" Value="SF"/>
32+
<EnvironmentVariable Name="UseLoadTest" Value="True"/>
33+
</EnvironmentVariables>
34+
</CodePackage>
35+
36+
<!-- Config package is the contents of the Config directoy under PackageRoot that contains an
37+
independently-updateable and versioned set of custom configuration settings for your service. -->
38+
<ConfigPackage Name="Config" Version="1.0.0" />
39+
40+
<Resources>
41+
<Endpoints>
42+
<!-- This endpoint is used by the communication listener to obtain the port on which to
43+
listen. Please note that if your service is partitioned, this port is shared with
44+
replicas of different partitions that are placed in your code. -->
45+
<Endpoint Name="OrderingBackgroundTypeEndpoint" Port="5111" UriScheme="http"/>
46+
</Endpoints>
47+
</Resources>
48+
</ServiceManifest>

ServiceFabric/Linux/eShopOnServiceFabric/ApplicationParameters/Cloud.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Application Name="fabric:/eShopOnServiceFabric" xmlns="http://schemas.microsoft.com/2011/01/fabric" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
33
<Parameters>
4+
<Parameter Name="OrderingBackground_InstanceCount" Value="-1" />
45
<Parameter Name="MarketingApi_InstanceCount" Value="1" />
56
<Parameter Name="LocationsApi_InstanceCount" Value="1" />
67
<Parameter Name="PaymentApi_InstanceCount" Value="1" />

ServiceFabric/Linux/eShopOnServiceFabric/eShopOnServiceFabric.sfproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
<Content Include="ApplicationPackageRoot\MarketingApiPkg\ServiceManifest.xml" />
3939
<Content Include="ApplicationPackageRoot\OrderingApiPkg\Config\Settings.xml" />
4040
<Content Include="ApplicationPackageRoot\OrderingApiPkg\ServiceManifest.xml" />
41+
<Content Include="ApplicationPackageRoot\OrderingBackgroundPkg\Config\Settings.xml" />
42+
<Content Include="ApplicationPackageRoot\OrderingBackgroundPkg\ServiceManifest.xml" />
4143
<Content Include="ApplicationPackageRoot\PaymentApiPkg\Config\Settings.xml" />
4244
<Content Include="ApplicationPackageRoot\PaymentApiPkg\ServiceManifest.xml" />
4345
<Content Include="packages.config" />

ServiceFabric/Windows/eShopOnServiceFabric/ApplicationPackageRoot/ApplicationManifest.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
66
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
77
<Parameters>
8+
<Parameter Name="OrderingBackground_InstanceCount" DefaultValue="-1" />
89
<Parameter Name="MarketingApi_InstanceCount" DefaultValue="-1" />
910
<Parameter Name="LocationsApi_InstanceCount" DefaultValue="-1" />
1011
<Parameter Name="PaymentApi_InstanceCount" DefaultValue="-1" />
@@ -19,6 +20,18 @@
1920
<!-- Import the ServiceManifest from the ServicePackage. The ServiceManifestName and ServiceManifestVersion
2021
should match the Name and Version attributes of the ServiceManifest element defined in the
2122
ServiceManifest.xml file. -->
23+
<ServiceManifestImport>
24+
<ServiceManifestRef ServiceManifestName="OrderingBackgroundPkg" ServiceManifestVersion="1.0.0" />
25+
<ConfigOverrides />
26+
<EnvironmentOverrides CodePackageRef="Code">
27+
<EnvironmentVariable Name="ApplicationInsights:InstrumentationKey" Value="[InstrumentationKey]"/>
28+
</EnvironmentOverrides>
29+
<Policies>
30+
<ContainerHostPolicies CodePackageRef="Code">
31+
<PortBinding ContainerPort="80" EndpointRef="OrderingBackgroundTasksTypeEndpoint"/>
32+
</ContainerHostPolicies>
33+
</Policies>
34+
</ServiceManifestImport>
2235

2336
<ServiceManifestImport>
2437
<ServiceManifestRef ServiceManifestName="MarketingApiPkg" ServiceManifestVersion="1.0.0" />
@@ -99,6 +112,11 @@
99112
ServiceFabric PowerShell module.
100113
101114
The attribute ServiceTypeName below must match the name defined in the imported ServiceManifest.xml file. -->
115+
<Service Name="OrderingBackground" ServicePackageActivationMode="ExclusiveProcess">
116+
<StatelessService ServiceTypeName="OrderingBackgroundType" InstanceCount="[OrderingBackground_InstanceCount]">
117+
<SingletonPartition />
118+
</StatelessService>
119+
</Service>
102120

103121
<Service Name="MarketingApi" ServiceDnsName="marketingapi.eshoponservicefabric" ServicePackageActivationMode="ExclusiveProcess">
104122
<StatelessService ServiceTypeName="MarketingApiType" InstanceCount="[MarketingApi_InstanceCount]">

ServiceFabric/Windows/eShopOnServiceFabric/ApplicationPackageRoot/OrderingApiPkg/ServiceManifest.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
<EnvironmentVariable Name="EventBusConnection" Value="rabbitmq.eshoponservicefabricbus"/>
2929
<EnvironmentVariable Name="AzureServiceBusEnabled" Value="False"/>
3030
<EnvironmentVariable Name="UseCustomizationData" Value="True"/>
31-
<EnvironmentVariable Name="GracePeriodTime" Value="1"/>
32-
<EnvironmentVariable Name="CheckUpdateTime" Value="30000"/>
3331
<EnvironmentVariable Name="EventBusUserName" Value="admin"/>
3432
<EnvironmentVariable Name="EventBusPassword" Value="password"/>
3533
<EnvironmentVariable Name="ApplicationInsights:InstrumentationKey" Value=""/>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<Settings xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/2011/01/fabric">
3+
<!-- Add your custom configuration sections and parameters here -->
4+
<!--
5+
<Section Name="MyConfigSection">
6+
<Parameter Name="MyParameter" Value="Value1" />
7+
</Section>
8+
-->
9+
</Settings>
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<ServiceManifest Name="OrderingBackgroundPkg"
3+
Version="1.0.0"
4+
xmlns="http://schemas.microsoft.com/2011/01/fabric"
5+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
6+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
7+
<ServiceTypes>
8+
<!-- This is the name of your ServiceType.
9+
The UseImplicitHost attribute indicates this is a guest service. -->
10+
<StatelessServiceType ServiceTypeName="OrderingBackgroundType" UseImplicitHost="true" />
11+
</ServiceTypes>
12+
13+
<!-- Code package is your service executable. -->
14+
<CodePackage Name="Code" Version="1.0.0">
15+
<EntryPoint>
16+
<!-- Follow this link for more information about deploying Windows containers to Service Fabric: https://aka.ms/sfguestcontainers -->
17+
<ContainerHost>
18+
<ImageName>eshop/ordering.backgroundtasks-win</ImageName>
19+
</ContainerHost>
20+
</EntryPoint>
21+
<!-- Pass environment variables to your container: -->
22+
<EnvironmentVariables>
23+
<EnvironmentVariable Name="ASPNETCORE_ENVIRONMENT" Value="Development"/>
24+
<EnvironmentVariable Name="ASPNETCORE_URLS" Value="http://0.0.0.0:80"/>
25+
<EnvironmentVariable Name="ConnectionString" Value="Data Source=sqlserver.eshoponservicefabricsql,5433;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word"/>
26+
<EnvironmentVariable Name="EventBusConnection" Value="rabbitmq.eshoponservicefabricbus"/>
27+
<EnvironmentVariable Name="AzureServiceBusEnabled" Value="False"/>
28+
<EnvironmentVariable Name="GracePeriodTime" Value="1"/>
29+
<EnvironmentVariable Name="CheckUpdateTime" Value="30000"/>
30+
<EnvironmentVariable Name="EventBusUserName" Value="admin"/>
31+
<EnvironmentVariable Name="EventBusPassword" Value="password"/>
32+
<EnvironmentVariable Name="ApplicationInsights:InstrumentationKey" Value=""/>
33+
<EnvironmentVariable Name="OrchestratorType" Value="SF"/>
34+
<EnvironmentVariable Name="UseLoadTest" Value="False"/>
35+
</EnvironmentVariables>
36+
</CodePackage>
37+
38+
<!-- Config package is the contents of the Config directoy under PackageRoot that contains an
39+
independently-updateable and versioned set of custom configuration settings for your service. -->
40+
<ConfigPackage Name="Config" Version="1.0.0" />
41+
42+
<Resources>
43+
<Endpoints>
44+
<!-- This endpoint is used by the communication listener to obtain the port on which to
45+
listen. Please note that if your service is partitioned, this port is shared with
46+
replicas of different partitions that are placed in your code. -->
47+
<Endpoint Name="OrderingBackgroundTasksTypeEndpoint" Port="5111" UriScheme="http" PathSuffix="eShopOnServiceFabric/OrderingBackgroundTasks"/>
48+
</Endpoints>
49+
</Resources>
50+
</ServiceManifest>

0 commit comments

Comments
 (0)