updated sage build
Some checks failed
CI / Build Jupyter Sage docker images (push) Failing after 7s

This commit is contained in:
2025-12-24 03:22:40 +08:00
parent 6170b6a223
commit 434452e17e
4 changed files with 115 additions and 78 deletions

View File

@@ -1,36 +1,44 @@
FROM debian:latest
RUN apt-get update && apt-get upgrade
RUN apt-get install -y bc binutils bzip2 ca-certificates cliquer cmake curl \
ecl eclib-tools fflas-ffpack g++ gap gcc gengetopt gfan gfortran \
glpk-utils gmp-ecm lcalc libatomic-ops-dev libboost-dev \
libbraiding-dev libbrial-dev libbrial-groebner-dev libbz2-dev \
libcdd-dev libcdd-tools libcliquer-dev libcurl4-openssl-dev libec-dev \
libecm-dev libffi-dev libflint-dev libfplll-dev libfreetype-dev \
libgap-dev libgc-dev libgd-dev libgf2x-dev libgiac-dev libgivaro-dev \
libglpk-dev libgmp-dev libgsl-dev libhomfly-dev libiml-dev \
liblfunction-dev liblinbox-dev liblrcalc-dev liblzma-dev libm4ri-dev \
libm4rie-dev libmpc-dev libmpfi-dev libmpfr-dev libncurses5-dev \
libntl-dev libopenblas-dev libpari-dev libplanarity-dev libppl-dev \
libprimesieve-dev libpython3-dev libqhull-dev libreadline-dev \
librw-dev libsingular4-dev libsqlite3-dev libssl-dev \
libsuitesparse-dev libsymmetrica2-dev libz-dev libzmq3-dev m4 make \
maxima maxima-sage meson nauty ninja-build openssl palp pari-doc \
pari-elldata pari-galdata pari-galpol pari-gp2c pari-seadata patch \
patchelf perl pkg-config planarity ppl-dev python3 python3-setuptools \
python3-venv singular singular-doc sqlite3 sympow tachyon tar texinfo \
tox xcas xz-utils git
RUN apt-get install -y default-jdk dvipng ffmpeg fonts-freefont-otf \
imagemagick latexmk libavdevice-dev libjpeg-dev pandoc tex-gyre \
texlive-fonts-recommended texlive-lang-cyrillic texlive-lang-english \
texlive-lang-european texlive-lang-french texlive-lang-german \
texlive-lang-italian texlive-lang-japanese texlive-lang-polish \
texlive-lang-portuguese texlive-lang-spanish texlive-latex-extra \
texlive-luatex texlive-xetex xindy
RUN useradd jovyan -u 1000 -s /bin/bash -m -h /home/jovyan
FROM debian:stable AS build
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt update &&\
apt install -y python3 python3-dev pipx gcc g++ libffi-dev cargo cmake autoconf swig ninja-build patchelf meson python3-faiss adduser
RUN adduser -u 1000 --system --shell /bin/sh --home /home/jovyan jovyan
USER jovyan
WORKDIR /home/jovyan
COPY build.sh build.sh
RUN git clone -c core.symlinks=true --filter blob:none \
--origin upstream --branch master --tags \
https://github.com/sagemath/sage.git
RUN export srcdir=/home/jovyan/sage source build.sh && prepare && build
RUN python3 -m venv venv
RUN --mount=type=cache,target=/home/jovyan/.cache/pip,uid=1000,gid=1000 venv/bin/pip install sagemath
RUN --mount=type=cache,target=/home/jovyan/.cache/pip,uid=1000,gid=1000 venv/bin/pip install jupyter-core
RUN --mount=type=cache,target=/home/jovyan/.cache/pip,uid=1000,gid=1000 venv/bin/pip install jupyterhub
RUN --mount=type=cache,target=/home/jovyan/.cache/pip,uid=1000,gid=1000 venv/bin/pip install jupyterlab
RUN --mount=type=cache,target=/home/jovyan/.cache/pip,uid=1000,gid=1000 venv/bin/pip install notebook
RUN --mount=type=cache,target=/home/jovyan/.cache/pip,uid=1000,gid=1000 venv/bin/pip install ipywidgets
RUN --mount=type=cache,target=/home/jovyan/.cache/pip,uid=1000,gid=1000 venv/bin/pip install jupyterlab-lsp
RUN --mount=type=cache,target=/home/jovyan/.cache/pip,uid=1000,gid=1000 venv/bin/pip install python-lsp-server[yapf,rope,pyflakes]
RUN --mount=type=cache,target=/home/jovyan/.cache/pip,uid=1000,gid=1000 venv/bin/pip install jupyter-ai
RUN --mount=type=cache,target=/home/jovyan/.cache/pip,uid=1000,gid=1000 venv/bin/pip install langchain-openai langchain_ollama
ENV PATH="/home/jovyan/venv/bin/:$PATH"
FROM debian:stable
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt update &&\
apt install -y python3 adduser
RUN adduser -u 1000 --system --shell /bin/sh --home /home/jovyan jovyan
USER jovyan
COPY --from=build /home/jovyan /home/jovyan
COPY jupyter_server_config.py docker_healthcheck.py /etc/jupyter/
COPY start-notebook.py start-singleuser.py /usr/local/bin/
RUN mkdir /home/jovyan/work
WORKDIR /home/jovyan/work
ENV JUPYTER_PORT=8888
EXPOSE $JUPYTER_PORT
ENV PATH="/home/jovyan/venv/bin/:$PATH"
CMD ["start-notebook.py"]
# HEALTHCHECK documentation: https://docs.docker.com/engine/reference/builder/#healthcheck
# 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=3s --timeout=1s --start-period=3s --retries=3 \
CMD /etc/jupyter/docker_healthcheck.py || exit 1