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

Kernel binaries missing #61

Open
martinRenou opened this issue Feb 6, 2024 · 24 comments
Open

Kernel binaries missing #61

martinRenou opened this issue Feb 6, 2024 · 24 comments
Labels
bug Something isn't working

Comments

@martinRenou
Copy link
Member

Originally opened by @Alberto199810 in voici-demo voila-dashboards/voici-demo#23

Hello guys, I'm working on GitLab, and I'm using your library to deploy the Jupyter Notebook on GL Pages. The Pipeline end in success, and everything seems fine, apart from the fact that when I try to launch the page, it is stuck at the "Running" phase.

It seemed to me that the Kernel was not starting, and indeed in the deploy pipeline I've found this row:
"""
{...}/python3.10/site-packages/jupyterlite_xeus/add_on.py: UserWarning: kernel binaries not found for xpython-raw
"""

And then again same thing:

"""
{...}/python3.10/site-packages/jupyterlite_xeus/add_on.py: UserWarning: kernel binaries not found for xpython
"""

So, my feeling is that apparently it is not recognizing the kernel. Any idea in how to solve this?

@martinRenou martinRenou added the bug Something isn't working label Feb 6, 2024
@martinRenou
Copy link
Member Author

Thanks again for opening an issue!

Do you have a link to this deployment or is it private?

We'd need the content of the environment.yml file you used.

@Alberto199810
Copy link

Thanks again for opening an issue!

Do you have a link to this deployment or is it private?

We'd need the content of the environment.yml file you used.

Unfortunately it's private. This is the environment.yml:
"""
name: voici
channels:

  • ...

dependencies:

  • xeus-python
  • jupyterlite-xeus>=0.1.5,<0.2
  • pandas <2
  • numpy
  • matplotlib
  • plotly==5.18.0
  • ipywidgets==8.1.1
  • statsmodels==0.14.1
    """

While build-environment.yml is:
"""
name: build-env
channels:

  • ...
    dependencies:
  • python==3.10
  • pip
  • jupyterlite-xeus>=0.1.5,<0.2
  • pip:
    • voici>=0.5,<0.6
      """

Hope this can help.

@martinRenou
Copy link
Member Author

Thank you.

I see one weird thing, jupyterlite-xeus should only be in the build environment, not the run environment. Otherwise everything looks good.

You omitted the channels, was that on purpose because you use private channels?

You probably want to make sure to use the emscripten-forge channel.

@Alberto199810
Copy link

Thank you.

I see one weird thing, jupyterlite-xeus should only be in the build environment, not the run environment. Otherwise everything looks good.

You omitted the channels, was that on purpose because you use private channels?

You probably want to make sure to use the emscripten-forge channel.

Yes, I omitted the channels due to private channels. But everything works fine, the packages are in my channels.

I tried to even remove the jupyterlite-xeus from the run environment, but still it's not working.

Maybe the mistake is in the .gitlab-ci.yml?
"""
image: python

pages:
stage: deploy
before script:
- apt-get install -y curl
- curl -L {channel}
- chmod +x bin/micromamba
- export PATH=$PWD/bin:$PATH
- eval "$(micromamba shell hook --shell bash)"

script:
- micromamba create -n build-env --file build-environment.yml
- micromamba activate build-env
- voici build --contents content --output-dir public

artifacts:
paths:
- public/

only:

  • main
    """

I really struggle to understand the reason of the error. I took a look at the add_on.py but don't see a way to overcome this.

@martinRenou
Copy link
Member Author

Are you mirroring the emscripten-forge channel?

The private channels may be the culprit here. If you're mirroring the emscripten-forge channel I wonder if some files are missing from the xeus-python build.

@Alberto199810
Copy link

Are you mirroring the emscripten-forge channel?

The private channels may be the culprit here. If you're mirroring the emscripten-forge channel I wonder if some files are missing from the xeus-python build.

Yes, I actually am... I'm using jupyter-xeus==0.1.6 and xeus-python 0.15.13

Maybe it's another weird thing but I see that after creating the environment and downloading the packages, once I run the "voici" commands restarts the downloads from scratch. Seems like he is not using the environment. Can this affect? I don't know.
At the end of the installation, it says

"""
To activate this environment, use:
micromamba activate voici
"""

Immediately after this, it throws the warning of the kernel binaries not found. Does this ring a bell?

@martinRenou
Copy link
Member Author

To activate this environment, use:
micromamba activate voici

You can ignore this. This is just micromamba creating the environment for the emscripten runtime. You should not try to activate it.

Are you able to download the xeus-python package from your emscripten-forge mirror and make sure it's exactly the same as in https://beta.mamba.pm/get/emscripten-forge/emscripten-wasm32/xeus-python-0.15.13-h1be4ea2_1.tar.bz2 ?

@DerThorsten
Copy link
Collaborator

DerThorsten commented Feb 6, 2024

just to double check, you named the file environment.yml and not environment.yaml
(since https://github.com/jupyterlite/xeus/blob/de72e20dbe263751aa19aabf1fb91878df03e29a/jupyterlite_xeus/add_on.py#L80C9-L80C25)

@martinRenou
Copy link
Member Author

just to double check, you named the file environment.yml and not environment.yaml

Taking a mental note that automatically supporting both would be nice

@DerThorsten
Copy link
Collaborator

DerThorsten commented Feb 6, 2024

lets not have any default and throw an error when nothing is given

@Alberto199810
Copy link

To activate this environment, use:

micromamba activate voici

You can ignore this. This is just micromamba creating the environment for the emscripten runtime. You should not try to activate it.

Are you able to download the xeus-python package from your emscripten-forge mirror and make sure it's exactly the same as in https://beta.mamba.pm/get/emscripten-forge/emscripten-wasm32/xeus-python-0.15.13-h1be4ea2_1.tar.bz2 ?

Thanks for the replies. Im seeing here that my package is stored as xeus-python-0.15.13-py{...}.conda.

Can this create a difference?
Unfortunately I struggle to go deeper than this, I cannot find the .tar.bz2 for the xeus-python.

@martinRenou
Copy link
Member Author

martinRenou commented Feb 6, 2024

lets not have any default and throw an error when nothing is given

Sounds also good, but another breaking change.

@Alberto199810
Copy link

just to double check, you named the file environment.yml and not environment.yaml

(since https://github.com/jupyterlite/xeus/blob/de72e20dbe263751aa19aabf1fb91878df03e29a/jupyterlite_xeus/add_on.py#L80C9-L80C25)

Yes, it's .yml.

@martinRenou
Copy link
Member Author

Can this create a difference?

IIRC the (new?) .conda format is just a zipped file so you should be able to unzip it and compare its content with the .tar.bz2 I pointed to.

I have a feeling this is not coming from your emscripten-forge mirror though? We don't ship .conda files on emscripten-forge. Not sure how your mirror works but I feel like you may have mirrored conda-forge instead.

@martinRenou
Copy link
Member Author

martinRenou commented Feb 6, 2024

Another clue that makes me think you mirrored conda-forge instead is this:

 {...}/python3.10/site-packages/jupyterlite_xeus/add_on.py: UserWarning: kernel binaries not found for xpython-raw

We explicitly remove the xpython-raw kernel in emscripten-forge so jupyter-xeus should really not look for it.

@Alberto199810
Copy link

Alberto199810 commented Feb 6, 2024

Can this create a difference?

IIRC the (new?) .conda format is just a zipped file so you should be able to unzip it and compare its content with the .tar.bz2 I pointed to.

I have a feeling this is not coming from your emscripten-forge mirror though? We don't ship .conda files on emscripten-forge. Not sure how your mirror works but I feel like you may have mirrored conda-forge instead.

you're right, I think it's mirroring conda-forge most likely. Can this cause a serious difference?

  • I'm just thinking of way to overcome this. Before, I was using pyodide, but it slows down things quite a lot. Can a previous version of xeus-python work as well? Or what would you suggest? I need the installment of the packages while creating the app, and not at runtime.

@DerThorsten
Copy link
Collaborator

is there some way to reproduce this in an open-source fashion? Otherwise, we should close this as this is some problem with your mirroring

@Alberto199810
Copy link

is there some way to reproduce this in an open-source fashion? Otherwise, we should close this as this is some problem with your mirroring

Nope. At this stage I am convinced it is an issue of mirroring. But maybe before closing you have some suggestions on what else can be used that is in conda-forge.

@martinRenou
Copy link
Member Author

you're right, I think it's mirroring conda-forge most likely. Can this cause a serious difference?

Yeah you should also mirror emscripten-forge.

Though I'm a bit skeptical this would fix your issue. You are in a weird situation where micromamba is not respecting the specified platform whatsoever. Otherwise it would complain earlier saying it cannot install xeus-python from the specified channels.

@DerThorsten
Copy link
Collaborator

maybe this helps, but for pyjs I create a sphinx documentation using an explicit jupyterlite config https://github.com/emscripten-forge/pyjs/blob/main/docs/conf.py#L34

There I create the prefix first, build & install stuff, and then use that in the docs

@Alberto199810
Copy link

Fine, thank you for help. We can close this and I'll try to find an alternative way to achieve the goal, otherwise I'll stick to the "slower" solution, which is still fine.

@psychemedia
Copy link

@martinRenou re: using enviroment.yml, the README of this repo says "From environment.yaml" ?

Also, if you do use environment.yaml, then that config file seems to be used by the Github Action to build the parent Jupyterlite environment?

@martinRenou
Copy link
Member Author

The README lies about the file extension, the code tells the truth https://github.com/jupyterlite/xeus/blob/main/jupyterlite_xeus/add_on.py#L80

@martinRenou
Copy link
Member Author

we should fix the README

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