Skip to content

Commit 9d7622a

Browse files
committed
Merge branch 'dev' into features/docker-multi-arch
2 parents cbda0dd + 1584ad0 commit 9d7622a

60 files changed

Lines changed: 573 additions & 797 deletions

File tree

Some content is hidden

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

NuGet.config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
3+
<config>
4+
<add key="repositoryPath" value="packages" />
5+
</config>
36
<packageSources>
47
<add key="AspNetCore" value="https://dotnet.myget.org/F/aspnet-feb2017-patch/api/v3/index.json" />
58
<add key="NuGet" value="https://api.nuget.org/v3/index.json" />

README.md

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
# eShopOnContainers - Microservices Architecture and Containers based Reference Application (**BETA state** - Visual Studio 2017 and CLI environments compatible)
22
Sample .NET Core reference application, powered by Microsoft, based on a simplified microservices architecture and Docker containers. <p>
3-
**Note Visual Studio 2017 version required**: This is important as of Oct. 11th 2017. For working with Docker and docker-compose files (needed with eShopOnContainers), do not migrate to VS 2017 15.4 as it has a bug when using TAGs in the docker-compose files.
4-
Please, either use VS 2017 15.35 or VS 2017 15.5 Preview 1 (bug is fixed here) or later.
3+
**Note Visual Studio 2017 version required**: This is important as of November 2017. For working with Docker and docker-compose files (needed with eShopOnContainers), do not migrate to VS 2017 15.4 as it has a bug when using TAGs in the docker-compose files.
4+
Please, either use VS 2017 15.35 or VS 2017 15.5 Preview (bug is fixed here) or later.
55
VS Preview installs next to your stable Visual Studio IDE, allowing you to use either independently.
66
Download of Preview here: https://www.visualstudio.com/vs/preview/
77

88
**Note for Pull Requests**: We accept pull request from the community. When doing it, please do it onto the DEV branch which is the consolidated work-in-progress branch. Do not request it onto Master, if possible.
99

