Giter Club home page Giter Club logo

Comments (6)

LukasMasuch avatar LukasMasuch commented on May 13, 2024

Thanks for your suggestion. We currently do not have any plans to add a dedicated Julia flavor image. However, we have the concept of "on-click" installer scripts. A julia/julia kernel installer script would be a fantastic addition for the workspace. Currently, we do not have the resources to add this on ourselves, but if you want to try to contribute such a script you can take a look at this installer script for the r-interpreter/kernel as inspiration. Keep in mind that within the workspace you have full freedom to install anything that runs on ubuntu, e.g. you can install the julia interpreter via: apt-get install julia.

from ml-workspace.

sterlinm avatar sterlinm commented on May 13, 2024

Okay thanks! I've tried to put together a script based on the r-runtime installation script. I'm open to feedback if it's something you'd consider adding to the tools but can also just use it myself if it's not worth the time from your point of view.

#!/bin/sh

# Stops script execution if a command has an error
set -e

# Loop through arguments and process them
for arg in "$@"; do
    case $arg in
        -i|--install) INSTALL_ONLY=1 ; shift ;;
        *) break ;;
    esac
done

if ! hash julia 2>/dev/null; then
    echo "Installing Julia runtime. Please wait..."
    # See https://github.com/jupyter/docker-stacks/blob/master/datascience-notebook/Dockerfile
    
    # environment variables
    export JULIA_DEPOT_PATH=/opt/julia
    export JULIA_PKGDIR=/opt/julia
    export JULIA_VERSION=1.2.0
    
    mkdir /opt/julia-"$JULIA_VERSION" && \
    cd /tmp && \
    wget -q https://julialang-s3.julialang.org/bin/linux/x64/`echo "$JULIA_VERSION" | cut -d. -f 1,2`/julia-"$JULIA_VERSION"-linux-x86_64.tar.gz && \
    echo "926ced5dec5d726ed0d2919e849ff084a320882fb67ab048385849f9483afc47 *julia-$JULIA_VERSION-linux-x86_64.tar.gz" | sha256sum -c - && \
    tar xzf julia-"$JULIA_VERSION"-linux-x86_64.tar.gz -C /opt/julia-"$JULIA_VERSION" --strip-components=1 && \
    rm /tmp/julia-"$JULIA_VERSION"-linux-x86_64.tar.gz
    
    # symlink /usr/local/bin/julia to /opt/julia-$VERSION
    ln -fs /opt/julia-*/bin/julia /usr/local/bin/julia
    
    # Show julia where conda libraries are
    mkdir /etc/julia && \
    echo "push!(Libd1.DL_LOAD_PATH, \"$CONDA_DIR/lib\")" >> /etc/julia/juliarc.jl && \
    # create JULIA_PKGDIR \
    mkdir $JULIA_PKGDIR
    
    # Install IJulia and then move the kernelspec out
    # to the system share location.
    julia -e 'import Pkg; Pkg.update()' && \
    julia -e 'import Pkg; Pkg.add("HDF5")' && \
    julia -e "using Pkg; pkg\"add IJulia\"; pkg\"precompile\""

else
    echo "Julia runtime is already installed"
fi

from ml-workspace.

LukasMasuch avatar LukasMasuch commented on May 13, 2024

Hey @sterlinm, Thanks for your contribution 👍 I would definitely prefer to add this script to our tools collection. I just tested the script and installation works fine! Using Julia from command line also works for the limited examples I have tested. However, the Julia Jupyter Kernel (that was added during installation) is currently unable to start:

Stacktrace:
 [1] require(::Module, ::Symbol) at ./loading.jl:876
 [2] include at ./boot.jl:328 [inlined]
 [3] include_relative(::Module, ::String) at ./loading.jl:1094
 [4] include(::Module, ::String) at ./Base.jl:31
 [5] exec_options(::Base.JLOptions) at ./client.jl:295
 [6] _start() at ./client.jl:464
in expression starting at /opt/julia/packages/IJulia/fRegO/src/kernel.jl:1
[I 13:17:48.351 NotebookApp] KernelRestarter: restarting kernel (1/5), new random ports
ERROR: LoadError: ArgumentError: Package IJulia not found in current path:
- Run `import Pkg; Pkg.add("IJulia")` to install the IJulia package.

Also, you can remove the && \ line endings from the script, they are only required if used within a Dockerfile.

If you like, you can create a julia-interpreter.sh script in the tools folder and contribute it via pull request. As an alternative, I can also add the script myself for the next version.

from ml-workspace.

sterlinm avatar sterlinm commented on May 13, 2024

Hey @LukasMasuch sorry for the delayed response. I'm happy to do a pull request, though I want to test the Jupyter kernel issue first. I'm able to create a jupyter notebook with the Julia kernel and the kernel starts fine. I'll try starting a new instance from scratch with the script to make sure it wasn't some manual tweak that I forgot about.

from ml-workspace.

jan-loeffler avatar jan-loeffler commented on May 13, 2024

@sterlinm were you able to fix the issue?

from ml-workspace.

github-actions avatar github-actions commented on May 13, 2024

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 14 days

from ml-workspace.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.