kopia lustrzana https://github.com/jupyterhub/repo2docker
Merge pull request #612 from davidanthoff/change-julia-env-handling
Use JULIA_PROJECT env variable to activate julia envpull/633/head
commit
053a623f13
|
@ -11,6 +11,8 @@ New features
|
||||||
------------
|
------------
|
||||||
- Support for julia `Project.toml`, `JuliaProject.toml` and `Manifest.toml` files in :pr:`595` by
|
- Support for julia `Project.toml`, `JuliaProject.toml` and `Manifest.toml` files in :pr:`595` by
|
||||||
:user:`davidanthoff`
|
:user:`davidanthoff`
|
||||||
|
- Set JULIA_PROJECT globally, so that every julia instance starts with the
|
||||||
|
julia environment activated in :pr:`612` by :user:`davidanthoff`.
|
||||||
|
|
||||||
API changes
|
API changes
|
||||||
-----------
|
-----------
|
||||||
|
|
|
@ -49,7 +49,6 @@ class JuliaProjectTomlBuildPack(PythonBuildPack):
|
||||||
a string of the environment setting:
|
a string of the environment setting:
|
||||||
- `JULIA_PATH`: base path where all Julia Binaries and libraries
|
- `JULIA_PATH`: base path where all Julia Binaries and libraries
|
||||||
will be installed
|
will be installed
|
||||||
- `JULIA_BINDIR`: path where all Julia Binaries will be installed
|
|
||||||
- `JULIA_DEPOT_PATH`: path where Julia libraries are installed.
|
- `JULIA_DEPOT_PATH`: path where Julia libraries are installed.
|
||||||
- `JULIA_VERSION`: default version of julia to be installed
|
- `JULIA_VERSION`: default version of julia to be installed
|
||||||
- `JUPYTER`: environment variable required by IJulia to point to
|
- `JUPYTER`: environment variable required by IJulia to point to
|
||||||
|
@ -60,13 +59,18 @@ class JuliaProjectTomlBuildPack(PythonBuildPack):
|
||||||
"""
|
"""
|
||||||
return super().get_build_env() + [
|
return super().get_build_env() + [
|
||||||
('JULIA_PATH', '${APP_BASE}/julia'),
|
('JULIA_PATH', '${APP_BASE}/julia'),
|
||||||
('JULIA_BINDIR', '${JULIA_PATH}/bin'),
|
|
||||||
('JULIA_DEPOT_PATH', '${JULIA_PATH}/pkg'),
|
('JULIA_DEPOT_PATH', '${JULIA_PATH}/pkg'),
|
||||||
('JULIA_VERSION', self.julia_version),
|
('JULIA_VERSION', self.julia_version),
|
||||||
('JUPYTER', '${NB_PYTHON_PREFIX}/bin/jupyter'),
|
('JUPYTER', '${NB_PYTHON_PREFIX}/bin/jupyter'),
|
||||||
('JUPYTER_DATA_DIR', '${NB_PYTHON_PREFIX}/share/jupyter'),
|
('JUPYTER_DATA_DIR', '${NB_PYTHON_PREFIX}/share/jupyter'),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
def get_env(self):
|
||||||
|
return super().get_env() + [
|
||||||
|
('JULIA_PROJECT', '${REPO_DIR}')
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
def get_path(self):
|
def get_path(self):
|
||||||
"""Adds path to Julia binaries to user's PATH.
|
"""Adds path to Julia binaries to user's PATH.
|
||||||
|
|
||||||
|
@ -75,7 +79,7 @@ class JuliaProjectTomlBuildPack(PythonBuildPack):
|
||||||
executable is added to the list.
|
executable is added to the list.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
return super().get_path() + ['${JULIA_BINDIR}']
|
return super().get_path() + ['${JULIA_PATH}/bin']
|
||||||
|
|
||||||
def get_build_scripts(self):
|
def get_build_scripts(self):
|
||||||
"""
|
"""
|
||||||
|
@ -109,6 +113,10 @@ class JuliaProjectTomlBuildPack(PythonBuildPack):
|
||||||
"""
|
"""
|
||||||
Return series of build-steps specific to "this" Julia repository
|
Return series of build-steps specific to "this" Julia repository
|
||||||
|
|
||||||
|
We make sure that the IJulia package gets installed into the default
|
||||||
|
environment, and not the project specific one, by running the
|
||||||
|
IJulia install command with JULIA_PROJECT="".
|
||||||
|
|
||||||
Instantiate and then precompile all packages in the repos julia
|
Instantiate and then precompile all packages in the repos julia
|
||||||
environment.
|
environment.
|
||||||
|
|
||||||
|
@ -119,7 +127,7 @@ class JuliaProjectTomlBuildPack(PythonBuildPack):
|
||||||
(
|
(
|
||||||
"${NB_USER}",
|
"${NB_USER}",
|
||||||
r"""
|
r"""
|
||||||
julia -e "using Pkg; Pkg.add(\"IJulia\"); using IJulia; installkernel(\"Julia\", \"--project=${REPO_DIR}\");" && \
|
JULIA_PROJECT="" julia -e "using Pkg; Pkg.add(\"IJulia\"); using IJulia; installkernel(\"Julia\", \"--project=${REPO_DIR}\");" && \
|
||||||
julia --project=${REPO_DIR} -e 'using Pkg; Pkg.instantiate(); pkg"precompile"'
|
julia --project=${REPO_DIR} -e 'using Pkg; Pkg.instantiate(); pkg"precompile"'
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
|
@ -4,9 +4,6 @@ if VERSION != v"1.0.2"
|
||||||
exit(1)
|
exit(1)
|
||||||
end
|
end
|
||||||
|
|
||||||
using Pkg
|
|
||||||
pkg"activate ."
|
|
||||||
|
|
||||||
try
|
try
|
||||||
# Test that the package was installed.
|
# Test that the package was installed.
|
||||||
using IteratorInterfaceExtensions
|
using IteratorInterfaceExtensions
|
||||||
|
|
|
@ -4,9 +4,6 @@ if VERSION < v"1.1.0"
|
||||||
exit(1)
|
exit(1)
|
||||||
end
|
end
|
||||||
|
|
||||||
using Pkg
|
|
||||||
pkg"activate ."
|
|
||||||
|
|
||||||
try
|
try
|
||||||
# Test that the package was installed.
|
# Test that the package was installed.
|
||||||
using IteratorInterfaceExtensions
|
using IteratorInterfaceExtensions
|
||||||
|
|
Ładowanie…
Reference in New Issue