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

Fix iJavascript Dockerfile Snippet in Recipes.md #2136

Closed
1 task done
chusc123 opened this issue Aug 14, 2024 · 3 comments · Fixed by #2143
Closed
1 task done

Fix iJavascript Dockerfile Snippet in Recipes.md #2136

chusc123 opened this issue Aug 14, 2024 · 3 comments · Fixed by #2143
Labels
status:Need Info We believe we need more information about an issue from the reporting user to help, debug, fix type:Bug A problem with the definition of one of the docker images maintained here

Comments

@chusc123
Copy link

chusc123 commented Aug 14, 2024

What docker image(s) are you using?

minimal-notebook, pytorch-notebook

Host OS system

nixos

Host architecture

x86_64

What Docker command are you running?

docker run

How to Reproduce the problem?

Follow instructions on https://github.com/jupyter/docker-stacks/blob/main/docs/using/recipes.md to install ijavascript kernel in Jupyter docker build

Command output

No response

Expected behavior

No response

Actual behavior

Recipes.md documentation has a section on installing the ijavascript kernel that is out of date and broken. https://github.com/jupyter/docker-stacks/blob/main/docs/using/recipes.md

iJavascript is currently not compatible with Node >20 due to Zeromq, but the conda environment currently installs node22 and defaults it systemwide. See this issue in the ijavascript GitHub: n-riesco/ijavascript#289

If you follow the instructions in the documentation, the build will fail and it is fairly difficult to figure out why.

Anything else?

I have added a sample docker file that replaces condos node 22 with node 20 LTS that is compatible with ijavascript and also installs the build tools necessary to get it to work in the minimal notebook.

Here is a sample docker file that works to install ijavascript that should work with the other images as well:

# Start from the Jupyter minimal-notebook image on Quay.io
FROM quay.io/jupyter/minimal-notebook:latest

USER root

# Install essential build tools
RUN apt-get update && apt-get install -y build-essential

# Update Conda and install Node.js 20.x
RUN conda update -n base conda -y && \
    conda install -c conda-forge nodejs=20.* -y && \
    npm install -g npm@latest

# Install IJavaScript
RUN npm install -g ijavascript
RUN ijsinstall --install=global

# Clean up
RUN conda clean --all -f -y && \
    npm cache clean --force && \
    rm -rf /var/lib/apt/lists/*

# Create necessary directories and set permissions
RUN mkdir -p /home/jovyan/.local/share/jupyter/runtime && \
    chown -R jovyan:users /home/jovyan/.local && \
    chmod -R 755 /home/jovyan/.local

# Switch back to jovyan user
USER jovyan

# Command to run Jupyter Notebook
CMD ["start-notebook.sh", "--NotebookApp.ip='0.0.0.0'", "--NotebookApp.allow_origin='*'", "--NotebookApp.trust_xheaders=True"]

We should replace the sample docker file in the documentation with some variation of the above that works: https://github.com/jupyter/docker-stacks/blob/main/docs/using/recipes.md

Latest Docker version

  • I've updated my Docker version to the latest available, and the issue persists
@chusc123 chusc123 added the type:Bug A problem with the definition of one of the docker images maintained here label Aug 14, 2024
@mathbunnyru
Copy link
Member

Could you create a PR please?
I also highly recommend not pasting dockerfile directly in the documentation and adding a new file here: https://github.com/jupyter/docker-stacks/tree/main/docs/using/recipe_code

You can then use this file in documentation easily: you can find many examples in this file: https://github.com/jupyter/docker-stacks/blob/main/docs/using/recipes.md

@mathbunnyru mathbunnyru added the status:Need Info We believe we need more information about an issue from the reporting user to help, debug, fix label Aug 19, 2024
@mathbunnyru
Copy link
Member

@chusc123 would you like to work on PR?

@mathbunnyru
Copy link
Member

I decided to fix the recipe on my own - I tested the image and the javascript kernel seems to work fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:Need Info We believe we need more information about an issue from the reporting user to help, debug, fix type:Bug A problem with the definition of one of the docker images maintained here
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants