simplify python && repair cpp

This commit is contained in:
ben0i0d 2024-10-05 14:15:26 +08:00
parent 5fee4c5637
commit 23a52a4c59
9 changed files with 63 additions and 30 deletions

View File

@ -142,6 +142,24 @@ jobs:
steps:
- name: checkout code
uses: https://eoelab.org:1027/actions/checkout@v4
- name: cpp build
uses: https://eoelab.org:1027/actions/build-push-action@v6
with:
context: Program/cpp
tags: eoelab.org:1027/${{ gitea.repository }}:cpp
JAVA:
runs-on: runner
needs: Base
steps:
- name: checkout code
uses: https://eoelab.org:1027/actions/checkout@v4
- name: java build
uses: https://eoelab.org:1027/actions/build-push-action@v6
with:
context: Program/java
tags: eoelab.org:1027/${{ gitea.repository }}:java
JULIA:
runs-on: runner
@ -278,7 +296,7 @@ jobs:
Push:
runs-on: runner
needs: [CADABRA2] #MATLAB_MCM, MAPLE, MMA
needs: [JAVA] #MATLAB_MCM, MAPLE, MMA
steps:
- name: login gitea_registry
uses: https://eoelab.org:1027/actions/login-action@v3

7
Program/cpp/.condarc Normal file
View File

@ -0,0 +1,7 @@
channels:
- defaults
show_channel_urls: true
default_channels:
- https://mirrors.ustc.edu.cn/anaconda/pkgs/main
custom_channels:
conda-forge: https://mirrors.ustc.edu.cn/anaconda/cloud

View File

@ -1,13 +1,18 @@
FROM eoelab.org:1027/ben0i0d/jupyter:py-c
FROM eoelab.org:1027/ben0i0d/jupyter:py-c AS builder
USER root
RUN apt-get update --yes && \
apt-get install --yes g++ && \
apt-get clean && rm -rf /var/lib/apt/lists/*
COPY .condarc /root/.condarc
USER ${NB_UID}
RUN apt-get update --yes && apt-get install --yes wget && \
apt-get clean && rm -rf /var/lib/apt/lists/* && \
wget https://eoelab.org:1027/ben0i0d/sources/raw/commit/ebbcba790d7b1804efde0715592a0665f6b81fbd/micromamba && \
chmod +x micromamba && ./micromamba install --yes --root-prefix /opt/mamba xeus-cling -c conda-forge
# Install Cpp kernel
RUN mamba install --yes -c conda-forge xeus-cling && \
mamba clean --all -f -y
FROM eoelab.org:1027/ben0i0d/jupyter:py-c
COPY --chown="${NB_UID}:${NB_GID}" --from=builder /opt/mamba /opt/mamba
RUN jupyter kernelspec install /opt/mamba/share/jupyter/kernels/xcpp11 --sys-prefix && \
jupyter kernelspec install /opt/mamba/share/jupyter/kernels/xcpp11 --sys-prefix && \
jupyter kernelspec install /opt/mamba/share/jupyter/kernels/xcpp11 --sys-prefix

View File

@ -1,17 +1,23 @@
FROM eoelab.org:1027/ben0i0d/jupyter:py-c
FROM eoelab.org:1027/ben0i0d/jupyter:py-c AS builder
USER root
COPY ijava-1.3.0.zip ./ijava-kernel.zip
WORKDIR /opt
RUN apt-get update --yes && apt-get install --yes --no-install-recommends wget unzip && apt-get clean && rm -rf /var/lib/apt/lists/* && \
wget https://eoelab.org:1027/ben0i0d/sources/src/commit/e8631a5dce40bd0b134758f1aff4caca59c082fe/ijava-1.3.0.zip && \
unzip ijava-1.3.0.zip -d IJava && rm ijava-1.3.0.zip
FROM eoelab.org:1027/ben0i0d/jupyter:py-c
COPY --chown="${NB_UID}:${NB_GID}" --from=builder /opt/IJava/ /opt/IJava/
USER root
# Install dependencies
RUN apt update && apt install --yes --no-install-recommends openjdk-17-jdk && \
apt-get clean && rm -rf /var/lib/apt/lists/* && \
# Unpack and install the kernel
unzip ijava-kernel.zip -d ijava-kernel && \
cd ijava-kernel && \
python3 install.py --sys-prefix && \
rm ../ijava-kernel.zip
apt-get clean && rm -rf /var/lib/apt/lists/*
# Set user back to unpriviledged user.
USER $NB_USER
# install the kernel
USER $NB_USER
RUN cd /opt/IJava && python3 install.py --sys-prefix

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:484cc62579cb77510b0f0c78283f043794396d8ae9d76a8f2ab5d7368ec246b2
size 3366077

View File

@ -36,7 +36,7 @@ c.DockerSpawner.allowed_images = {
* Description
1. Upstream has switched to `debian:bookworm-slim`, and GPU upstream images are also built based on `debian:bookworm`
2. Sudo is added for passwordless use. In scenarios with high security requirements, do not allow privilege escalation
3. Provided packages: file compression/extraction (.zip), project management (git), Chinese fonts (fonts-wqy-zenhei)
3. Provided packages: .zip extraction
* Python: Supports Python , combining Python syntax with the ecosystem for production and research.
* Scipy: Provides a scientific computing environment for Python, offering rich numerical computation, optimization, signal processing, statistical analysis, etc., for scientific research and engineering applications.
* Scrpy: Provides a web scraping environment for Python, used for extracting data from the internet, automating information gathering and analysis tasks, suitable for data mining, web scraping, and business intelligence collection applications.

View File

@ -44,7 +44,7 @@ plt.rcParams["font.family"] = zh_font.get_name()
* 说明
1. 上游已经切换到`debian:bookworm-slim`GPU上游镜像也基于`debian:bookworm`二次构建了镜像
2. 添加了sudo的无密码使用在安全要求较高的场景中不要允许特权提升
3. 提供软件包:文件压缩/解压(.zip),项目管理(git),中文字体fonts-wqy-zenhei
3. 提供软件包:.zip文件解压(.zip)
* LlinuxWith Desktop-GUI在无特权的情况下学习Linux系统提供Xfce桌面支持
* Python支持Python通过将python语法与生态系统相结合进行生产与研究。
* Scipy提供Python的科学计算环境提供了丰富的数值计算、优化、信号处理、统计分析等功能用于科学研究和工程应用。

View File

@ -18,14 +18,14 @@ COPY start-sh/* /usr/local/bin/
COPY conf/jupyter_server_config.py /etc/jupyter/
RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list.d/debian.sources && \
apt-get update --yes && apt-get install --yes --no-install-recommends sudo tini git zip unzip fonts-wqy-zenhei python3-venv && \
apt-get update --yes && apt-get install --yes --no-install-recommends sudo tini unzip python3-venv && \
apt-get clean && rm -rf /var/lib/apt/lists/* && \
chmod a+rx /usr/local/bin/* && \
useradd -l -m -s /bin/bash -N -u "${NB_UID}" "${NB_USER}" && \
usermod -aG sudo "${NB_USER}" && echo "${NB_USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers && \
mkdir -p "/opt/base/" && python3 -m venv /opt/base && chown -hR "${NB_USER}:${NB_GID}" "/opt/base" && \
chmod g+w /etc/passwd && \
mkdir /usr/local/bin/start-notebook.d && mkdir /usr/local/bin/before-notebook.d && \
mkdir -p "/opt/base/" && python3 -m venv /opt/base && chown -hR "${NB_USER}:${NB_GID}" "/opt/base" && \
echo '[global]\nindex-url = https://mirrors.bfsu.edu.cn/pypi/web/simple' > /etc/pip.conf
USER ${NB_UID}

View File

@ -18,14 +18,14 @@ COPY start-sh/* /usr/local/bin/
COPY conf/jupyter_server_config.py /etc/jupyter/
RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list.d/debian.sources && \
apt-get update --yes && apt-get install --yes --no-install-recommends sudo tini git zip unzip fonts-wqy-zenhei python3-venv && \
apt-get update --yes && apt-get install --yes --no-install-recommends sudo tini unzip python3-venv && \
apt-get clean && rm -rf /var/lib/apt/lists/* && \
chmod a+rx /usr/local/bin/* && \
useradd -l -m -s /bin/bash -N -u "${NB_UID}" "${NB_USER}" && \
usermod -aG sudo "${NB_USER}" && echo "${NB_USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers && \
mkdir -p "/opt/base/" && python3 -m venv /opt/base && chown -hR "${NB_USER}:${NB_GID}" "/opt/base" && \
chmod g+w /etc/passwd && \
mkdir /usr/local/bin/start-notebook.d && mkdir /usr/local/bin/before-notebook.d && \
mkdir -p "/opt/base/" && python3 -m venv /opt/base && chown -hR "${NB_USER}:${NB_GID}" "/opt/base" && \
echo '[global]\nindex-url = https://mirrors.bfsu.edu.cn/pypi/web/simple' > /etc/pip.conf
USER ${NB_UID}