10-
## Moving to .NET Core 2.0 "wave"
11-
NOTE: During August/September 2017 we'll be moving the solution to .NET Core "wave". Not just compilation but also new recommended code in EF Core 2.0, ASP.NET Core 2.0, and other new related versions.
10+
## Updated for .NET Core 2.0 "wave" of technologies
11+
NOTE: We have migrated the whole solution to .NET Core 2.0 "wave". Not just compilation but also new recommended code in EF Core 2.0, ASP.NET Core 2.0, and other new related versions.
12+
For a list on the new .NET Core 2.0 related implemented features, see this [blog post](https://blogs.msdn.microsoft.com/dotnet/2017/08/02/microservices-and-docker-containers-architecture-patterns-and-development-guidance/).
1213

1314
>**PLEASE** Read our [branch guide](./branch-guide.md) to know about our branching policy
1415
1516
> ### DISCLAIMER
16-
> **IMPORTANT:** The current state of this sample application is **BETA**, consider it version 0.1, a foundational version. Therefore, many areas could be improved and change significantly while refactoring current code and implementing new features. Feedback with improvements and pull requests from the community will be highly appreciated and accepted.
17+
> **IMPORTANT:** The current state of this sample application is **BETA**, because we are constantly evolving towards new released technologies. Therefore, many areas could be improved and change significantly while refactoring current code and implementing new features. Feedback with improvements and pull requests from the community will be highly appreciated and accepted.
1718
>
1819
> This reference application proposes a simplified microservice oriented architecture implementation to introduce technologies like .NET Core with Docker containers through a comprehensive application. The chosen domain is an eShop/eCommerce but simply because it is a well-know domain by most people/developers.
1920
However, this sample application should not be considered as an "eCommerce reference model", at all. The implemented business domain might not be ideal from an eCommerce business point of view. It is neither trying to solve all the problems in a large, scalable and mission-critical distributed system. It is just a bootstrap for developers to easily get started in the world of Docker containers and microservices with .NET Core.
20-
> <p>For example, the next step (still not covered in eShopOnContainers) after understanding Docker containers and microservices development with .NET Core, is to select a microservice cluster/orchestrator like Docker Swarm, Kubernetes or DC/OS (in Azure Container Service) or Azure Service Fabric which in most of the cases will require additional partial changes to your application's configuration (although the present architecture should work on most orchestrators with small changes).
21-
> Additional steps would be to move your databases to HA cloud services, or to implement your EventBus with Azure Service Bus or any other production ready Service Bus in the market.
22-
> <p> In the future we might fork this project and make multiple versions targeting specific microservice cluster/orchestrators plus using additional cloud infrastructure. <p>
21+
> <p>For example, the next step after running the solution in the local dev PC and understanding Docker containers and microservices development with .NET Core, is to select a microservice cluster/orchestrator like Kubernetes in Azure or Azure Service Fabric, both environments tested and supported by this solution.
22+
> Additional steps would be to move your databases to HA cloud services (like Azure SQL Database), or to implement your EventBus with Azure Service Bus or any other production ready Service Bus in the market.
23+
> <p>
2324
> <img src="img/exploring-to-production-ready.png">
2425
> Read the planned <a href='https://github.com/dotnet/eShopOnContainers/wiki/01.-Roadmap-and-Milestones-for-future-releases'>Roadmap and Milestones for future releases of eShopOnContainers</a> within the Wiki for further info about possible new implementations and provide feedback at the <a href='https://github.com/dotnet/eShopOnContainers/issues'>ISSUES section</a> if you'd like to see any specific scenario implemented or improved. Also, feel free to discuss on any current issue.
2526
@@ -59,11 +60,13 @@ You can download them and start reviewing these Guides/eBooks here:
5960
| Architecting & Developing | Containers Lifecycle & CI/CD | App patterns with Xamarin.Forms |
6061
| ------------ | ------------| ------------|
6162
| <a href='https://aka.ms/microservicesebook'><img src="img/ebook_arch_dev_microservices_containers_cover.png"> </a> | <a href='https://aka.ms/dockerlifecycleebook'> <img src="img/ebook_containers_lifecycle.png"> </a> | <a href='https://aka.ms/xamarinpatternsebook'> <img src="img/xamarin-enterprise-patterns-ebook-cover-small.png"> </a> |
62-
| <sup> <a href='https://aka.ms/microservicesebook'>**Download** (First Edition)</a> </sup> | <sup> <a href='https://aka.ms/dockerlifecycleebook'>**Download** (First Edition) </a> </sup> | <sup> <a href='https://aka.ms/xamarinpatternsebook'>**Download** (First Edition) </a> </sup> |
63+
| <sup> <a href='https://aka.ms/microservicesebook'>**Download .PDF** (2nd Edition)</a> </sup> | <sup> <a href='https://aka.ms/dockerlifecycleebook'>**Download** (First Edition) </a> </sup> | <sup> <a href='https://aka.ms/xamarinpatternsebook'>**Download** (First Edition) </a> </sup> |
64+
65+
Download in other formats (**eReaders** like **MOBI**, **EPUB**) and other eBooks at the [.NET Architecture center](dot.net/architecture).
6366

6467
Send feedback to [dotnet-architecture-ebooks-feedback@service.microsoft.com](dotnet-architecture-ebooks-feedback@service.microsoft.com)
65-
<p>
66-
However, we encourage to download and review the "Architecting & Developing eBook" because the architectural styles and architectural patterns and technologies explained in the guidance are using this reference application when explaining many pattern implementations, so you'll understand much better the context, design and decisions taken in the current architecture and internal designs.
68+
69+
However, we encourage to download and review the [Architecting and Developing Microservices eBook](https://aka.ms/microservicesebook) because the architectural styles and architectural patterns and technologies explained in the guidance are using this reference application when explaining many pattern implementations, so you'll understand much better the context, design and decisions taken in the current architecture and internal designs.
6770

6871
## Overview of the application code
6972
In this repo you can find a sample reference application that will help you to understand how to implement a microservice architecture based application using <b>.NET Core</b> and <b>Docker</b>.
@@ -82,7 +85,7 @@ Finally, those microservices are consumed by multiple client web and mobile apps
8285
<b>*MVC Application (ASP.NET Core)*</b>: It's an MVC application where you can find interesting scenarios on how to consume HTTP-based microservices from C# running in the server side, as it is a typical ASP.NET Core MVC application. Since it is a server-side application, access to other containers/microservices is done within the internal Docker Host network with its internal name resolution.
8386
<img src="img/eshop-webmvc-app-screenshot.png">
8487
<br>
85-
<b>*SPA (Single Page Application)*</b>: Providing similar "eShop business functionality" but developed with Angular 2, Typescript and slightly using ASP.NET Core MVC. This is another approach for client web applications to be used when you want to have a more modern client behavior which is not behaving with the typical browser round-trip on every action but behaving like a Single-Page-Application which is more similar to a desktop app usage experience. The consumption of the HTTP-based microservices is done from TypeScript/JavaScript in the client browser, so the client calls to the microservices come from out of the Docker Host internal network (Like from your network or even from the Internet).
88+
<b>*SPA (Single Page Application)*</b>: Providing similar "eShop business functionality" but developed with Angular, Typescript and slightly using ASP.NET Core MVC. This is another approach for client web applications to be used when you want to have a more modern client behavior which is not behaving with the typical browser round-trip on every action but behaving like a Single-Page-Application which is more similar to a desktop app usage experience. The consumption of the HTTP-based microservices is done from TypeScript/JavaScript in the client browser, so the client calls to the microservices come from out of the Docker Host internal network (Like from your network or even from the Internet).
8689
<img src="img/eshop-webspa-app-screenshot.png">
8790
<br>
8891
<b>*Xamarin Mobile App (For iOS, Android and Windows/UWP)*</b>: It is a client mobile app supporting the most common mobile OS platforms (iOS, Android and Windows/UWP). In this case, the consumption of the microservices is done from C# but running on the client devices, so out of the Docker Host internal network (Like from your network or even the Internet).
@@ -99,12 +102,11 @@ For those who prefer the CLI on Windows, using dotnet CLI, docker CLI and VS Cod
99102
https://github.com/dotnet/eShopOnContainers/wiki/03.-Setting-the-eShopOnContainers-solution-up-in-a-Windows-CLI-environment-(dotnet-CLI,-Docker-CLI-and-VS-Code)
100103

101104
### CLI and Mac based
102-
For those who prefer the CLI on a Mac, using dotnet CLI, docker CLI and VS Code for Mac
103-
(Instructions still TBD, but similar to Windows CLI):
104-
https://github.com/dotnet/eShopOnContainers/wiki/04.-Setting-eShopOnContainer-solution-up-in-a-Mac,-VS-Code-and-CLI-environment--(dotnet-CLI,-Docker-CLI-and-VS-Code)
105+
For those who prefer the CLI on a Mac, using dotnet CLI, docker CLI and VS Code for Mac:
106+
https://github.com/dotnet-architecture/eShopOnContainers/wiki/04.-Setting-eShopOnContainer-solution-up-in-a-Mac,-VS-for-Mac-or-with-CLI-environment--(dotnet-CLI,-Docker-CLI-and-VS-Code)
105107

106108
## Orchestrators: Kubernetes and Service Fabric
107-
See at the Wiki the posts on setup/instructions about how to deploy to Kubernetes or Service Fabric in Azure (although you could also deploy to any other cloud or on-premises).
109+
See at the [Wiki](https://github.com/dotnet-architecture/eShopOnContainers/wiki) the posts on setup/instructions about how to deploy to Kubernetes or Service Fabric in Azure (although you could also deploy to any other cloud or on-premises).
108110

109111
## Sending feedback and pull requests
110112
As mentioned, we'd appreciate your feedback, improvements and ideas.

deploy/az/createresources.sh

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
#!/bin/bash
2+
3+
CreateGroup()
4+
{
5+
echo Creating resource group $resource_group in '$location'
6+
az group create --name $resource_group --location $location
7+
} # end of CreateGroup()
8+
9+
10+
11+
deployresources()
12+
{
13+
echo Deploying ARM template '$path_and_filename.json' in resource group $resource_group
14+
az group deployment create --resource-group $resource_group --parameters @$path_and_filename.parameters.json --template-file $path_and_filename.json
15+
} # end of deployresources
16+
17+
Error_Usage()
18+
{
19+
echo ""
20+
echo Usage:
21+
echo create-resources arm-file resource-group-name [-c location]
22+
echo arm-file: Path to ARM template WITHOUT .json extension. An parameter file with same name plus '.parameters' MUST exist in same folder
23+
echo resource-grop-name: Name of the resource group to use or create
24+
echo -c: If appears means that resource group must be created. If -c is specified, must use enter location
25+
echo ""
26+
echo Examples:
27+
echo "1 create-resources path_and_filename testgroup (Deploys path_and_filename.json with parameters specified in path_and_filename.parameters.json file)."
28+
echo "2 create-resources path_and_filename newgroup -c westus (Deploys path_and_filename.json (with parameters specified in path_and_filename.parameters.json file) in a NEW resource group named newgroup in the westus location)"
29+
}
30+
31+
32+
33+
if [ $# -le 1 ]; then
34+
Error_Usage
35+
exit 1
36+
fi
37+
if [ "$1" == "" ]; then
38+
echo "path_and_filename is empty"
39+
Error_Usage
40+
exit 1
41+
fi
42+
43+
if [ "$2" == "" ]; then
44+
echo "Resource Group is empty"
45+
Error_Usage
46+
exit 1
47+
fi
48+
49+
if [ ! -f "$1.json" ]; then
50+
echo "$1.json doesn't exist"
51+
exit 1
52+
fi
53+
54+
if [ ! -f "$2.parameters.json" ]; then
55+
echo "$2.parameters.json doesn't exist"
56+
exit 1
57+
fi
58+
59+
60+
path_and_filename=$1
61+
resource_group=$2
62+
63+
64+
if [ "$3" == "-c" ]; then
65+
echo "Resource Group needs to be created"
66+
if [ "$4" == "" ]; then
67+
echo "but Resource Group name is missing"
68+
Error_Usage
69+
exit 1
70+
else
71+
location=$4
72+
CreateGroup
73+
fi
74+
75+
fi
76+
deployresources
77+
78+
echo "all resources finished successfully"

deploy/az/readme.md

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,37 @@
1+
12
# Deploying resources using create-resources script
23

3-
The `create-resources` script is a basic script to allow easy deployment of one ARM template in one resource group. You can deploy to an existing resource group or to create one.
4+
The `create-resources.cmd ` script is a basic script to allow easy deployment of one ARM template in one resource group. You can deploy to an existing resource group or to create one.
5+
6+
**NOTE**: Alternatively, you can also use the `createresources.sh` bash script which can be used as a second option, convenient if you are using the Azure Cloud Bash Shell, a Mac or Linux machine, or simply, bash on Windows, instead of CMD/CommandPrompt in a local Windows
7+
8+
## Deploying to a existing resource group - Windows CMD
9+
10+
Just type `create-resources [pathfile-to-arm-template] resourcegroup` from command-prompt. Called this way the script will:
11+
12+
1. Search for `path-to-arm-template.json` and `path-to-arm-template.parameters.json` files
13+
2. If they exist, will deploy them in the `resourcegroup` specified (that resource group in Azure has to exist).
14+
15+
## Deploying to a new resource group - Windows CMD
16+
17+
Just type `create-resources [pathfile-to-arm-template] resourcegroup -c location`. Called this way the script will:
18+
19+
1. Search for `path-to-arm-template.json` and `path-to-arm-template.parameters.json` files
20+
2. If they exist, will create the `resourcegroup` specified in the `location` specified.
21+
3. Finally will deploy `path-to-arm-template.json` and `path-to-arm-template.parameters.json` files in the `resourcegroup`
22+
23+
424

5-
## Deploying to a existing resource group
25+
## Deploying to a existing resource group - Bash shell
626

7-
Just type `create-resources path-to-arm-template resourcegroup`. Called this way the script will:
27+
Just type `createresources.sh [pathfile-to-arm-template] resourcegroup` from command-prompt. Called this way the script will:
828

929
1. Search for `path-to-arm-template.json` and `path-to-arm-template.parameters.json` files
10-
2. If they exist, will deploy them in the `resourcegroup` specified (that has to exist).
30+
2. If they exist, will deploy them in the `resourcegroup` specified (that resource group in Azure has to exist).
1131

12-
## Deploying to a new resource group
32+
## Deploying to a new resource group - Bash shell
1333

14-
Just type `create-resources path-to-arm-template resourcegroup -c location`. Called this way the script will:
34+
Just type `createresources.sh [pathfile-to-arm-template] resourcegroup -c location`. Called this way the script will:
1535

1636
1. Search for `path-to-arm-template.json` and `path-to-arm-template.parameters.json` files
1737
2. If they exist, will create the `resourcegroup` specified in the `location` specified.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)