Skip to content

Commit

Permalink
updated from upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
Cloud User committed Jun 18, 2019
2 parents 88e8531 + d4cbf2f commit 8b1c377
Show file tree
Hide file tree
Showing 98 changed files with 11,981 additions and 224 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* text=auto eol=lf

8 changes: 6 additions & 2 deletions .github/issue_template.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
Hi! Thanks for using the Jupyter Docker Stacks.

If you are looking to contribute to the images, please see the [Contributor's Guide] (http://jupyter-docker-stacks.readthedocs.io/en/latest/#) in the documentation for our preferred processes.
Please review the following guidance about how to ask questions, contribute changes, or report bugs in the Docker images maintained here.

If you are reporting an issue with one of the existing images, please answer the questions below to help us troubleshoot the problem. Please be as thorough as possible.
1. If you have a general question about using these Docker images or with Jupyter + Docker in general, please post your question in the [Jupyter Discourse Q&A section](https://discourse.jupyter.org/c/questions) so that it can be seen, discussed, and hopefully answered by the community.

2. If you are looking to contribute to the images, please see the [Contributor's Guide](http://jupyter-docker-stacks.readthedocs.io/en/latest/#) in the documentation for our preferred processes.

3. If you are reporting an issue with one of the existing images, please answer the questions below to help us troubleshoot the problem. Please be as thorough as possible.

**What docker image you are using?**

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,5 @@ dockerspawner
dockerspawner.tar.gz
*.orig
.ipynb_checkpoints/
.vscode/
.pytest_cache/
16 changes: 16 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

sphinx:
configuration: docs/conf.py

formats: all

python:
version: 3.7
install:
- requirements: requirements-dev.txt
45 changes: 39 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,44 @@
dist: xenial
language: python
python:
- 3.6
- 3.7
sudo: required
services:
- docker
install:
- make dev-env
script:
- make test/docs docs
- make build-test-all DARGS="--build-arg TEST_ONLY_BUILD=1"

jobs:
include:
- stage: diff-test
install:
- pip install --upgrade pip
- make dev-env
script:
- set -e
- if [ $(make n-docs-diff) -ne 0 ]; then make docs; fi;
- if [ $(make n-other-diff) -ne 0 ]; then make build-test-all DARGS="--build-arg TEST_ONLY_BUILD=1"; fi;
- stage: push-tx
install:
- pip install --upgrade pip
- make dev-env
script:
- if [ $(make n-docs-diff DIFF_RANGE=$TRAVIS_COMMIT_RANGE) -ne 0 ]; then make tx-en; fi;
- stage: full-test
install:
- pip install --upgrade pip
- make dev-env
script:
- set -e
- make docs
- make build-test-all DARGS="--build-arg TEST_ONLY_BUILD=1"

stages:
- name: diff-test
if: type = pull_request
- name: push-tx
if: type = push AND branch = master
- name: full-test
if: type = cron AND branch = master

env:
global:
secure: JDQKgB1laaenzmEGI9gduwK/iS0030qsl62njJg3jib0R8wxBi2OeetEdoGl9m4NFsqqnp0OO7nm4rzGfuwjL1A38flSlXOTxhjm/hvo3vmnqVu5lDcdk9+IRkafnfd3Dyd86tLxRVETOqZwCLmdNkB2fmQII8du5IIqbJuUGp8DrG7kVMf3NBr9rjkZRfByQrgG4s1NXuT61VvpWMPJAOhcrImuHBheVJDEV0U3n6Xavd7Wo+pAHrHU8exvYTZ1IzZMbHc6K0iC/NpCHcH9+9DAeLDk/q1aDNqbTExnQevOHZzNqgHC2qFOlN4jfy/TLYLpLXtUismneBBqVSK3iZso3Vqy2BRXWgouI+Tt+08ffocy9XPwEzSwkgPgDlFVUikPOy5imwjpDb13RMIyMY4CKlSOdQx2rH2kPkZ0MJJPcki3KGuGl3qRvqyblMn+lZvjAu6WVLZfo7EtcxsQ0ZZxbAbGoUVl27FHg+UvIfC0I3wEcZIp7oED47Q8s0MdCijD3AwkRPvx/iyp3J0A42su7kkOooFcmUItEIqegQJ4Aki1FBv2i5vHmBobClktytZceLsKvzCeLjMpL9HcUVfUaJDKRwtUYIozpYeBnac+E6J1s6glcqLrXIHWez8N6SzokBa6SPqdtODdzzk5OJupByub6CYWsRXvxIQ7/wI=
10 changes: 7 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Thanks for for contributing! Please see the [Contributor Guide](https://jupyter-docker-stacks.readthedocs.io) in the
documentation for information about how to contribute [package updates](http://jupyter-docker-stacks.readthedocs.io/en/latest/contributing/packages.html),
Thanks for contributing! Please see the
[Contributor Guide](https://jupyter-docker-stacks.readthedocs.io) in the documentation for
information about how to contribute
[package updates](http://jupyter-docker-stacks.readthedocs.io/en/latest/contributing/packages.html),
[recipes](http://jupyter-docker-stacks.readthedocs.io/en/latest/contributing/recipes.html),
[tests](http://jupyter-docker-stacks.readthedocs.io/en/latest/contributing/tests.html),
[features](http://jupyter-docker-stacks.readthedocs.io/en/latest/contributing/features.html),
and [community-maintained stacks](http://jupyter-docker-stacks.readthedocs.io/en/latest/contributing/stacks.html).
[translations](https://jupyter-docker-stacks.readthedocs.io/en/latest/contributing/translations.html),
and
[community-maintained stacks](http://jupyter-docker-stacks.readthedocs.io/en/latest/contributing/stacks.html).
24 changes: 22 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
SHELL:=bash
OWNER:=jupyter
ARCH:=$(shell uname -m)
DIFF_RANGE?=master...HEAD

# Need to list the images in build dependency order
ifeq ($(ARCH),ppc64le)
Expand Down Expand Up @@ -60,8 +61,27 @@ dev-env: ## install libraries required to build docs and run tests
docs: ## build HTML documentation
make -C docs html

test/docs: ## check links in Sphinx documentation
make -C docs linkcheck
n-docs-diff: ## number of docs/ files changed since branch from master
@git diff --name-only $(DIFF_RANGE) -- docs/ ':!docs/locale' | wc -l | awk '{print $$1}'


n-other-diff: ## number of files outside docs/ changed since branch from master
@git diff --name-only $(DIFF_RANGE) -- ':!docs/' | wc -l | awk '{print $$1}'

tx-en: ## rebuild en locale strings and push to master (req: GH_TOKEN)
@git config --global user.email "[email protected]"
@git config --global user.name "Travis CI"
@git checkout master

@make -C docs clean gettext
@cd docs && sphinx-intl update -p _build/gettext -l en

@git add docs/locale/en
@git commit -m "[ci skip] Update en source strings (build: $$TRAVIS_JOB_NUMBER)"

@git remote add origin-tx https://$${GH_TOKEN}@github.com/jupyter/docker-stacks.git
@git push -u origin-tx master


test/%: ## run tests against a stack
@TEST_IMAGE="$(OWNER)/$(notdir $@)" pytest test
Expand Down
26 changes: 16 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
[![Google Group](https://img.shields.io/badge/-Google%20Group-lightgrey.svg)](https://groups.google.com/forum/#!forum/jupyter)
![Read the Docs](https://img.shields.io/readthedocs/jupyter-docker-stacks.svg)
[![](https://images.microbadger.com/badges/version/jupyter/base-notebook.svg)](https://microbadger.com/images/jupyter/base-notebook "Get your own version badge on microbadger.com")
[![Discourse badge](https://img.shields.io/discourse/https/discourse.jupyter.org/users.svg?color=%23f37626)](https://discourse.jupyter.org/c/questions "Jupyter Discourse Q&A")
[![Read the Docs badge](https://img.shields.io/readthedocs/jupyter-docker-stacks.svg)](https://jupyter-docker-stacks.readthedocs.io/en/latest/ "Documentation build status")
[![DockerHub badge](https://images.microbadger.com/badges/version/jupyter/base-notebook.svg)](https://microbadger.com/images/jupyter/base-notebook "Recent tag/version of jupyter/base-notebook")
[![Binder badget](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/jupyter/docker-stacks/master?filepath=README.ipynb "Launch a jupyter/base-notebook container on mybinder.org")

# Jupyter Docker Stacks

Jupyter Docker Stacks are a set of ready-to-run Docker images containing Jupyter applications and interactive computing tools.
Jupyter Docker Stacks are a set of ready-to-run [Docker images](https://hub.docker.com/u/jupyter) containing Jupyter applications and interactive computing tools.

## Quick Start

The two examples below may help you get started if you [have Docker installed](https://docs.docker.com/install/) know [which Docker image](http://jupyter-docker-stacks.readthedocs.io/en/latest/using/selecting.html) you want to use, and want to launch a single Jupyter Notebook server in a container.
You can try a [recent build of the jupyter/base-notebook image on mybinder.org](https://mybinder.org/v2/gh/jupyter/docker-stacks/master?filepath=README.ipynb) by simply clicking the preceding link. Otherwise, the two examples below may help you get started if you [have Docker installed](https://docs.docker.com/install/) know [which Docker image](http://jupyter-docker-stacks.readthedocs.io/en/latest/using/selecting.html) you want to use, and want to launch a single Jupyter Notebook server in a container.

The [User Guide on ReadTheDocs](http://jupyter-docker-stacks.readthedocs.io/) describes additional uses and features in detail.

**Example 1:** This command pulls the `jupyter/scipy-notebook` image tagged `2c80cf3537ca` from Docker Hub if it is not already present on the local host. It then starts a container running a Jupyter Notebook server and exposes the server on host port 8888. The server logs appear in the terminal. Visiting `http://<hostname>:8888/?token=<token>` in a browser loads the Jupyter Notebook dashboard page, where `hostname` is the name of the computer running docker and `token` is the secret token printed in the console. The container remains intact for restart after the notebook server exits.
**Example 1:** This command pulls the `jupyter/scipy-notebook` image tagged `17aba6048f44` from Docker Hub if it is not already present on the local host. It then starts a container running a Jupyter Notebook server and exposes the server on host port 8888. The server logs appear in the terminal. Visiting `http://<hostname>:8888/?token=<token>` in a browser loads the Jupyter Notebook dashboard page, where `hostname` is the name of the computer running docker and `token` is the secret token printed in the console. The container remains intact for restart after the notebook server exits.

docker run -p 8888:8888 jupyter/scipy-notebook:2c80cf3537ca
docker run -p 8888:8888 jupyter/scipy-notebook:17aba6048f44

**Example 2:** This command pulls the `jupyter/datascience-notebook` image tagged `3772fffc4aa4` from Docker Hub if it is not already present on the local host. It then starts an *ephemeral* container running a Jupyter Notebook server and exposes the server on host port 10000. The command mounts the current working directory on the host as `/home/jovyan/work` in the container. The server logs appear in the terminal. Visiting `http://<hostname>:10000/?token=<token>` in a browser loads JupyterLab, where `hostname` is the name of the computer running docker and `token` is the secret token printed in the console. Docker destroys the container after notebook server exit, but any files written to `~/work` in the container remain intact on the host.
**Example 2:** This command performs the same operations as **Example 1**, but it exposes the server on host port 10000 instead of port 8888. Visiting ``http://<hostname>:10000/?token=<token>`` in a browser loads JupyterLab, where ``hostname`` is the name of the computer running docker and ``token`` is the secret token printed in the console.::

docker run --rm -p 10000:8888 -e JUPYTER_ENABLE_LAB=yes -v "$PWD":/home/jovyan/work jupyter/datascience-notebook:3772fffc4aa4
docker run -p 10000:8888 jupyter/scipy-notebook:17aba6048f44

**Example 3:** This command pulls the `jupyter/datascience-notebook` image tagged `9b06df75e445` from Docker Hub if it is not already present on the local host. It then starts an *ephemeral* container running a Jupyter Notebook server and exposes the server on host port 10000. The command mounts the current working directory on the host as `/home/jovyan/work` in the container. The server logs appear in the terminal. Visiting `http://<hostname>:10000/?token=<token>` in a browser loads JupyterLab, where `hostname` is the name of the computer running docker and `token` is the secret token printed in the console. Docker destroys the container after notebook server exit, but any files written to `~/work` in the container remain intact on the host.

docker run --rm -p 10000:8888 -e JUPYTER_ENABLE_LAB=yes -v "$PWD":/home/jovyan/work jupyter/datascience-notebook:9b06df75e445

## Contributing

Expand All @@ -34,5 +39,6 @@ Please see the [Contributor Guide on ReadTheDocs](http://jupyter-docker-stacks.r

* [Documentation on ReadTheDocs](http://jupyter-docker-stacks.readthedocs.io/)
* [Issue Tracker on GitHub](https://github.com/jupyter/docker-stacks)
* [Jupyter Google Group](https://groups.google.com/forum/#!forum/jupyter)
* [Jupyter Discourse Q&A](https://discourse.jupyter.org/c/questions)
* [Jupyter Website](https://jupyter.org)
* [Images on DockerHub](https://hub.docker.com/u/jupyter)
18 changes: 9 additions & 9 deletions all-spark-notebook/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
FROM jupyter/pyspark-notebook
ARG BASE_CONTAINER=jupyter/pyspark-notebook
FROM $BASE_CONTAINER

LABEL maintainer="Jupyter Project <[email protected]>"

Expand All @@ -14,27 +15,26 @@ RUN fix-permissions $R_LIBS_USER
RUN apt-get update && \
apt-get install -y --no-install-recommends \
fonts-dejavu \
tzdata \
gfortran \
gcc && apt-get clean && \
gcc && \
rm -rf /var/lib/apt/lists/*

USER $NB_UID

# R packages
RUN conda install --quiet --yes \
'r-base=3.4.1' \
'r-base=3.5.1' \
'r-irkernel=0.8*' \
'r-ggplot2=2.2*' \
'r-sparklyr=0.7*' \
'r-ggplot2=3.1*' \
'r-sparklyr=0.9*' \
'r-rcurl=1.95*' && \
conda clean -tipsy && \
conda clean --all -f -y && \
fix-permissions $CONDA_DIR && \
fix-permissions /home/$NB_USER

# Apache Toree kernel
RUN pip install --no-cache-dir \
https://dist.apache.org/repos/dist/dev/incubator/toree/0.2.0-incubating-rc5/toree-pip/toree-0.2.0.tar.gz \
https://dist.apache.org/repos/dist/release/incubator/toree/0.3.0-incubating/toree-pip/toree-0.3.0.tar.gz \
&& \
jupyter toree install --sys-prefix && \
rm -rf /home/$NB_USER/.local && \
Expand All @@ -43,7 +43,7 @@ RUN pip install --no-cache-dir \

# Spylon-kernel
RUN conda install --quiet --yes 'spylon-kernel=0.4*' && \
conda clean -tipsy && \
conda clean --all -f -y && \
python -m spylon_kernel install --sys-prefix && \
rm -rf /home/$NB_USER/.local && \
fix-permissions $CONDA_DIR && \
Expand Down
2 changes: 1 addition & 1 deletion all-spark-notebook/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![docker pulls](https://img.shields.io/docker/pulls/jupyter/all-spark-notebook.svg) ![docker stars](https://img.shields.io/docker/stars/jupyter/all-spark-notebook.svg) [![](https://images.microbadger.com/badges/image/jupyter/all-spark-notebook.svg)](https://microbadger.com/images/jupyter/all-spark-notebook "jupyter/all-spark-notebook image metadata")
[![docker pulls](https://img.shields.io/docker/pulls/jupyter/all-spark-notebook.svg)](https://hub.docker.com/r/jupyter/all-spark-notebook/) [![docker stars](https://img.shields.io/docker/stars/jupyter/all-spark-notebook.svg)](https://hub.docker.com/r/jupyter/all-spark-notebook/) [![image metadata](https://images.microbadger.com/badges/image/jupyter/all-spark-notebook.svg)](https://microbadger.com/images/jupyter/all-spark-notebook "jupyter/all-spark-notebook image metadata")

# Jupyter Notebook Python, Scala, R, Spark, Mesos Stack

Expand Down
2 changes: 2 additions & 0 deletions all-spark-notebook/hooks/index.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
INDEX_ROW="|\`${BUILD_TIMESTAMP}\`|\`jupyter/${IMAGE_SHORT_NAME}:${GIT_SHA_TAG}\`|[Git diff](https://github.com/jupyter/docker-stacks/commit/${SOURCE_COMMIT})<br />[Dockerfile](https://github.com/jupyter/docker-stacks/blob/${SOURCE_COMMIT}/${IMAGE_SHORT_NAME}/Dockerfile)<br />[Build manifest](./${IMAGE_SHORT_NAME}-${GIT_SHA_TAG})|"
sed "/|-|/a ${INDEX_ROW}" -i "$INDEX_FILE"
46 changes: 46 additions & 0 deletions all-spark-notebook/hooks/manifest.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
cat << EOF > "$MANIFEST_FILE"
* Build datetime: ${BUILD_TIMESTAMP}
* DockerHub build code: ${BUILD_CODE}
* Docker image: ${DOCKER_REPO}:${GIT_SHA_TAG}
* Git commit SHA: [${SOURCE_COMMIT}](https://github.com/jupyter/docker-stacks/commit/${SOURCE_COMMIT})
* Git commit message:
\`\`\`
${COMMIT_MSG}
\`\`\`

## Apache Spark

\`\`\`
$(docker run --rm ${IMAGE_NAME} bash -c '$SPARK_HOME/bin/spark-submit --version' 2>&1)
\`\`\`

## Python Packages

\`\`\`
$(docker run --rm ${IMAGE_NAME} python --version)
\`\`\`

\`\`\`
$(docker run --rm ${IMAGE_NAME} conda info)
\`\`\`

\`\`\`
$(docker run --rm ${IMAGE_NAME} conda list)
\`\`\`

## R Packages

\`\`\`
$(docker run --rm ${IMAGE_NAME} R --version)
\`\`\`

\`\`\`
$(docker run --rm ${IMAGE_NAME} R --silent -e 'installed.packages(.Library)[, c(1,3)]')
\`\`\`

## Apt Packages

\`\`\`
$(docker run --rm ${IMAGE_NAME} apt list --installed)
\`\`\`
EOF
38 changes: 38 additions & 0 deletions all-spark-notebook/hooks/post_push
Original file line number Diff line number Diff line change
@@ -1,12 +1,50 @@
#!/bin/bash
set -e

# Tag the latest build with the short git sha. Push the tag in addition
# to the "latest" tag already pushed.
GIT_SHA_TAG=${SOURCE_COMMIT:0:12}
docker tag $IMAGE_NAME $DOCKER_REPO:$GIT_SHA_TAG
docker push $DOCKER_REPO:$GIT_SHA_TAG

# Create a working directory.
BUILD_TIMESTAMP=$(date -u +%FT%TZ)
WORKDIR=$(mktemp -d)
GIT_URI="[email protected]:jupyter/docker-stacks.wiki.git"
GIT_SANDBOX="${WORKDIR}/docker-stacks.wiki"
IMAGE_SHORT_NAME=$(basename $DOCKER_REPO)
MANIFEST_FILE="${GIT_SANDBOX}/manifests/${IMAGE_SHORT_NAME}-${GIT_SHA_TAG}.md"
INDEX_FILE="${GIT_SANDBOX}/Home.md"

# Configure git so it can push back to GitHub.
eval $(ssh-agent -s)
ssh-add <(echo "$DEPLOY_KEY")
ssh-add -l
git config --global user.email "[email protected]"
git config --global user.name "Jupyter Docker Stacks"

# Glone the GitHub project wiki.
pushd "$WORKDIR"
git clone "$GIT_URI"
popd

# Render the build manifest template.
mkdir -p $(dirname "$MANIFEST_FILE")
source hooks/manifest.tmpl
source hooks/index.tmpl

# Push the wiki update back to GitHub.
pushd "$GIT_SANDBOX"
git add .
git commit -m "DOC: Build ${MANIFEST_FILE}"
git push -u origin master
popd

# Shutdown the ssh agent for good measure.
ssh-agent -k

# Invoke all downstream build triggers.
set +e
for url in $(echo $NEXT_BUILD_TRIGGERS | sed "s/,/ /g")
do
curl -X POST $url
Expand Down
Loading

0 comments on commit 8b1c377

Please sign in to comment.