dotnet-architecture / eShopOnContainers

Cross-platform .NET sample microservices and container based application that runs on Linux Windows and macOS. Powered by .NET 7, Docker Containers and Azure Kubernetes Services. Supports Visual Studio, VS for Mac and CLI based environments with Docker CLI, dotnet CLI, VS Code or any other code editor. Moved to https://github.com/dotnet/eShop.
https://dot.net/architecture
24.54k stars 10.36k forks source link

[QUESTION] Please, answer +1 if the solution is working properly for you (Through VS2017 or CLI environment) #107

Closed CESARDELATORRE closed 5 years ago

CESARDELATORRE commented 7 years ago

A small favor, can you answer +1 to this thread if the solution is working for you (Through VS2017 or CLI environment)? - Bits compilation-Deploy-Run in Docker. We'd like to know if the environment/solution is working for most of the people or not.

Better if you specify what environment you are using, like answering any of the following:

+1 (VS2017) +1 (CLI) +1 (Both)

Answer with a -1 if you have issues and you couldn't make it work (compile/deploy/run to Docker), any of the following:

-1 (VS2017) -1 (CLI) -1 (Both)

We could create a survey, but we're not looking for specific statistics jus a sense of how it is working for the majority, and this way based on issues might be quicker for you guys than going to surveymonkey or anything like that.

Thank you! :)

kifjj commented 7 years ago

+1 (Windows CLI, on Win10 Entr, RAM 7GB, got a lot of problems with SQL Container, managed to make it work after assigning docker 4352 MB and freeing RAM) ... wondering what HW is required to develop seriously with containers in real world scenarios. Any points?

CESARDELATORRE commented 7 years ago

@kifjj That's why we mentioned to set at least 4096 MB of memory to Docker and recommend a 16GB ram machine in the setup instructions. Take into account that this is only because SQL Server container requirements in a dev or testing environment where you spin everything up as containers. In a real production environment it is recommended to take out the DBs from Docker and put your Databases in a High Available system like Azure SQL DBA or a SQL Server cluster, on-premises. So the memory you'd need for that would be less. Your microservices using .NET Core need very small amounts of memory, so you can have many and that won't be, usually, the issue in dev-test environments. For a development/testing Docker environment, a 16GB machine would be good for most of the scenarios. It depends on how many "infrastructure containers" (like SQL, Redis and others) you have included. But usually, 16GB would be good to go for most dev/test environments. For production, it really depends how scalable you'll need your system to be. When using an orchestrator (not just Docker) like Docker Swarm, Kubernetes, Meals DCOS in Azure Container Service or using Azure Service Fabric, it will depend on how many instances per microservice-type you want to have for high scalability. Not just memory but number of VMs, as well. In short, HW requirements? it really depends on how large is your application in regards infrastructure (that impacts dev/test) and how scalable you want it to be in production

CESARDELATORRE commented 7 years ago

+1 (Both environments, CLI & VS2017) - Windows 10 Enterprise, RAM 16GB. Testing on Multiple machines. :)

HarshaRaikar commented 7 years ago

Hi CESAR

I am getting timeout error when the MVC application first starts. At: CatalogService.cs line 54. dataString = await _apiClient.GetStringAsync(catalogUrl);

VS2017, windows 10 , 16GB RAM

HarshaRaikar commented 7 years ago

Oops. It was docker memory i guess. I set it to 4096MB and it started working now. :)

dsrodenas commented 7 years ago

+1 (VS2017) - Windows 10 Enterprise, RAM 16GB

harrchen commented 7 years ago

I tried to install the solution to Server 2016 with VS2017 without success. There doesn't seem to be a suitable docker installation for Windows 2016. I tried to install docker via powershell but cannot find a way to perform necessary configuration as outlined in this document. The reason I want to use Windows 2016 is that I cannot create a windows 10 image in my azure subscription.

harrchen commented 7 years ago

Also just realized that docker for windows will not work for Azure VMs. As such, is there a way to have the eShop sample app setup and running in Azure?

kifjj commented 7 years ago

@CESARDELATORRE thanks for your explanation. Everything makes sense, just a point I am missing. Since in prod SQL Srv will not be in a container (which makes total sense) wouldn't be better to keep it out even in dev?

eiximenis commented 7 years ago

