Fix IJulia installation

pull/595/head
David Anthoff 2019-02-24 14:07:06 -08:00
rodzic 0b1e6e60f0
commit 4cc66ddac1
1 zmienionych plików z 31 dodań i 20 usunięć

Wyświetl plik

@ -121,14 +121,6 @@ class JuliaBuildPack(PythonBuildPack):
mkdir -p ${JULIA_PKGDIR} && \ mkdir -p ${JULIA_PKGDIR} && \
chown ${NB_USER}:${NB_USER} ${JULIA_PKGDIR} chown ${NB_USER}:${NB_USER} ${JULIA_PKGDIR}
""" """
),
(
"${NB_USER}",
# HACK: Can't seem to tell IJulia to install in sys-prefix
# FIXME: Find way to get it to install under /srv and not $HOME?
r"""
julia -e 'using Pkg; Pkg.add("IJulia"); using IJulia; installkernel("Julia", "--project=.", env=Dict("JUPYTER_DATA_DIR"=>"${NB_PYTHON_PREFIX}/share/jupyter/kernels"));'
"""
) )
] ]
else: else:
@ -168,18 +160,37 @@ class JuliaBuildPack(PythonBuildPack):
""" """
if self.julia_env_exists: if self.julia_env_exists:
"${NB_USER}", return super().get_assemble_scripts() + [
# Install and pre-compile all libraries if they've opted into it. (
# In v0.6, Pkg.resolve() installs all the packages, but in v0.7+, we "${NB_USER}",
# have to manually Pkg.add() each of them (since the REQUIRES file # HACK: Can't seem to tell IJulia to install in sys-prefix
# format is deprecated). # FIXME: Find way to get it to install under /srv and not $HOME?
# The precompliation is done via `using {libraryname}`. r"""
r""" julia -e 'using Pkg; Pkg.add("IJulia"); using IJulia; installkernel("Julia", "--project={0}");'
julia --project=. -e 'using Pkg; Pkg.instantiate(); Pkg.precompile()'" """.format('~')
""" ),
# TODO: For some reason, `rm`ing the file fails with permission denied. (
# && rm /tmp/install-repo-dependencies.jl "${NB_USER}",
)] # HACK: Can't seem to tell IJulia to install in sys-prefix
# FIXME: Find way to get it to install under /srv and not $HOME?
r"""
mv ${HOME}/.local/share/jupyter/kernels/julia-${JULIA_VERSION%[.-]*} ${NB_PYTHON_PREFIX}/share/jupyter/kernels/julia-${JULIA_VERSION%[.-]*}
"""
),
(
"${NB_USER}",
# Install and pre-compile all libraries if they've opted into it.
# In v0.6, Pkg.resolve() installs all the packages, but in v0.7+, we
# have to manually Pkg.add() each of them (since the REQUIRES file
# format is deprecated).
# The precompliation is done via `using {libraryname}`.
r"""
julia --project=. -e 'using Pkg; Pkg.instantiate(); pkg"precompile"'
"""
# TODO: For some reason, `rm`ing the file fails with permission denied.
# && rm /tmp/install-repo-dependencies.jl
)
]
else: else:
require = self.binder_path('REQUIRE') require = self.binder_path('REQUIRE')
return super().get_assemble_scripts() + [( return super().get_assemble_scripts() + [(