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

Error launching Azure Function (Python) in Azure Functions & Python 3 container on Apple M1 #835

Open
MrThePlague opened this issue Apr 26, 2021 · 9 comments
Labels
feature-request Request for new features or functionality functions

Comments

@MrThePlague
Copy link

MrThePlague commented Apr 26, 2021

I'm not 100% sure if this issue is being submitted to the correct repo; however, it looks as though I'm unable to launch a function locally when leveraging the Azure Functions & Python 3 container image when using a device running on Apple Silicon (M1).

When attempting to launch the function using the Run and Debug window within VS Code, I receive the error:

Screen Shot 2021-04-26 at 10 55 11 AM

When attempting to launch the function directly from the terminal using func host start, I receive the error:

(.venv) vscode ➜ /workspaces/testing-azure-function $ func host start
qemu: uncaught target signal 6 (Aborted) - core dumped
Aborted

(Example) Steps to reproduce:

  1. Create new folder and open in VS Code
  2. Remote Container: Add Development Container Configuration Files... (Azure Functions & Python 3)
  3. Reopen in Container
  4. Azure Functions: Create Function:
    • Python
    • Virtual ENV: python3 (3.8.9)
    • Trigger: Timer
      • Default timer
  5. Run and Debug: Attach to Python Function

These steps work fine when executed on an Intel machine.

@MrThePlague MrThePlague changed the title Error launching Azure Function (Python) in Azure Functions & Python 3 container on Arm64 Error launching Azure Function (Python) in Azure Functions & Python 3 container on Apple M1 Apr 26, 2021
@Chuxel
Copy link
Member

Chuxel commented Apr 26, 2021

@anthonychu @TsuyoshiUshio Is anything other than x86_64 / amd64 currently supported? I assume the problem here is the intel toolkit is in the image?

@MrThePlague
Copy link
Author

MrThePlague commented Apr 26, 2021

@Chuxel It looks as though the image was built as an amd64 image:

$ docker image inspect vsc-another-test-function-d77580e6300e98838357336c32a042e3
<removed for brevity>
        "Architecture": "amd64",
        "Os": "linux",

And then from inside the instantiated container:

vscode ➜ /workspaces/another-test-function $ uname -a
Linux 74d24f56973e 5.10.25-linuxkit #1 SMP PREEMPT Tue Mar 23 09:24:45 UTC 2021 x86_64 GNU/Linux

@Chuxel
Copy link
Member

Chuxel commented Apr 26, 2021

@MrThePlague Thanks. Does this reproduce on an intel Mac, Linux, or Windows machine?

Either way, I'll let @anthonychu and @TsuyoshiUshio from the functions team respond further.

@MrThePlague
Copy link
Author

@Chuxel Thanks! Everything works correctly with an Intel Mac.

@anthonychu
Copy link
Member

The Azure Functions host and Core Tools only support x86/64 right now. The work to do so still needs to be prioritized so I wouldn't expect to get there in the short term. In addition to the host and CLI, we'll also need to produce ARM builds of language workers (some have native dependencies like gRPC), do a fair bit of testing, and produce multi-arch images.

@MrThePlague
Copy link
Author

The Azure Functions host and Core Tools only support x86/64 right now. The work to do so still needs to be prioritized so I wouldn't expect to get there in the short term. In addition to the host and CLI, we'll also need to produce ARM builds of language workers (some have native dependencies like gRPC), do a fair bit of testing, and produce multi-arch images.

Thanks for the reply! That all makes sense; however, my (obviously incorrect) assumption would've been that because this image is built as an amd64 and it's running under x86/64 emulation (as seen above) it still would've worked, albeit with a performance hit.

@Chuxel Chuxel added the feature-request Request for new features or functionality label May 14, 2021
@alexis-franche
Copy link

alexis-franche commented Feb 24, 2022

Was there any solution to this problem ? I have an M1, getting the same error and cant get my function app in docker to work.

@anthonychu
Copy link
Member

@ejizba and team are working on ARM support in Azure Functions toolchain. They might be able to provide some insights on whether the image is able to be run in emulation or if we need to wait for the ARM support to arrive and corresponding multi-arch Core Tools images to ship.

@ejizba
Copy link
Member

ejizba commented Feb 24, 2022

Here's the issue tracking Apple Silicon support in core tools: Azure/azure-functions-core-tools#2834

We have seen some users report success running in x64 emulation, but I don't know the particulars and I don't think any of them were using Docker

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality functions
Projects
None yet
Development

No branches or pull requests

5 participants