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

[Issue] azd in dev container on Mac M1 - azd fails #2593

Open
1 task
dfberry opened this issue Aug 3, 2023 · 9 comments
Open
1 task

[Issue] azd in dev container on Mac M1 - azd fails #2593

dfberry opened this issue Aug 3, 2023 · 9 comments
Assignees
Labels
Bicep bug Something isn't working customer-reported identify a customer issue installer question
Milestone

Comments

@dfberry
Copy link

dfberry commented Aug 3, 2023

Output from azd version
Run azd version and copy and paste the output here:
azd version 1.1.0 (commit ea9cb12)

Describe the bug
Description of issue you're seeing...

can't use azd up on Static React Web App + Functions with Node.js API and MongoDB on Azure template

To Reproduce
Steps to reproduce the behavior...

  1. create dev container for typescript from microsoft
  2. install azd - which fails
  3. check dev container setting so azd is installed by default with container rebuild
  4. rebuild
  5. azd auth login succeeded on third try - something about localhost not being available
  6. use azd init with template switch
  7. rebuild again because now there is a new devcontainer
  8. azd up
  9. get error: ERROR: compiling bicep template: failed to compile bicep template: failed running bicep build: signal: segmentation fault, stdout: , stderr: qemu: uncaught target signal 11 (Segmentation fault) - core dumped
  10. I assume this is about docker + Mac M1

Expected behavior
Does azd work on Mac M1?

Environment
Information on your environment:
* Language name and version
* IDE and version : [e.g. Visual Studio 16.3]

image

image

Additional context
image

@rajeshkamal5050
Copy link

@danieljurek @weikanglim can you try to repro this on your M1/M2's?

@rajeshkamal5050
Copy link

@v-xuto can you try repro'ing this?

@v-jiaodi
Copy link
Member

v-jiaodi commented Sep 4, 2023

@v-xuto can you try repro'ing this?

@rajeshkamal5050 We can repro this issue.
image

Environment:

  • OS: Apple M2
  • azd version: 1.2.0

In addition, when we reopen the todo-nodejs-mongo-swa-func with devContainer, encountered this error:
image

@danieljurek
Copy link
Member

danieljurek commented Sep 7, 2023

Thanks for chatting @dfberry! A couple scenarios to consider here:

Run azd without installing azd on the local machine (container OK)

This scenario should work well enough today because our templates supply the .devcontainer config needed. However, the steps to accomplish this would be:

  1. git clone the template repo
  2. Open vscode against the template directory
  3. vscode will suggest reopening in the devcontainer, do that
  4. azd auth login and azd up, etc.

Those should all work in the devcontainer running in emulated x86_64 mode. I'll ensure that's the case. I wonder if our docs should be updated to make this path easier.... Also, we need to figure out if Rosetta should be installed to run containers in emulated mode.

Errors running bicep in non-emulated devcontainer mode

This is the error repro'd above by @v-jiaodi, this should be looked into as well.

@danieljurek
Copy link
Member

danieljurek commented Sep 8, 2023

bicep build, when running inside the x86_64 emulated docker container, reliably crashes (using both qemu and using Docker Desktop's experimental Rosetta emulation feature). Running file ~/.azd/bin/bicep shows that the binary is x86-64 so, given that the container is x86_64, this is the correct binary that azd is downloading.

We'll need to dig into what's making bicep fail when running bicep build in an emulated container. This could be an issue with bicep, dotnet which is building the bicep binary, or possibly qemu.

I also tried switching the devcontainer out of x86_64 mode into the ARM64 mode but that doesn't work because Azure Functions Core Tools aren't available on packages.microsoft.com for ARM64 of the Debian distro we are using. The azure-functions-core-tools releases page on GitHub also only shows binaries for x64 on Linux (no obvious ARM64 support).

Two avenues of further exploration for the bicep crash are:

  1. Fixing bicep (possibly involving .NET and qemu) or
  2. Getting azure-functions-core-tools building and publishing on ARM64 Linux

@rajeshkamal5050
Copy link

@danieljurek is this issue still valid? Not seeing much activity here?

@rajeshkamal5050
Copy link

@danieljurek https://azure.microsoft.com/en-us/updates/generally-available-azure-functions-support-on-apple-silicon-macs/

We are excited to announce that Azure Functions support on Apple Silicon Macs is now live. Update your Core Tools to the latest version (4.0.5455+) and try it out today!

@danieljurek
Copy link
Member

There's not a release for arm64 linux yet so this does not work in devcontainer.

@rajeshkamal5050
Copy link

There's not a release for arm64 linux yet so this does not work in devcontainer.

@danieljurek given the dependency on Azure/azure-functions-core-tools#3112 please pull it when the dep is resolved. Moving to backlog.

@rajeshkamal5050 rajeshkamal5050 removed this from the Germanium milestone Mar 12, 2024
@rajeshkamal5050 rajeshkamal5050 added this to the Backlog milestone Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bicep bug Something isn't working customer-reported identify a customer issue installer question
Projects
None yet
Development

No branches or pull requests

5 participants