switch to bookworm && remove mojo && repair sage

This commit is contained in:
ben0i0d 2024-05-11 16:40:27 +08:00
parent db6d9cc2be
commit 38ef043183
10 changed files with 54 additions and 30 deletions

View File

@ -27,7 +27,7 @@ Specify the image in the profile of the singleuser
### List of images that are currently being built
* Upstream: Mirror upstream, benchmarking against the jupyter official minimal-notebook image
* Description
1. Upstream has switched to `debian:trixie-slim`, and GPU upstream images are also built based on `debian:trixie`
1. Upstream has switched to `debian:bookworm-slim`, and GPU upstream images are also built based on `debian:bookworm`
2. By default, we add the domain certificate of eoelab.org, which does not pose any security issues
3. Sudo is added for passwordless use. In scenarios with high security requirements, do not allow privilege escalation
4. Provided packages: file compression/extraction (.zip), project management (git), Chinese fonts (fonts-wqy-zenhei)

View File

@ -35,7 +35,7 @@ plt.rcParams["font.family"] = zh_font.get_name()
### 当前构建镜像清单
* Upstream: 镜像上游对标jupyter官方的minimal-notebook镜像
* 说明
1. 上游已经切换到`debian:trixie`GPU上游镜像也基于`debian:trixie`二次构建了镜像
1. 上游已经切换到`debian:bookworm-slim`GPU上游镜像也基于`debian:bookworm`二次构建了镜像
2. 默认情况下我们添加了eoelab.org的域名证书这不会带来安全问题
3. 添加了sudo的无密码使用在安全要求较高的场景中不要允许特权提升
4. 提供软件包:文件压缩/解压(.zip),项目管理(git),中文字体fonts-wqy-zenhei

27
build.sh Normal file
View File

@ -0,0 +1,27 @@
# auto build image
remote="docker.io/ben0i0d/jupyter"
arch="amd64"
# Python
source=(python/cpu python/gpu scipy/cpu scipy/gpu scrpy pyflink pyspark pyai/cpu pyai/gpu)
target=(py-c py-g scipy-c scipy-g scrpy pyflink pyspark pyai-c pyai-g)
for arch in $arch; do
for i in {0..9}; do
podman build --arch=$arch -t $remote:${target[i]} ${source[i]}
done
done
# Other
source=(julia maple mathematica matlab/minimal matlab/mcm sagemath octave r sagemath scilab)
target=(julia maple mma matlab-minimal matlab-mcm sage octave r sage scilab)
for arch in $arch; do
for i in {0..9}; do
podman build --arch=$arch -t $remote:${target[i]} ${source[i]}
done
done

View File

@ -1,15 +0,0 @@
FROM ben0i0d/jupyter:py-c
USER root
ENV MODULAR_HOME="/opt/modular" \
PATH="$PATH:/opt/modular/pkg/packages.modular.com_mojo/bin"
RUN apt-get update && apt-get install --yes --no-install-recommends curl libedit2 && apt-get clean && rm -rf /var/lib/apt/lists/* && \
mkdir /opt/modular && \
curl https://get.modular.com | MODULAR_AUTH=mut_631a7d7cd03d4185b786385c42384278 sh - && \
modular auth mut_631a7d7cd03d4185b786385c42384278 && modular install mojo
USER ${NB_UID}
RUN python /opt/modular/pkg/packages.modular.com_mojo/jupyter/manage_kernel.py install

17
push.sh Normal file
View File

@ -0,0 +1,17 @@
# auto push image
remote="docker.io/ben0i0d/jupyter"
# Python
target=(py-c py-g scipy-c scipy-g scrpy pyflink pyspark pyai-c pyai-g)
for i in {0..9}; do
podman push $remote:${target[i]}
done
# Other
target=(julia maple mma matlab-minimal matlab-mcm sage octave r sage scilab)
for i in {0..9}; do
podman push $remote:${target[i]}
done

View File

@ -1,9 +1,7 @@
FROM debian:trixie-slim
FROM debian:bookworm-slim
EXPOSE 8888
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
USER root
# Configure environment

View File

@ -1,9 +1,7 @@
FROM ben0i0d/cuda:12.2.0-devel-debian13
FROM ben0i0d/cuda:12.2.0-devel-debian12
EXPOSE 8888
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
USER root
# Configure environment

View File

@ -1,13 +1,13 @@
FROM ben0i0d/jupyter:py-c
ENV BASE_DIR=/opt/base
USER root
# Sage pre-requisites and jq for manipulating json
# Sage install
RUN apt-get update && \
apt-get install -y --no-install-recommends sagemath sagemath-jupyter sagemath-doc && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}" && \
rm -rf /var/lib/apt/lists/*
apt-get install -y --no-install-recommends sagemath && apt-get clean && rm -rf /var/lib/apt/lists/* && \
sage -c 'from sage.repl.ipython_kernel.install import SageKernelSpec; SageKernelSpec.update(prefix=os.environ["BASE_DIR"])'
USER $NB_UID

View File

@ -5,7 +5,7 @@ RUN pip install \
# Data analysis and visualization
'pandas' 'matplotlib' \
# Machine learning and data mining
'scikit-learn' 'jax' \
'scikit-learn' \
# Scientific calculations and statistical analysis
'scipy' 'numpy' &&\
pip cache purge && \

View File

@ -8,6 +8,5 @@ RUN pip install \
'scikit-learn' \
# Scientific calculations and statistical analysis
'scipy' 'numpy' &&\
pip install --upgrade "jax[cuda12_pip]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html && \
pip cache purge && \
MPLBACKEND=Agg python -c "import matplotlib.pyplot"