To use a Julia kernel on LC JupyterHub, you need to first:
- Install IJulia
You can install `IJulia` using the Julia package manager, `Pkg`, after starting the Julia REPL. (This example uses the TOSS-compatible Julia binary at `/usr/gapps/julia/bin/julia` on the RZ. See `/usr/gapps/julia/bin/julia-power` for Sierra systems.)
janeh@rzslic4:~$ /usr/gapps/julia/bin/julia _ _ _ _(_)_ | Documentation: https://docs.julialang.org (_) | (_) (_) | _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help. | | | | | | |/ _` | | | | |_| | | | (_| | | Version 1.5.3 (2020-11-09) _/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release |__/ | julia> using Pkg julia> Pkg.add("IJulia") Installing known registries into `~/.julia` ######################################################################## 100.0% Added registry `General` to `~/.julia/registries/General` Resolving package versions... Installed VersionParsing ── v1.2.0 Installed libsodium_jll ─── v1.0.19+0 Installed SoftGlobalScope ─ v1.1.0 Installed ZeroMQ_jll ────── v4.3.2+6 Installed Conda ─────────── v1.5.1 Installed Parsers ───────── v1.1.0 Installed IJulia ────────── v1.23.2 Installed JSON ──────────── v0.21.1 Installed Artifacts ─────── v1.3.0 Installed MbedTLS_jll ───── v2.16.8+1 Installed ZMQ ───────────── v1.2.1 Installed MbedTLS ───────── v1.0.3 Installed JLLWrappers ───── v1.2.0 Downloading artifact: libsodium Downloading artifact: ZeroMQ Downloading artifact: MbedTLS Updating `~/.julia/environments/v1.5/Project.toml` [7073ff75] + IJulia v1.23.2 Updating `~/.julia/environments/v1.5/Manifest.toml` [56f22d72] + Artifacts v1.3.0 [8f4d0f93] + Conda v1.5.1 [7073ff75] + IJulia v1.23.2 [692b3bcd] + JLLWrappers v1.2.0 [682c06a0] + JSON v0.21.1 [739be429] + MbedTLS v1.0.3 [c8ffd9c3] + MbedTLS_jll v2.16.8+1 [69de0a69] + Parsers v1.1.0 [b85f4697] + SoftGlobalScope v1.1.0 [81def892] + VersionParsing v1.2.0 [c2297ded] + ZMQ v1.2.1 [8f1865be] + ZeroMQ_jll v4.3.2+6 [a9144af2] + libsodium_jll v1.0.19+0 [2a0f44e3] + Base64 [ade2ca70] + Dates [8ba89e20] + Distributed [7b1f6079] + FileWatching [b77e0a4c] + InteractiveUtils [76f85450] + LibGit2 [8f399da3] + Libdl [56ddb016] + Logging [d6f4376e] + Markdown [a63ad114] + Mmap [44cfe95a] + Pkg [de0858da] + Printf [3fa0cd96] + REPL [9a3f8284] + Random [ea8e919c] + SHA [9e88b42a] + Serialization [6462fe0b] + Sockets [8dfed614] + Test [cf7118a7] + UUIDs [4ec0a83e] + Unicode Building Conda ─→ `~/.julia/packages/Conda/tJJuN/deps/build.log` Building IJulia → `~/.julia/packages/IJulia/e8kqU/deps/build.log`
2. Find kernel on JupyterHub
Sign in to LC JupyterHub in the same zone where you installed IJulia (https://rzlc.llnl.gov/jupyter/ on the RZ and https://lc.llnl.gov/jupyter/ on the CZ). If you are already logged in, you will want to log out and log back in again.
After picking a machine on which to start a server, go to “New” to open a new notebook and you should see a “Julia” binary available for you. For example, having installed IJulia to a Julia v1.5.3 binary, I see “Julia 1.5.3” as a kernel option.
3. (Optional) Change the name of your Julia kernel
Installing IJulia created the file `~/.local/share/jupyter/kernels/julia-1.5/kernel.json` (though the name of the Julia subdirectory under `~/.local/share/jupyter/kernels/` will vary based on the binary to which you installed IJulia. When you open `kernel.json` you will see something like
{ "display_name": "Julia 1.5.3", "argv": [ "/collab/usr/gapps/julia/julia-1.5.3-x86-64/bin/julia", "-i", "--color=yes", "--project=@.", "/g/g0/janeh/.julia/packages/IJulia/e8kqU/src/kernel.jl", "{connection_file}" ], "language": "julia", "env": {}, "interrupt_mode": "signal" }
You can change the value bound to "display_name" to whatever you like. By changing it to `"display_name": "new Julia kernel"`, for example, logging out and back in to JupyterHub will allow you to create new notebooks with a "new Julia kernel" kernel.