forked from jupyter/docker-stacks
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add jupyter/julia-notebook (jupyter#1926)
* Add jupyter/julia-notebook There is a growing number of Julia users in the Jupyter ecosystem who do not use R, and hence would <3 to have a dedicated docker image that doesn't bring in all the R stuff that datascience-notebook brings in! The built image size is much smaller, and eventually paves the way to better ecosystem support for Julia. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add a test for julia-notebook * Tell tests what julia-notebook inherits from * Sort lists with julia-notebook * Fix README for julia-notebook * Add julia-notebook to the makefile * Move julia-notebook below r-notebook * Use hard tabs in Makefile * Do some more sorting * Rename test_julia to avoid mypy issue * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Re-order julia/r-notebook Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com> * Move julia-notebook stanza under r-notebook * Update inheritance diagram --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com>
- Loading branch information
Showing
14 changed files
with
165 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Documentation | ||
README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Copyright (c) Jupyter Development Team. | ||
# Distributed under the terms of the Modified BSD License. | ||
ARG OWNER=jupyter | ||
ARG BASE_CONTAINER=$OWNER/minimal-notebook | ||
FROM $BASE_CONTAINER | ||
|
||
LABEL maintainer="Jupyter Project <jupyter@googlegroups.com>" | ||
|
||
# Fix: https://github.com/hadolint/hadolint/wiki/DL4006 | ||
# Fix: https://github.com/koalaman/shellcheck/wiki/SC3014 | ||
SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||
|
||
USER root | ||
|
||
# Julia installation | ||
# Default values can be overridden at build time | ||
# (ARGS are in lower case to distinguish them from ENV) | ||
# Check https://julialang.org/downloads/ | ||
ARG julia_version="1.9.1" | ||
|
||
# Julia dependencies | ||
# install Julia packages in /opt/julia instead of ${HOME} | ||
ENV JULIA_DEPOT_PATH=/opt/julia \ | ||
JULIA_PKGDIR=/opt/julia \ | ||
JULIA_VERSION="${julia_version}" | ||
|
||
WORKDIR /tmp | ||
|
||
# hadolint ignore=SC2046 | ||
RUN set -x && \ | ||
julia_arch=$(uname -m) && \ | ||
julia_short_arch="${julia_arch}" && \ | ||
if [ "${julia_short_arch}" == "x86_64" ]; then \ | ||
julia_short_arch="x64"; \ | ||
fi; \ | ||
julia_installer="julia-${JULIA_VERSION}-linux-${julia_arch}.tar.gz" && \ | ||
julia_major_minor=$(echo "${JULIA_VERSION}" | cut -d. -f 1,2) && \ | ||
mkdir "/opt/julia-${JULIA_VERSION}" && \ | ||
wget --progress=dot:giga "https://julialang-s3.julialang.org/bin/linux/${julia_short_arch}/${julia_major_minor}/${julia_installer}" && \ | ||
tar xzf "${julia_installer}" -C "/opt/julia-${JULIA_VERSION}" --strip-components=1 && \ | ||
rm "${julia_installer}" && \ | ||
ln -fs /opt/julia-*/bin/julia /usr/local/bin/julia | ||
|
||
# Show Julia where conda libraries are \ | ||
RUN mkdir /etc/julia && \ | ||
echo "push!(Libdl.DL_LOAD_PATH, \"${CONDA_DIR}/lib\")" >> /etc/julia/juliarc.jl && \ | ||
# Create JULIA_PKGDIR \ | ||
mkdir "${JULIA_PKGDIR}" && \ | ||
chown "${NB_USER}" "${JULIA_PKGDIR}" && \ | ||
fix-permissions "${JULIA_PKGDIR}" | ||
|
||
USER ${NB_UID} | ||
|
||
# Add Julia packages. | ||
# Install IJulia as jovyan and then move the kernelspec out | ||
# to the system share location. Avoids problems with runtime UID change not | ||
# taking effect properly on the .local folder in the jovyan home dir. | ||
RUN julia -e 'import Pkg; Pkg.update()' && \ | ||
julia -e 'import Pkg; Pkg.add("HDF5")' && \ | ||
julia -e 'using Pkg; pkg"add IJulia"; pkg"precompile"' && \ | ||
# move kernelspec out of home \ | ||
mv "${HOME}/.local/share/jupyter/kernels/julia"* "${CONDA_DIR}/share/jupyter/kernels/" && \ | ||
chmod -R go+rx "${CONDA_DIR}/share/jupyter" && \ | ||
rm -rf "${HOME}/.local" && \ | ||
fix-permissions "${JULIA_PKGDIR}" "${CONDA_DIR}/share/jupyter" | ||
|
||
WORKDIR "${HOME}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Jupyter Notebook Julia Stack | ||
|
||
[![docker pulls](https://img.shields.io/docker/pulls/jupyter/julia-notebook.svg)](https://hub.docker.com/r/jupyter/julia-notebook/) | ||
[![docker stars](https://img.shields.io/docker/stars/jupyter/julia-notebook.svg)](https://hub.docker.com/r/jupyter/julia-notebook/) | ||
[![image size](https://img.shields.io/docker/image-size/jupyter/julia-notebook/latest)](https://hub.docker.com/r/jupyter/julia-notebook/ "jupyter/julia-notebook image size") | ||
|
||
GitHub Actions in the <https://github.com/jupyter/docker-stacks> project builds and pushes this image to Docker Hub. | ||
|
||
Please visit the project documentation site for help to use and contribute to this image and others. | ||
|
||
- [Jupyter Docker Stacks on ReadTheDocs](https://jupyter-docker-stacks.readthedocs.io/en/latest/index.html) | ||
- [Selecting an Image :: Core Stacks :: jupyter/julia-notebook](https://jupyter-docker-stacks.readthedocs.io/en/latest/using/selecting.html#jupyter-julia-notebook) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright (c) Jupyter Development Team. | ||
# Distributed under the terms of the Modified BSD License. | ||
import logging | ||
|
||
from tests.conftest import TrackedContainer | ||
|
||
LOGGER = logging.getLogger(__name__) | ||
|
||
|
||
def test_julia(container: TrackedContainer) -> None: | ||
"""Basic julia test""" | ||
LOGGER.info("Test that julia is correctly installed ...") | ||
logs = container.run_and_wait( | ||
timeout=5, | ||
tty=True, | ||
command=["start.sh", "bash", "-c", "julia --version"], | ||
) | ||
LOGGER.debug(logs) |