Hi @kifjj One reason for using SQL Server in a container is for helping with managing external dependencies in development. We are not using only SQL Server but also Redis (in the Basket microservice), and RabbitMQ for microservice-to-microservice communication (still not in master branch but merged soon). Forcing everyone to install and configure all these external dependencies would prevent most people to run the application. By using all these dependencies in Docker container you only need to pull the repo, build the images and everything is working fine. Of course you can use SQL Server standalone: just update docker-compose files and everything should be fine :)

Thanks!

CESARDELATORRE commented 7 years ago

@kifjj @eiximenis Reasons given by eiximenis (Eduard) plus: When using databases on containers that are spin-up and populated with the same sample data, that makes a perfect scenario for Integration-Tests, as the tests are predictable based on the same set of data. However, you can of course have your databases on any regular SQL Server on-premises or Azure SQL DB. You'll just need to create the DB, change the connection-strings, and you're done. Even the sample data can be populated to those databases, too., as we do that with EF code.

One more point, you cannot use VMs in Azure for a DEVELOPMENT environment with "Docker for Windows" that would need a nested VM in Hyper-V, and that is not supported in Azure. However, you could, of course, deploy the containers to an Azure Linux VM that would be a Docker Linux host, for testing/production environment, but not development with Visual Studio, etc..

mktitan commented 7 years ago

+1 VS17. Looks great.

FDUdannychen commented 7 years ago

+1 VS2017, Win 10. By the way "ordering.api" depends on "sql.data", if anyone always fails with "PrepareForLaunch" task failed, pulling sql.data(microsoft/mssql-server-linux) blabla error, you can manually pull the image before debugging, using docker pull microsoft/mssql-server-linux.

geminiyellow commented 7 years ago

+1 (CLI) mac

but when i try to check the web feature, there are some errors.

RAM: 8G

CESARDELATORRE commented 7 years ago

@geminiyellow What errors are you getting? - Remember, related to the Identity Authentication container based on IdentityServer4, when deploying from a Mac, you need to use the "production" docker-compose.prod.yml because the by default 10.0.75.1 IP is only available when using Docker for Windows. Afaik that IP is not used in a Mac. So you need to explicitly set your external IP in the .env file at https://github.com/dotnet/eShopOnContainers/blob/master/.env

"localhost" won't work from the Mac when authenticating and the redirection because of that reason, you'll need to always use an specific IP when using the Mac. In a real production system you would also use any specific DNS name for the Docker host or orchestrator DNS name.

kbulte commented 7 years ago

+1 (VS2017) Win 10 Pro, RAM 16GB

mjrousos commented 7 years ago

+1 (Both) Windows 10 Pro, 32 GB RAM.

I did have to change the VS startup project to the Docker project (which wasn't mentioned in the 'main steps') but that's mentioned in the full instructions and was pretty clearly needed. :)

VhatAmI commented 7 years ago

+1 (VS2017)

dongdongmao commented 7 years ago

i want know that can Visual Studio for Mac 2017 run the solution ?

CESARDELATORRE commented 7 years ago

@dongdongmao Not currently. Probably in the future. Visual Studio for Mac still doesn't support Docker containers as VS 2017 for Windows does. What you could use is Visual Studio Code for Mac, as editor and using its Docker extension: https://code.visualstudio.com/docs/languages/dockerfile

Then, using Docker CLI like docker-compose build/up from bash to build images and to deploy the containers.

dongdongmao commented 7 years ago

+1 (CLI) mac

but when i click LOGIN an unhandled exception occurred while processing the request.

InvalidOperationException: IDX10803: Unable to obtain configuration from: 'http://10.0.75.1:5105/.well-known/openid-configuration'. Microsoft.IdentityModel.Protocols.ConfigurationManagerd__24.MoveNext()

andrelmp commented 7 years ago

VS 2017 ERROR: for sql.data Cannot start service sql.data: driver failed programming external connectivity on endpoint dockercompose3536241391_sql.data_1 (e4672897e3ee71a9cbebcb666e9034ccca0d97d5756d18fe8275ba3331c51049): Error starting userland proxy: Bind for 0.0.0.0:5433: unexpected error Permission denied

CESARDELATORRE commented 7 years ago

@andrelmp Hey! Did you set up Docker Community (aka Docker for Windows) with the required amount of memory? - At least 4096 GB for Docker, as specified in the setting up instructions here: https://github.com/dotnet/eShopOnContainers/wiki/02.-Setting-eShopOnContainer-solution-up-in-a-Visual-Studio-2017-environment

Also here: https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-setup-docker

If you did, try re-starting Docker.. Looks like you are having an "environment issue".

Can you start any SQL Server container by itself? like the following Docker CLI commands: docker pull microsoft/mssql-server-linux docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=<YourStrong!Passw0rd>' -p 1433:1433 -d microsoft/mssql-server-Linux

You should probably face the same issue if you didn't set up the required memory for Docker.

andrelmp commented 7 years ago

wow that was fast! thank you @CESARDELATORRE is exactly the memory issue on docker host

ChristianWeyer commented 7 years ago

+1 for CLI (macOS). After having set Docker to 4GB RAM.

But when running docker container ls I get this - and I am missing the Basket API, right (according to https://github.com/dotnet/eShopOnContainers/wiki/03.-Setting-the-eShopOnContainers-solution-up-in-a-Windows-CLI-environment-(dotnet-CLI,-Docker-CLI-and-VS-Code)#testing-all-the-applications-and-microservices)?

image

ChristianWeyer commented 7 years ago

BTW; when building the SPA, building the SPA with npm is successful. But when executing docker-compose -f docker-compose.ci.build.yml up I get this error:

eShopOnContainers git:(dev) ✗ Docker-compose -f docker-compose.ci.build.yml up
Creating eshoponcontainers_ci-build_1
Attaching to eshoponcontainers_ci-build_1
ci-build_1  | /src/src/Web/WebSPA /src
ci-build_1  |
ci-build_1  | > node-sass@4.5.0 install /src/src/Web/WebSPA/node_modules/node-sass
ci-build_1  | > node scripts/install.js
ci-build_1  |
ci-build_1  | node-sass build Binary found at /src/src/Web/WebSPA/node_modules/node-sass/vendor/linux-x64-48/binding.node
ci-build_1  |
ci-build_1  | > node-sass@4.5.0 postinstall /src/src/Web/WebSPA/node_modules/node-sass
ci-build_1  | > node scripts/build.js
ci-build_1  |
ci-build_1  | Binary found at /src/src/Web/WebSPA/node_modules/node-sass/vendor/linux-x64-48/binding.node
ci-build_1  | Testing binary
ci-build_1  | Bus error
ci-build_1  |
ci-build_1  | npm ERR! Linux 4.9.13-moby
ci-build_1  | npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "rebuild" "node-sass"
ci-build_1  | npm ERR! node v6.10.0
ci-build_1  | npm ERR! npm  v3.10.10
ci-build_1  | npm ERR! code ELIFECYCLE
ci-build_1  | npm ERR! node-sass@4.5.0 postinstall: `node scripts/build.js`
ci-build_1  | npm ERR! Exit status 135
ci-build_1  | npm ERR!
ci-build_1  | npm ERR! Failed at the node-sass@4.5.0 postinstall script 'node scripts/build.js'.
ci-build_1  | npm ERR! Make sure you have the latest version of node.js and npm installed.
ci-build_1  | npm ERR! If you do, this is most likely a problem with the node-sass package,
ci-build_1  | npm ERR! not with npm itself.
ci-build_1  | npm ERR! Tell the author that this fails on your system:
ci-build_1  | npm ERR!     node scripts/build.js
ci-build_1  | npm ERR! You can get information on how to open an issue for this project with:
ci-build_1  | npm ERR!     npm bugs node-sass
ci-build_1  | npm ERR! Or if that isn't available, you can get their info via:
ci-build_1  | npm ERR!     npm owner ls node-sass
ci-build_1  | npm ERR! There is likely additional logging output above.
ci-build_1  |
ci-build_1  | npm ERR! Please include the following file with any support request:
ci-build_1  | npm ERR!     /src/src/Web/WebSPA/npm-debug.log
eshoponcontainers_ci-build_1 exited with code 1
CESARDELATORRE commented 7 years ago

@ChristianWeyer Did you try to run this first from the CLI: npm rebuild node-sass

before running the docker-compose -f docker-compose.ci.build.yml up ?

But that should be done from the compose execution…, too...

Can you create an issue specific for Mac environment so we track it down when possible?

Thanks for the feedback.

ChristianWeyer commented 7 years ago

Created a new issue @CESARDELATORRE ;-)

ardalis commented 7 years ago

Just got latest on master an now am seeing this: image

CESARDELATORRE commented 7 years ago

@ardalis That var is defined at the .env file: https://github.com/dotnet/eShopOnContainers/blob/master/.env Which, by default should be set as localhost, see that in the file.

Are you getting that file when cloning the repo?

ardalis commented 7 years ago

@CESARDELATORRE Yes, I have a .env file. I just switched to latest dev branch but see same behavior. The .env file has this in it:

