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

Not working on M1 Mac #24

Open
lylek opened this issue Nov 10, 2022 · 6 comments
Open

Not working on M1 Mac #24

lylek opened this issue Nov 10, 2022 · 6 comments

Comments

@lylek
Copy link

lylek commented Nov 10, 2022

I was able to start the docker container but it gave me a warning and eventually crashed. Showed the UI in the browser but it said it gave me "Error Starting Kernel" and then "Kernel Connection Error". Running macOS Monterey on an M1 Mac. This is the console log:

% docker run --rm -p 8888:8888 -v $PWD:/home/jovyan/pwd --name ihaskell_notebook ghcr.io/ihaskell/ihaskell-notebook:master jupyter lab --ServerApp.token=''
Unable to find image 'ghcr.io/ihaskell/ihaskell-notebook:master' locally
master: Pulling from ihaskell/ihaskell-notebook
f3ef4ff62e0d: Pull complete
87b87529fe71: Pull complete
e876761e8043: Pull complete
e5a51282c728: Pull complete
29501b6c9c30: Pull complete
7bc063f9afec: Pull complete
3c01be75a708: Pull complete
461a439cb5d2: Pull complete
086fb21afc1a: Pull complete
ed2f87d9a05c: Pull complete
60ea745e459e: Pull complete
2cf95ad21b38: Pull complete
fc3ed8a51dbc: Pull complete
d599da3b2b77: Pull complete
b0bf3c6a4353: Pull complete
ee24d82f3515: Pull complete
9aaae925a331: Pull complete
6458b12d4f9a: Pull complete
06b48a45a22b: Pull complete
4b2fded8fa5a: Pull complete
4242fbae7c7f: Pull complete
45b7cee1f0c0: Pull complete
60d2571d3f12: Pull complete
6ca714bc060f: Pull complete
91650c23407e: Pull complete
4687192a5b9a: Pull complete
8c814b2996f4: Pull complete
9abc5b76a89a: Pull complete
35709607564c: Pull complete
7160b302e677: Pull complete
e9a57d5665a9: Pull complete
Digest: sha256:7105b6519a07515babc254b7d3582f7e631149bc9b8ae5f2df0a215d4143cec6
Status: Downloaded newer image for ghcr.io/ihaskell/ihaskell-notebook:master
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
[I 2022-11-10 06:02:39.088 ServerApp] jupyterlab | extension was successfully linked.
[W 2022-11-10 06:02:39.112 NotebookApp] 'ip' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2022-11-10 06:02:39.113 NotebookApp] 'port' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2022-11-10 06:02:39.113 NotebookApp] 'port' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[I 2022-11-10 06:02:39.160 ServerApp] Writing Jupyter server cookie secret to /home/jovyan/.local/share/jupyter/runtime/jupyter_cookie_secret
[I 2022-11-10 06:02:39.943 ServerApp] nbclassic | extension was successfully linked.
[W 2022-11-10 06:02:40.035 ServerApp] All authentication is disabled.  Anyone who can connect to this server will be able to run code.
[I 2022-11-10 06:02:40.057 ServerApp] nbclassic | extension was successfully loaded.
[I 2022-11-10 06:02:40.062 LabApp] JupyterLab extension loaded from /opt/conda/lib/python3.9/site-packages/jupyterlab
[I 2022-11-10 06:02:40.062 LabApp] JupyterLab application directory is /opt/conda/share/jupyter/lab
[I 2022-11-10 06:02:40.079 ServerApp] jupyterlab | extension was successfully loaded.
[I 2022-11-10 06:02:40.082 ServerApp] Serving notebooks from local directory: /home/jovyan
[I 2022-11-10 06:02:40.083 ServerApp] Jupyter Server 1.11.1 is running at:
[I 2022-11-10 06:02:40.083 ServerApp] http://6dd747e8a6e0:8888/lab
[I 2022-11-10 06:02:40.083 ServerApp]  or http://127.0.0.1:8888/lab
[I 2022-11-10 06:02:40.083 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[I 2022-11-10 06:03:21.552 LabApp] Build is up to date
[I 2022-11-10 06:03:29.431 ServerApp] Creating new notebook in
[I 2022-11-10 06:03:29.463 ServerApp] Writing notebook-signing key to /home/jovyan/.local/share/jupyter/notebook_secret
Operation not permitted (src/thread.cpp:309)
Operation not permitted (src/thread.cpp:309)
qemu: uncaught target signal 6 (Aborted) - core dumped
@jamesdbrock
Copy link
Member

Thanks for the bug report.

That image is based on https://hub.docker.com/layers/jupyter/base-notebook/lab-3.1.17/images/sha256-4d30116ec280251db5553725fbccc23da7e6feafbbcbf6a4d3ae57c1088cd837?context=explore

Please try to run the base image and tell me what happens:

docker run --rm -p 8888:8888 -v $PWD:/home/jovyan/pwd --name jupyter-base-notebook jupyter/base-notebook:lab-3.1.17@sha256:4d30116ec280251db5553725fbccc23da7e6feafbbcbf6a4d3ae57c1088cd837 jupyter lab --ServerApp.token=''

@jamesdbrock
Copy link
Member

The M1 Mac is a arm64 processor, and the ihaskell-notebook is based on that jupyterlab linux/amd64 image.

There is a warning about that in the log you posted.

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

It looks like your M1 is trying to run the docker image in amd64 qemu emulation, but crashing.

qemu: uncaught target signal 6 (Aborted) - core dumped

One thing you could try is building the image yourself based on the linux/arm64 jupyter/base-notebook https://hub.docker.com/layers/jupyter/base-notebook/lab-3.1.17/images/sha256-8508e0546e3f5662b98daf2154c7196f8d4232ec4b301028f5d13904dcd934b8?context=explore

There's a note about how to do that here.

https://github.com/IHaskell/ihaskell-notebook#composition-with-docker-stacks

I think the command to build would be

docker build --build-arg BASE_CONTAINER=jupyter/base-notebook:lab-3.1.17@sha256:8508e0546e3f5662b98daf2154c7196f8d4232ec4b301028f5d13904dcd934b8 --rm --force-rm -t ihaskell_notebook_arm64:latest .

@jamesdbrock
Copy link
Member

Maybe IHaskell/IHaskell#1384 will be helpful here.

@jamesdbrock
Copy link
Member

@jamesdbrock
Copy link
Member

I would like to know if the NixOS flake for Learn You a Haskell works on an M1 Mac.

@jamesdbrock
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants