GoogleCloudPlatform / aspnet-docker

Apache License 2.0
36 stars 35 forks source link

GAE Flex and .NET Core 3.1 #144

Open tonyatl1 opened 4 years ago

tonyatl1 commented 4 years ago

I hope i am in the right place for this question about GAE/Flex support for .net core 3.1. I have noticed that there are no images for 3.x as enumerated here: https://cloud.google.com/appengine/docs/flexible/dotnet/customizing-the-dotnet-runtime and here: https://console.cloud.google.com/gcr/images/google-appengine/GLOBAL/aspnetcore

Is this simply a matter of GAE/F not keeping current with the recent .net core changes? Some folks on my team are nervous about deploying a runtime : custom solution using 3.1 images because of a statement in an old google article here: https://cloud.google.com/blog/products/gcp/4-ways-you-can-deploy-an-aspnet-core-app-to-gcp. More specifically this comment:

"We've created a set of Docker images that are optimized for running ASP.NET Core apps in App Engine and Container Engine, and we highly recommend that you use them for your custom Dockerfiles."

Since there are no 3.1 images in the google repositories noted above, the theory is that 3.1 is not supported and should not be used for production products. Can anyone shed light on the advisability of using .net core 3.1 on GAE/F? Are there GAE-specific reasons for not using it? thanks

PS - of course 3.1 will run on GAE/F - at least a super simple prototype does - so my question centers on the absence of sanctioned 3.1 images in the repositories and the implications thereof.

Sword-Smith commented 4 years ago

I just tried deploying a .NET Core 3.1 version and got this error indicating the .NET Core 3 is not supported. I would very much like it to be.

Step #0: No valid .NET Core runtime version found for the app or it is not a supported app.
Finished Step #0
ERROR
ERROR: build step 0 "gcr.io/gcp-runtimes/aspnetcorebuild@sha256:<hash>" failed: exit status 1
trbjo commented 4 years ago

I think it is very disappointing that Google doesn't support 3.x yet.

Is this even getting worked on?

Our business is critically dependent on 3.x support, and we might have to look to other cloud providers if we don't get a reasonable estimate on when we can expect support for this.

concieggs commented 4 years ago

I also find it deeply disappointing. As the CTO of an organisation with a billion customers, I need this to be fixed yesterday! Trust me, I know how important this is. I own many suits and ties.

tonyatl1 commented 4 years ago

I just tried deploying a .NET Core 3.1 version and got this error indicating the .NET Core 3 is not supported. I would very much like it to be.

Step #0: No valid .NET Core runtime version found for the app or it is not a supported app.
Finished Step #0
ERROR
ERROR: build step 0 "gcr.io/gcp-runtimes/aspnetcorebuild@sha256:<hash>" failed: exit status 1

does your app.yaml have the following: runtime: custom env: flex

to run 3.x on gcp, you need to use App Engine Flex, and you need to set the runtime to custom as shown above.

tonyatl1 commented 4 years ago

I also find it deeply disappointing. As the CTO of an organisation with a billion customers, I need this to be fixed yesterday! Trust me, I know how important this is. I own many suits and ties.

i have proceeded with 3.1 on gcp app engine flex and so far have not experienced any problems with 3.1 per se provided i configure everything correctly. i would have selected azure except for the fact that my Fortune 20 company has a lot of security infrastructure built around gcp. In my next project, i will select Azure.

concieggs commented 4 years ago

This requirement to "configure correctly" is not enterprise friendly. The five Fortune 10 companies on which I also serve as board chairman has all security and productivity infrastructure on GCP, but will use AWS next time.

Sword-Smith commented 4 years ago

I just tried deploying a .NET Core 3.1 version and got this error indicating the .NET Core 3 is not supported. I would very much like it to be.

Step #0: No valid .NET Core runtime version found for the app or it is not a supported app.
Finished Step #0
ERROR
ERROR: build step 0 "gcr.io/gcp-runtimes/aspnetcorebuild@sha256:<hash>" failed: exit status 1

does your app.yaml have the following: runtime: custom env: flex

to run 3.x on gcp, you need to use App Engine Flex, and you need to set the runtime to custom as shown above.

It worked when I changed runtime from "aspnetcore" to "custom"! Thank you. I couldn't find this advice in the documentation, though. Can you share with us, how you found this fix?

tonyatl1 commented 4 years ago

I just tried deploying a .NET Core 3.1 version and got this error indicating the .NET Core 3 is not supported. I would very much like it to be.

Step #0: No valid .NET Core runtime version found for the app or it is not a supported app.
Finished Step #0
ERROR
ERROR: build step 0 "gcr.io/gcp-runtimes/aspnetcorebuild@sha256:<hash>" failed: exit status 1

does your app.yaml have the following: runtime: custom env: flex to run 3.x on gcp, you need to use App Engine Flex, and you need to set the runtime to custom as shown above.

It worked when I changed runtime from "aspnetcore" to "custom"! Thank you. I couldn't find this advice in the documentation, though. Can you share with us, how you found this fix?

https://cloud.google.com/appengine/docs/flexible/custom-runtimes/quickstart https://cloud.google.com/appengine/docs/flexible/custom-runtimes/build

the custom option is fairly well documented in the google literature. it's the safety valve for using images not supported in the standard registry for the flex.

tonyatl1 commented 4 years ago

This requirement to "configure correctly" is not enterprise friendly. The five Fortune 10 companies on which I also serve as board chairman has all security and productivity infrastructure on GCP, but will use AWS next time.

bbbwwwaaahahhahahahaahahhahaa. is there a window in your basement <wink>

Sword-Smith commented 4 years ago

@tonyatl1 Are you using a publicly available docker file for this and have you set up a reverse proxy nginx as the default runtimes on Google Cloud have?

Sword-Smith commented 4 years ago

Microsoft is supplying a docker file for the ASP.NET Core 3.1 runtime here but I guess I should also set up a reverse proxy nginx to get a system similar to Google Cloud's standard setup. Any advice on this?

tonyatl1 commented 4 years ago

@tonyatl1 Are you using a publicly available docker file for this and have you set up a reverse proxy nginx as the default runtimes on Google Cloud have?

i am using these images from microsoft: FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build

although there are plenty others from which to chose.

i haven't done anything explicitly with nginx as i believe that comes out of the box so to speak. i am using kestrel and set port 8080 and 443 in my docker file. ENV ASPNETCORE_URLS=http://*:8080;https://*:443

Sword-Smith commented 4 years ago

Is this issue closed by a10bdc6c21a2b47389a7b0dc7d1ff88291c4400f?

bkalafat commented 4 years ago

@tonyatl1 Are you using a publicly available docker file for this and have you set up a reverse proxy nginx as the default runtimes on Google Cloud have?

i am using these images from microsoft: FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build

although there are plenty others from which to chose.

i haven't done anything explicitly with nginx as i believe that comes out of the box so to speak. i am using kestrel and set port 8080 and 443 in my docker file. ENV ASPNETCOREURLS=http://:8080;https://_:443

Could you send sample dockerfile?

Tetsuoryuu commented 4 years ago

For those having problems, I wrote an article on how to fix them:

https://medium.com/google-cloud/how-to-deploy-asp-net-core-3-x-to-google-app-engine-8813b0ee3521

Sword-Smith commented 4 years ago

For those having problems, I wrote an article on how to fix them:

https://medium.com/google-cloud/how-to-deploy-asp-net-core-3-x-to-google-app-engine-8813b0ee3521

Thanks. I thought this had been fixed but using runtime: aspnetore, env: flex still does not work for .NET Core 3.1 applications.

I ran into the same problem of No valid .NET Core runtime version found for the app or it is not a supported app. and I see that I need to provide a docker file that you show in your article. How do I publish this docker image to Google Cloud?

Also: I think your Dockerfile compiles the code on the Google Cloud VM. I would rather compile the files locally and transfer them to the Google Cloud VM. Is that possible in this scenario?