ESHOP_EXTERNAL_DNS_NAME_OR_IP=localhost ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP=10.121.122.92

But apparently it's not being read.

CESARDELATORRE commented 7 years ago

@ardalis Weird, try to reset Docker.. I just pulled the DEV branch and everything is working for me from VS 2017 after just hitting F5. Let's take it offline if it still doesn't work for you, ok?

richardrcruzc commented 7 years ago

-1 (VS2017) on Win10 Entr, RAM 32GB when click on LOGIN after a while got this error: An unhandled exception occurred while processing the request. TaskCanceledException: A task was canceled. System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) IOException: IDX10804: Unable to retrieve document from: 'http://10.0.75.1:5105/.well-known/openid-configuration'. Microsoft.IdentityModel.Protocols.HttpDocumentRetriever+d8.MoveNext() InvalidOperationException: IDX10803: Unable to obtain configuration from: 'http://10.0.75.1:5105/.well-known/openid-configuration'. Microsoft.IdentityModel.Protocols.ConfigurationManager+d24.MoveNext()

buzzfrog commented 7 years ago

-1 CLI When I run the command docker-compose -f docker-compose.ci.build.yml up I get an error in the end of the command: ci-build_1 | /usr/share/dotnet/sdk/1.0.1/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.Publish.targets(100,5): error MSB3030: Could not copy the file "/src/src/Web/WebSPA/wwwroot/dist/main.411b08094680fcce978b.bundle.js" because it was not found. [/src/src/Web/WebSPA/WebSPA.csproj]
ci-build_1 | /usr/share/dotnet/sdk/1.0.1/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.Publish.targets(100,5): error MSB3030: Could not copy the file "/src/src/Web/WebSPA/wwwroot/dist/main.411b08094680fcce978b.bundle.map" because it was not found. [/src/src/Web/WebSPA/WebSPA.csproj]

CESARDELATORRE commented 7 years ago

@buzzfrog Opening an issue ( https://github.com/dotnet/eShopOnContainers/issues/164 ) with that as it is an issue from the latest version of dotnet cli. This used to work for us. It seems it is already fixed by our team (.NET team) and will be available in the next version, soon.

CESARDELATORRE commented 7 years ago

@richardrcruzc Did you follow the steps specified at the instructions in regards the Firewall ports needed to be opened so the Identity container can work properly? See: https://github.com/dotnet/eShopOnContainers/wiki/02.-Setting-eShopOnContainer-solution-up-in-a-Visual-Studio-2017-environment

Also, are you deploying to Docker for Windows or Docker for Mac? The "external" IP: 10.0.75.1 only works in development environments using Docker for Windows. It using Docker for Mac, you need to deploy following this setup: https://github.com/dotnet/eShopOnContainers/wiki/09.-Deploying-eShopOnContainers-to-a-%22Production%22-environment

dongdongmao commented 7 years ago

If i want change database of this project to Mysql.What can I do?

CESARDELATORRE commented 7 years ago

@dongdongmao We're using Entity Framework Core, so you could use the MySQL Docker image (or a real MySQL server), then change the connection strings at the docker-compose.override.yml files. However, that might not be enough. Anything specific related to SQL Server (like the Hi/Lo pattern) should be migrated to a different implementation with MySQL. I would start just with the Catalog microservice which is the simplest one. You can test it with Swagger by just using it from a browser at http://localhost:5101 so you can query the microservice, update, etc. You can go to all the docker-compose yml files and remove anything which is not related to the Catalog microservice so you isolate your work on that initial microservice targeting MySQL.

babula38 commented 7 years ago

Many package restore error. while opening in vs2017 community and windows 7. could you please have a look on this. i know ducker need windows 10 but atleast it build in windows 7

CESARDELATORRE commented 7 years ago

You need Windows 10 in order to run it on Docker Community Edition for Windows.

babula38 commented 7 years ago

quick question will it need windows 10 to build the project? running the application is a different part. Can i migrate to this project to work without any ducker support? As it is a awesome project i just want to learn each part and do not want to miss due to my system limitation.

CESARDELATORRE commented 7 years ago

@babula38 - We haven't tested anything on Windows 8.x or Windows 7. But, without using Docker, you could migrate the projects to standalone Web API services, of course, since .NET Core and VS 2017 support Windows 8.x and Windows 7. Below you have the requirements for .NET Core and VS 2017: .NET Core is supported on the following versions of Windows: Windows 7 SP1 Windows 8.1 Windows 10 Windows Server 2008 R2 SP1 (Full Server or Server Core) Windows Server 2012 SP1 (Full Server or Server Core) Windows Server 2012 R2 SP1 (Full Server or Server Core) Windows Server 2016 (Full Server, Server Core or Nano Server)

The requirements for VS 2017 are: Supported Operating Systems Visual Studio 2017 will install and run on the following operating systems: • Windows 10 version 1507 or higher: Home, Professional, Education, and Enterprise (LTSB is not supported) • Windows Server 2016: Standard and Datacenter • Windows 8.1 (with Update 2919355): Basic, Professional, and Enterprise • Windows Server 2012 R2 (with Update 2919355): Essentials, Standard, Datacenter • Windows 7 SP1 (with latest Windows Updates): Home Premium, Professional, Enterprise, Ultimate.

But, we cannot provide support other than to the versions we are testing which is eShopOnContainers running on Docker (and multiple orchestrators in the near future), ok?

dongdongmao commented 7 years ago

Another question.How to run this project by real moblie device.For example Android?

CESARDELATORRE commented 7 years ago

@dongdongmao Basically, you need some knowledge on Xamarin apps when using Visual Studio. We have done some "light" documentation about the Xamarin app as this project's goals are more about the server side (microservices/containers), however, these are the links you need to take into account:

Xamarin app README: https://github.com/dotnet/eShopOnContainers/blob/master/src/Mobile/README.md

Setting-up-the-Xamarin-mobile-app to use the Docker Containers/Microservices: https://github.com/dotnet/eShopOnContainers/wiki/07.-Setting-up-the-Xamarin-mobile-apps

If not using the "mock feature" at the Xamarin app but you want to access the Docker containers for real, then, you need to deploy the containers and access them through your external IP or DNS name if deploying to a cluster. Related to that (external IP of the docker Host), read this:

https://github.com/dotnet/eShopOnContainers/wiki/09.-Deploying-eShopOnContainers-to-a-%22Production%22-environment

About simply deploying the Xamarin app to an Android device, you do it like any other Xamarin app, from Visual Studio, or debugging the Xamarin app with F5, etc.

dongdongmao commented 7 years ago

A problem confused me.I run this project (CLI mac) before and it worked.Now a new problem arises, i just use docker-compose up but i found the eshop/basket.api not run as a container so i click the button [add to cast] it cant work, and i found this exception below.

Unhandled Exception: RabbitMQ.Client.Exceptions.BrokerUnreachableException: None of the specified endpoints were reachable ---> RabbitMQ.Client.Exceptions.ConnectFailureException: Connection failed ---> System.Net.Internals.SocketExceptionFactory+ExtendedSocketE xception: Connection refused 172.18.0.2:5672

CESARDELATORRE commented 7 years ago

@dongdongmao Related to this issue: https://github.com/dotnet/eShopOnContainers/issues/157 Yes. This is something that started in the Mac environment (not in Windows) when we added the Event Hub based on a RabbitMQ container. It is caused by the fact that when starting all the containers, in the Mac environment the RabbitMQ container must start not soon enough for the client containers/microservices. For any reason, that is not happening when starting in Docker for Windows. In any case, this is something we need to fix, we need to make the RabbitMQ connections resilient, so if for any reason it can't connect (when starting or even partial failures in the cloud) we need to implement retry with exponential backoff logic in the client apps. As a temporal workaround, you could start the RabbitMQ container first (with docker run or a different docker-compose file only for that container) then start the rest of the application with docker-compose (without having the RabbitMQ container in the global docker-compose files). Please, confirm if that was your issue. We'll reply here when this is fixed.

dongdongmao commented 7 years ago

@CESARDELATORRE but why it can work before? and how can i run RabbitMQ first?

CESARDELATORRE commented 7 years ago

@dongdongmao Not sure if the version you were testing previously was not including the Event Bus and RabbitMQ container as that is something we've developed recently. In order to run the RabbitMQ container first you'd need to remove it from the global docker-compose files and deploy it independently before deploying the whole solution. In any case, we're in the process of fixing this resiliency issue so it should be working in a few days, early next week, probably.

dongdongmao commented 7 years ago

@CESARDELATORRE Hi,I have a problem about database of microservice container. For example if i want to show databases of SQL Server, how can i connect to it and is there any tools can help?

CESARDELATORRE commented 7 years ago

You can do it the same way, using SQL SERVER MANAGEMEMT STUDIO. You just need to change the connection parameters, using the external IP of the Docker host. Make sure the firewall is not closing the used port, neither. Take a look