47
47
48
48
"""
49
49
installkernel(name::AbstractString, options::AbstractString...;
50
+ julia::Cmd,
50
51
specname::AbstractString,
51
52
env=Dict())
52
53
@@ -66,8 +67,23 @@ The returned `kernelpath` is the path of the installed kernel directory, somethi
66
67
directory (which defaults to `name` with spaces replaced by hyphens).
67
68
68
69
You can uninstall the kernel by calling `rm(kernelpath, recursive=true)`.
70
+
71
+ You can specify a custom command to execute Julia via keyword argument
72
+ `julia`. For example, you may want specify that the Julia kernel is running
73
+ in a Docker container (but Jupyter will run outside of it), by calling
74
+ `installkernel` from within such a container instance like this (or similar):
75
+
76
+ ```
77
+ installkernel(
78
+ "Julia via Docker",
79
+ julia = `docker run --rm --net=host
80
+ --volume=/home/USERNAME/.local/share/jupyter:/home/USERNAME/.local/share/jupyter
81
+ some-container /opt/julia-1.x/bin/julia`
82
+ )
83
+ ```
69
84
"""
70
85
function installkernel (name:: AbstractString , julia_options:: AbstractString... ;
86
+ julia:: Cmd = ` $(joinpath (Sys. BINDIR,exe (" julia" ))) ` ,
71
87
specname:: AbstractString = replace (lowercase (name), " " => " -" ),
72
88
env:: Dict{<:AbstractString} = Dict {String,Any} ())
73
89
# Is IJulia being built from a debug build? If so, add "debug" to the description.
@@ -78,7 +94,7 @@ function installkernel(name::AbstractString, julia_options::AbstractString...;
78
94
@info (" Installing $name kernelspec in $juliakspec " )
79
95
rm (juliakspec, force= true , recursive= true )
80
96
try
81
- kernelcmd_array = String[joinpath (Sys . BINDIR, exe ( " julia" )) , " -i" ,
97
+ kernelcmd_array = String[julia. exec ... , " -i" ,
82
98
" --startup-file=yes" , " --color=yes" ]
83
99
append! (kernelcmd_array, julia_options)
84
100
ijulia_dir = get (ENV , " IJULIA_DIR" , dirname (@__DIR__ )) # support non-Pkg IJulia installs
0 commit comments