Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot run 64bit C# Azure Function on Azure Kubernetes Service #1160

Closed
SpicySyntax opened this issue Mar 28, 2019 · 7 comments
Closed

Cannot run 64bit C# Azure Function on Azure Kubernetes Service #1160

SpicySyntax opened this issue Mar 28, 2019 · 7 comments

Comments

@SpicySyntax
Copy link

Please describe the documentation request or issue. Be as specific as possible.
I am working on an V2 Azure Function App that uses C# and .NET core that uses an x64 dll. For this reason I have set it up to only build and run as x64. I am able to run this function locally using 64 bit Azure Function Core tools and everything works as expected.

I deploy this to azure kubernetes using:
func deploy --platform kubernetes --name MyFunctionName --registry nickjpurcell
The deployment seems to succeed but when it has to run the code dependent on the x64 dll it fails.
I am ensuring we are publishing the project as x64 in the Dockerfile dotnet publish -p:Platform=x64 *.csproj --output /home/site/wwwroot.

Do I need to change the version of azure function I am using?
Is there a configuration I can do to switch the function runtime to use a 64 worker process?
(That is not the azure portal ui?)

Here is the gist containing the .csproj, Dockerfile, host.json for my Azure Function V2 project.

@fabiocav
Copy link
Member

@ahmelsayed can you please comment on the configuration/support for running in 64-bit in AKS?

Fot the compilation/payload, you shouldn't need to target 64-bit specifically when compiling/publishing. A portable set of artifacts would work and the runtime would load the appropriate dependencies depending on the platform it's running under.

@ahmelsayed
Copy link
Contributor

Do you know if that x64 dll contains native Windows code? I'm assuming locally you're running on Windows?

@SpicySyntax
Copy link
Author

SpicySyntax commented Mar 29, 2019

@ahmelsayed I am not 100% sure, but I think it might. (I am using 'CNTK.CPUOnly' and running on a Windows machine locally) In that case do I need to update my Dockerfile to build a windows container image?

@ahmelsayed
Copy link
Contributor

As far as I know Windows containers on Kubernetes are still not available yet. Since their repo contains a mostly C++ code, I'm guessing that dll is a native Windows assembly and won't load on Linux. There seem to be a Linux build in their release https://github.com/Microsoft/CNTK/releases but the nuget package only contains Windows. See this issue: microsoft/CNTK#3472

They can either make a nuget package for Linux or include both Windows and Linux native assemblies into the nupkg like grpc for example, or have another Linux only nuget package.

Do you have a sample you can share using that package?

@ahmelsayed
Copy link
Contributor

huh, looks like as of Kubernetes 1.14, released 10 days ago, Kubernetes works with Windows containers. Though both AKS and GKE don't have 1.14 yet.

@SpicySyntax
Copy link
Author

@fabiocav @ahmelsayed This issue can be closed. It was not an issue with the bitness, which I was able to configure by changing the dotnet publish command to use x64 in the Dockerfile. It was the fact that I was trying to use Windows Native code in a Linux Container. So there is not really an issue with azure function core tools. Thanks for your help

@ahmelsayed
Copy link
Contributor

Thanks for circling back @SpicySyntax!

@lock lock bot locked as resolved and limited conversation to collaborators Dec 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants