diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..f0343596 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,14 @@ +## Describe your changes + +## Issue ticket if applicable + + + +## Checklist (especially for first-time contributors) + +- [ ] I have performed a self-review of my code +- [ ] If it is a core feature, I have added thorough tests +- [ ] I will try not to use force-push to make the review process easier for reviewers +- [ ] I have updated the documentation for significant changes + + diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 0f189729..97e61501 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -67,10 +67,10 @@ jobs: # https://github.com/docker/build-push-action/tree/master#usage # https://github.com/docker/build-push-action/blob/master/docs/advanced/multi-platform.md - name: Set up QEMU (for docker buildx) 🐳 - uses: docker/setup-qemu-action@27d0a4f181a40b142cce983c5393082c365d1480 # dependabot updates to latest release + uses: docker/setup-qemu-action@8b122486cedac8393e77aa9734c3528886e4a1a8 # dependabot updates to latest release - name: Set up Docker Buildx (for multi-arch builds) 🐳 - uses: docker/setup-buildx-action@94ab11c41e45d028884a99163086648e898eed25 # dependabot updates to latest release + uses: docker/setup-buildx-action@dc7b9719a96d48369863986a06765841d7ea23f6 # dependabot updates to latest release - name: Checkout Repo ⚡️ uses: actions/checkout@v3 @@ -97,7 +97,7 @@ jobs: - name: Checkout Wiki Repo 📃 uses: actions/checkout@v3 with: - repository: ${{github.repository}}.wiki + repository: ${{ github.repository }}.wiki path: wiki/ - name: Create tags and manifest 🏷 @@ -107,15 +107,15 @@ jobs: if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.event_name == 'schedule' uses: stefanzweifel/git-auto-commit-action@49620cd3ed21ee620a48530e81dba0d139c9cb80 # dependabot updates to latest release with: - commit_message: "Automated wiki publish for ${{github.sha}}" + commit_message: "Automated wiki publish for ${{ github.sha }}" repository: wiki/ - name: Login to Docker Hub 🔐 if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.event_name == 'schedule' - uses: docker/login-action@dd4fa0671be5250ee6f50aedf4cb05514abda2c7 # dependabot updates to latest release + uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b # dependabot updates to latest release with: - username: ${{secrets.DOCKERHUB_USERNAME}} - password: ${{secrets.DOCKERHUB_TOKEN}} + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Push Images to Docker Hub 📤 if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.event_name == 'schedule' diff --git a/.github/workflows/hub-overview.yml b/.github/workflows/hub-overview.yml index f590f63e..63610fbd 100644 --- a/.github/workflows/hub-overview.yml +++ b/.github/workflows/hub-overview.yml @@ -34,8 +34,8 @@ jobs: - name: push README to Dockerhub for base-notebook 🐳 uses: christian-korneck/update-container-description-action@d36005551adeaba9698d8d67a296bd16fa91f8e8 # dependabot updates to latest release env: - DOCKER_USER: ${{secrets.DOCKERHUB_USERNAME}} - DOCKER_PASS: ${{secrets.DOCKERHUB_TOKEN}} + DOCKER_USER: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKER_PASS: ${{ secrets.DOCKERHUB_TOKEN }} with: destination_container_repo: jupyter/base-notebook provider: dockerhub diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 18a167fc..d6c7ec00 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,7 +14,7 @@ repos: # Autoupdate: Python code - repo: https://github.com/asottile/pyupgrade - rev: v2.32.0 + rev: v2.32.1 hooks: - id: pyupgrade args: [--py39-plus] @@ -35,7 +35,7 @@ repos: # Check python code static typing - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.942 + rev: v0.950 hooks: - id: mypy args: [--config, ./mypy.ini] diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 41f55540..e7f70d84 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,3 @@ - - Thanks for contributing! Please see the **Contributor Guide** section in [the documentation](https://jupyter-docker-stacks.readthedocs.io/en/latest/) for information about how to contribute @@ -8,3 +6,5 @@ information about how to contribute [tests](https://jupyter-docker-stacks.readthedocs.io/en/latest/contributing/tests.html), [features](https://jupyter-docker-stacks.readthedocs.io/en/latest/contributing/features.html), [community-maintained stacks](https://jupyter-docker-stacks.readthedocs.io/en/latest/contributing/stacks.html). + + diff --git a/all-spark-notebook/Dockerfile b/all-spark-notebook/Dockerfile index 3f35e700..684c9ddb 100644 --- a/all-spark-notebook/Dockerfile +++ b/all-spark-notebook/Dockerfile @@ -27,7 +27,13 @@ RUN apt-get update --yes && \ USER ${NB_UID} # R packages including IRKernel which gets installed globally. -RUN mamba install --quiet --yes \ +RUN arch=$(uname -m) && \ + if [ "${arch}" == "aarch64" ]; then \ + # Prevent libmamba from sporadically hanging on arm64 under QEMU + # + export G_SLICE=always-malloc; \ + fi && \ + mamba install --quiet --yes \ 'r-base' \ 'r-ggplot2' \ 'r-irkernel' \ diff --git a/base-notebook/Dockerfile b/base-notebook/Dockerfile index 72075835..ff0d2ada 100644 --- a/base-notebook/Dockerfile +++ b/base-notebook/Dockerfile @@ -119,7 +119,8 @@ RUN set -x && \ if [ "${arch}" == "aarch64" ]; then \ # Prevent libmamba from sporadically hanging on arm64 under QEMU # - ./micromamba config set extract_threads 1; \ + # We don't use `micromamba config set` since it instead modifies ~/.condarc. + echo "extract_threads: 1" >> "${CONDA_DIR}/.condarc"; \ fi && \ # Install the packages ./micromamba install \ @@ -165,7 +166,8 @@ RUN sed -re "s/c.ServerApp/c.NotebookApp/g" \ # This healtcheck works well for `lab`, `notebook`, `nbclassic`, `server` and `retro` jupyter commands # https://github.com/jupyter/docker-stacks/issues/915#issuecomment-1068528799 HEALTHCHECK --interval=15s --timeout=3s --start-period=5s --retries=3 \ - CMD wget -O- --no-verbose --tries=1 http://localhost:8888${JUPYTERHUB_SERVICE_PREFIX:-/}api || exit 1 + CMD wget -O- --no-verbose --tries=1 --no-check-certificate \ + http${GEN_CERT:+s}://localhost:8888${JUPYTERHUB_SERVICE_PREFIX:-/}api || exit 1 # Switch back to jovyan to avoid accidental container runs as root USER ${NB_UID} diff --git a/datascience-notebook/Dockerfile b/datascience-notebook/Dockerfile index 9e3877d1..47a624fc 100644 --- a/datascience-notebook/Dockerfile +++ b/datascience-notebook/Dockerfile @@ -61,7 +61,13 @@ USER ${NB_UID} # R packages including IRKernel which gets installed globally. # r-e1071: dependency of the caret R package -RUN mamba install --quiet --yes \ +RUN arch=$(uname -m) && \ + if [ "${arch}" == "aarch64" ]; then \ + # Prevent libmamba from sporadically hanging on arm64 under QEMU + # + export G_SLICE=always-malloc; \ + fi && \ + mamba install --quiet --yes \ 'r-base' \ 'r-caret' \ 'r-crayon' \ @@ -75,23 +81,23 @@ RUN mamba install --quiet --yes \ 'r-nycflights13' \ 'r-randomforest' \ 'r-rcurl' \ + 'r-rmarkdown' \ 'r-rodbc' \ 'r-rsqlite' \ 'r-shiny' \ + 'r-tidyverse' \ 'rpy2' \ 'unixodbc' && \ mamba clean --all -f -y && \ fix-permissions "${CONDA_DIR}" && \ fix-permissions "/home/${NB_USER}" -# These packages are not easy to install under arm +# `r-tidymodels` is not easy to install under arm RUN set -x && \ arch=$(uname -m) && \ if [ "${arch}" == "x86_64" ]; then \ mamba install --quiet --yes \ - 'r-rmarkdown' \ - 'r-tidymodels' \ - 'r-tidyverse' && \ + 'r-tidymodels' && \ mamba clean --all -f -y && \ fix-permissions "${CONDA_DIR}" && \ fix-permissions "/home/${NB_USER}"; \ diff --git a/pyspark-notebook/Dockerfile b/pyspark-notebook/Dockerfile index 6be3c924..9a3f5417 100644 --- a/pyspark-notebook/Dockerfile +++ b/pyspark-notebook/Dockerfile @@ -61,7 +61,13 @@ RUN fix-permissions "/etc/ipython/" USER ${NB_UID} # Install pyarrow -RUN mamba install --quiet --yes \ +RUN arch=$(uname -m) && \ + if [ "${arch}" == "aarch64" ]; then \ + # Prevent libmamba from sporadically hanging on arm64 under QEMU + # + export G_SLICE=always-malloc; \ + fi && \ + mamba install --quiet --yes \ 'pyarrow' && \ mamba clean --all -f -y && \ fix-permissions "${CONDA_DIR}" && \ diff --git a/r-notebook/Dockerfile b/r-notebook/Dockerfile index 4adb90c8..dac8757c 100644 --- a/r-notebook/Dockerfile +++ b/r-notebook/Dockerfile @@ -27,7 +27,13 @@ USER ${NB_UID} # R packages including IRKernel which gets installed globally. # r-e1071: dependency of the caret R package -RUN mamba install --quiet --yes \ +RUN arch=$(uname -m) && \ + if [ "${arch}" == "aarch64" ]; then \ + # Prevent libmamba from sporadically hanging on arm64 under QEMU + # + export G_SLICE=always-malloc; \ + fi && \ + mamba install --quiet --yes \ 'r-base' \ 'r-caret' \ 'r-crayon' \ @@ -52,7 +58,6 @@ RUN mamba install --quiet --yes \ fix-permissions "/home/${NB_USER}" # `r-tidymodels` is not easy to install under arm -# hadolint ignore=SC2039 RUN set -x && \ arch=$(uname -m) && \ if [ "${arch}" == "x86_64" ]; then \ diff --git a/scipy-notebook/Dockerfile b/scipy-notebook/Dockerfile index 9385e7d7..7bd6caf8 100644 --- a/scipy-notebook/Dockerfile +++ b/scipy-notebook/Dockerfile @@ -26,7 +26,13 @@ RUN apt-get update --yes && \ USER ${NB_UID} # Install Python 3 packages -RUN mamba install --quiet --yes \ +RUN arch=$(uname -m) && \ + if [ "${arch}" == "aarch64" ]; then \ + # Prevent libmamba from sporadically hanging on arm64 under QEMU + # + export G_SLICE=always-malloc; \ + fi && \ + mamba install --quiet --yes \ 'altair' \ 'beautifulsoup4' \ 'bokeh' \ diff --git a/tensorflow-notebook/Dockerfile b/tensorflow-notebook/Dockerfile index 78a8af28..65bf7999 100644 --- a/tensorflow-notebook/Dockerfile +++ b/tensorflow-notebook/Dockerfile @@ -11,7 +11,13 @@ LABEL maintainer="Jupyter Project " SHELL ["/bin/bash", "-o", "pipefail", "-c"] # Install Tensorflow -RUN mamba install --quiet --yes \ +RUN arch=$(uname -m) && \ + if [ "${arch}" == "aarch64" ]; then \ + # Prevent libmamba from sporadically hanging on arm64 under QEMU + # + export G_SLICE=always-malloc; \ + fi && \ + mamba install --quiet --yes \ 'tensorflow' && \ mamba clean --all -f -y && \ fix-permissions "${CONDA_DIR}" && \ diff --git a/tests/datascience-notebook/test_julia.py b/tests/datascience-notebook/test_julia.py index d7526ea2..5ed9d1dc 100644 --- a/tests/datascience-notebook/test_julia.py +++ b/tests/datascience-notebook/test_julia.py @@ -10,12 +10,9 @@ LOGGER = logging.getLogger(__name__) def test_julia(container: TrackedContainer) -> None: """Basic julia test""" LOGGER.info("Test that julia is correctly installed ...") - running_container = container.run_detached( + logs = container.run_and_wait( + timeout=5, tty=True, - command=["start.sh", "bash", "-c", "sleep infinity"], + command=["start.sh", "bash", "-c", "julia --version"], ) - command = "julia --version" - cmd = running_container.exec_run(command) - output = cmd.output.decode("utf-8") - LOGGER.debug(output) - assert cmd.exit_code == 0, f"Command {command} failed {output}" + LOGGER.debug(logs)