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

macOS 11 Big Sur Apple Silicon M1 arm chip - local debugging won't work #322

Open
shazron opened this issue Nov 13, 2020 · 9 comments
Open
Labels
bug Something isn't working

Comments

@shazron
Copy link
Member

shazron commented Nov 13, 2020

There might be issues with running local debugging on macOS 11 Big Sur on M1 arm chips.
aio app run --local --verbose.

Double check if you have the M1 chip: run aio info.

Local debugging requirements:

  1. node.js (should run under Rosetta 2, native binary pending: Apple silicon builds nodejs/build#2474)
    2. java JRE (should run under Rosetta 2, native binary pending: https://bugs.openjdk.java.net/browse/JDK-8251280)
  2. Docker. will not run yet. See Docker fails to launch on Apple Silicon docker/for-mac#4733. A comment mentioned "it's months away", so realistically perhaps 1Q 2021.

Because Docker won't run on Apple Silicon during the launch of the Apple machines with the M1 chip, local debugging won't work until Docker creates a new release fixing the issue.

@meryllblanchet
Copy link
Contributor

Thanks for raising this up, @shazron !
Let me cc @alexkli as this also relates to wskdebug.

@shazron
Copy link
Member Author

shazron commented Dec 17, 2020

@shazron
Copy link
Member Author

shazron commented Feb 16, 2021

Local debugging now works on M1 with the Docker Tech Preview.
Note that node.js only comes with darwin arm64 (macOS) binaries for node:15+, anything prior to that will need to installed and run under x86_64.

Thus these five items are still running under Rosetta 2:

  1. node.js
  2. java
  3. Docker for Mac Tech Preview binaries
  4. Docker image: https://hub.docker.com/r/adobeapiplatform/adobe-action-nodejs-v10
  5. Docker image: https://hub.docker.com/r/adobeapiplatform/adobe-action-nodejs-v12

Consequently when having a development environment of Linux arm64 (say Ubuntu), items 1-3 are all arm64 so that's fine, but items 4 and 5 do not have the arm64 architecture, so local debugging will not work ('exec format error') until they are updated. The number of devs using a Linux arm64 dev environment is low so it's not a concern right now.

I would think it will be similar for Windows 10 arm64 (but it has further challenges: there are no node.js binaries for Windows 10 ARM, nor is there a Docker for Windows ARM)

@shazron
Copy link
Member Author

shazron commented Apr 27, 2021

There are a lot of issues with Docker Desktop for Mac 3.3.x (the first one with native M1 support): https://github.com/docker/for-mac/issues

As of now, aio app run --local does not work with Docker Mac 3.3.x

@shazron
Copy link
Member Author

shazron commented Apr 27, 2021

I think the issue is that our node Docker images are x86 only, when Docker Desktop is running on arm64. So at this point unless we have node10 and node12 arm64/universal Docker images (unlikely since node only supports arm for Darwin/macOS on node 15 and greater) -- run local development on arm is dead in the water, at least until we support node16.

This is the same issue I reported regarding aio app run --local on Linux arm64 (slightly different -- the node Docker images aren't universal images)

@shazron
Copy link
Member Author

shazron commented Jun 3, 2022

updated: we have nodejs:16 images now, but they are not multi-platform and still amd64.

@shazron
Copy link
Member Author

shazron commented Jan 11, 2023

The nodejs:16 images are now multi platform.

@shazron
Copy link
Member Author

shazron commented Sep 11, 2023

Issue

The node-16, and node-18 images are multi-platform, and the arm64 containers are crashing when they are activated by openwhisk.

Workaround

You need to use node-14 or lower, so it will use our x86_64 image. Make sure you are using at least macOS Docker Desktop 4.22.1 (118664)

  1. Update the kind for your action to nodejs:14 in app.config.yaml
  2. In your Docker for Mac settings -> Features in development -> Use Rosetta for x86/amd64 emulation on Apple Silicon turn this checkbox on then select Apply & restart.
  3. If you use node-16 or greater syntax, you will need to update your webpack config to transpile to a node-14 compatible EcmaScript version: https://developer.adobe.com/app-builder/docs/guides/configuration/webpack-configuration/

Then redeploy your action.

2023-09-11_23-11-30

@pru55e11 pru55e11 added the bug Something isn't working label Sep 13, 2023
@aiojbot
Copy link
Collaborator

aiojbot commented Sep 14, 2023

JIRA issue created: https://jira.corp.adobe.com/browse/ACNA-2541

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants