repair .so file be hided
This commit is contained in:
parent
faf8c2f67a
commit
6727f1e209
@ -148,6 +148,18 @@ jobs:
|
||||
context: Program/cpp
|
||||
tags: eoelab.org:1027/${{ gitea.repository }}:cpp
|
||||
|
||||
HASKELL:
|
||||
runs-on: runner
|
||||
needs: Base
|
||||
steps:
|
||||
- name: checkout code
|
||||
uses: https://eoelab.org:1027/actions/checkout@v4
|
||||
- name: haskell build
|
||||
uses: https://eoelab.org:1027/actions/build-push-action@v6
|
||||
with:
|
||||
context: Program/haskell
|
||||
tags: eoelab.org:1027/${{ gitea.repository }}:haskell
|
||||
|
||||
JAVA:
|
||||
runs-on: runner
|
||||
needs: Base
|
||||
@ -314,7 +326,7 @@ jobs:
|
||||
|
||||
Push:
|
||||
runs-on: runner
|
||||
needs: [MATLAB_MCM, MAPLE, MMA] #
|
||||
needs: [HASKELL] # MATLAB_MCM, MAPLE, MMA
|
||||
steps:
|
||||
- name: login gitea_registry
|
||||
uses: https://eoelab.org:1027/actions/login-action@v3
|
||||
|
@ -1,69 +1,19 @@
|
||||
FROM eoelab.org:1027/ben0i0d/jupyter:py-c
|
||||
|
||||
# Extra arguments to `stack build`. Used to build --fast, see Makefile.
|
||||
ARG STACK_ARGS=
|
||||
ARG STACK_BINDIST="stack-2.11.1-linux-x86_64"
|
||||
|
||||
|
||||
|
||||
USER root
|
||||
|
||||
ENV PATH="/opt/bin:/opt/ghc/bin:${PATH}" \
|
||||
STACK_ROOT=/opt/stack
|
||||
ENV STACK_ROOT=/opt/stack
|
||||
|
||||
# Stack global non-project-specific config stack.config.yaml
|
||||
# Stack global project stack.yaml
|
||||
# Stack switch to mirrored source
|
||||
COPY stack.config.yaml /etc/stack/config.yaml
|
||||
COPY global-hints.yaml /etc/stack/global-hints-cache.yaml
|
||||
COPY stack-2.11.1-linux-x86_64.tar.gz /tmp/stack-2.11.1-linux-x86_64.tar.gz
|
||||
COPY global-project.stack.yaml $STACK_ROOT/global-project/stack.yaml
|
||||
#COPY global-hints.yaml /etc/stack/global-hints-cache.yaml
|
||||
|
||||
|
||||
RUN fix-permissions $STACK_ROOT && fix-permissions /etc/stack/ && \
|
||||
# Install system dependencies
|
||||
apt-get update && apt-get install -yq --no-install-recommends python3-pip libtinfo-dev libzmq3-dev libcairo2-dev libpango1.0-dev \
|
||||
libmagic-dev libblas-dev liblapack-dev libffi-dev libgmp-dev gnupg netbase graphviz gnuplot-nox \
|
||||
g++ gcc libc6-dev libffi-dev libgmp-dev make xz-utils zlib1g-dev less && \
|
||||
RUN apt-get update && apt-get install --yes haskell-stack git g++ && \
|
||||
apt-get clean && rm -rf /var/lib/apt/lists/* && \
|
||||
# Stack Linux (generic) Manual download
|
||||
cd /tmp && tar zxf ${STACK_BINDIST}.tar.gz && cp ${STACK_BINDIST}/stack /usr/bin/stack && \
|
||||
rm -rf ${STACK_BINDIST}.tar.gz ${STACK_BINDIST} && \
|
||||
chown --recursive $NB_UID:users $STACK_ROOT/global-project && \
|
||||
fix-permissions $STACK_ROOT/global-project && \
|
||||
# Clone IHaskell and install ghc from the IHaskell resolver
|
||||
cd /opt && \
|
||||
curl -L "https://eoelab.org:1031/mirrored-sources/IHaskell/-/archive/master/IHaskell-master.tar.gz" | tar xzf - && mv *IHaskell* IHaskell && \
|
||||
curl -L "https://eoelab.org:1031/mirrored-sources/hvega/-/archive/main/hvega-main.tar.gz" | tar xzf - && mv *hvega* hvega && \
|
||||
fix-permissions /opt/IHaskell && \
|
||||
fix-permissions $STACK_ROOT && \
|
||||
fix-permissions /opt/hvega && \
|
||||
mkdir -p $HOME/.cabal && \
|
||||
echo "repository mirrors.ustc.edu.cn\n url: https://mirrors.ustc.edu.cn/hackage/\n secure: True" > $HOME/.cabal/config && \
|
||||
stack setup && \
|
||||
fix-permissions $STACK_ROOT && \
|
||||
rm /opt/stack/programs/x86_64-linux/ghc*.tar.xz && \
|
||||
mkdir -p /opt/stack && chown $NB_UID:$NB_GID /opt/stack
|
||||
# Build IHaskell
|
||||
# Note that we are NOT in the /opt/IHaskell directory here, we are installing ihaskell via the paths given in /opt/stack/global-project/stack.yaml
|
||||
stack build $STACK_ARGS ihaskell && \
|
||||
fix-permissions /opt/IHaskell && \
|
||||
fix-permissions $STACK_ROOT && \
|
||||
# Install IHaskell.Display libraries
|
||||
stack build $STACK_ARGS ihaskell-charts && \
|
||||
stack build $STACK_ARGS ihaskell-widgets && \
|
||||
stack build $STACK_ARGS hvega && \
|
||||
stack build $STACK_ARGS ihaskell-hvega && \
|
||||
fix-permissions $STACK_ROOT && \
|
||||
# Fix for https://github.com/IHaskell/ihaskell-notebook/issues/14#issuecomment-636334824
|
||||
fix-permissions /opt/IHaskell && \
|
||||
fix-permissions /opt/hvega && \
|
||||
# Install system-level ghc using the ghc which was installed by stack.using the IHaskell resolver.
|
||||
mkdir -p /opt/ghc && ln -s `stack path --compiler-bin` /opt/ghc/bin && \
|
||||
fix-permissions /opt/ghc && \
|
||||
fix-permissions "${CONDA_DIR}" && \
|
||||
fix-permissions "/home/${NB_USER}"
|
||||
|
||||
# Switch back to jovyan user
|
||||
USER $NB_UID
|
||||
RUN stack exec ihaskell -- install --stack --prefix=/opt/conda/
|
||||
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,49 +0,0 @@
|
||||
# Copyright (c) James Brock.
|
||||
# Distributed under the terms of the Modified MIT License.
|
||||
resolver: nightly-2023-05-17
|
||||
# GHC 9.4.5
|
||||
|
||||
# Stack global project /opt/stack/global-project/stack.yaml in the Docker image.
|
||||
# https://docs.haskellstack.org/en/stable/yaml_configuration/#yaml-configuration
|
||||
|
||||
# All the IHaskell packages are listed as extra-deps rather than packages,
|
||||
# because we never want to build anything automatically, we always want to
|
||||
# select exactly what we build for the IHaskell notebook environment.
|
||||
# For example, `stack ghci` tries to load every package listed in `packages`,
|
||||
# and we don't want that behavior. Several of these packages are unbuildable
|
||||
# at the time of this writing. See the Dockerfile for the list of packages
|
||||
# which are pre-built into the Docker image.
|
||||
#
|
||||
# To make an notebook project with custom `stack.yaml`, copy this `stack.yaml`
|
||||
# file into the project directory that has the `.ipynb` notebook file and
|
||||
# then make changes to the copied `stack.yaml`.
|
||||
|
||||
packages: []
|
||||
extra-deps:
|
||||
- /opt/IHaskell
|
||||
- /opt/IHaskell/ipython-kernel
|
||||
- /opt/IHaskell/ghc-parser
|
||||
- /opt/IHaskell/ihaskell-display/ihaskell-aeson
|
||||
- /opt/IHaskell/ihaskell-display/ihaskell-blaze
|
||||
- /opt/IHaskell/ihaskell-display/ihaskell-charts
|
||||
- /opt/IHaskell/ihaskell-display/ihaskell-diagrams
|
||||
- /opt/IHaskell/ihaskell-display/ihaskell-gnuplot
|
||||
- /opt/IHaskell/ihaskell-display/ihaskell-graphviz
|
||||
- /opt/IHaskell/ihaskell-display/ihaskell-hatex
|
||||
- /opt/IHaskell/ihaskell-display/ihaskell-juicypixels
|
||||
- /opt/IHaskell/ihaskell-display/ihaskell-magic
|
||||
- /opt/IHaskell/ihaskell-display/ihaskell-plot
|
||||
- /opt/IHaskell/ihaskell-display/ihaskell-rlangqq
|
||||
- /opt/IHaskell/ihaskell-display/ihaskell-static-canvas
|
||||
- /opt/IHaskell/ihaskell-display/ihaskell-widgets
|
||||
- /opt/hvega/hvega
|
||||
- /opt/hvega/ihaskell-hvega
|
||||
|
||||
- Chart-cairo-1.9.3
|
||||
- cairo-0.13.10.0
|
||||
- diagrams-cairo-1.4.2
|
||||
- pango-0.13.10.0
|
||||
- glib-0.13.10.0
|
||||
- gtk2hs-buildtools-0.13.10.0
|
||||
- plot-0.2.3.11
|
||||
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:408a120e824ed6e6b24c548a2ff6f210fcb0eed246f204a280ed4c75af0517e7
|
||||
size 15552491
|
@ -1,7 +1,5 @@
|
||||
# Haskell Stack non-project-specific config for IHaskell.
|
||||
# https://docs.haskellstack.org/en/stable/yaml_configuration/#non-project-specific-config
|
||||
setup-info-locations:
|
||||
- http://mirrors.ustc.edu.cn/stackage/stack-setup.yaml
|
||||
- http://mirrors.ustc.edu.cn/stackage/stack-setup.yaml
|
||||
urls:
|
||||
latest-snapshot: http://mirrors.ustc.edu.cn/stackage/snapshots.json
|
||||
snapshot-location-base: http://mirrors.ustc.edu.cn/stackage/stackage-snapshots/
|
||||
@ -10,28 +8,16 @@ package-index:
|
||||
download-prefix: https://mirrors.ustc.edu.cn/hackage/
|
||||
hackage-security:
|
||||
keyids:
|
||||
- 0a5c7ea47cd1b15f01f5f51a33adda7e655bc0f0b0615baa8e271f4c3351e21d
|
||||
- 1ea9ba32c526d1cc91ab5e5bd364ec5e9e8cb67179a471872f6e26f0ae773d42
|
||||
- 280b10153a522681163658cb49f632cde3f38d768b736ddbc901d99a1a772833
|
||||
- 2a96b1889dc221c17296fcc2bb34b908ca9734376f0f361660200935916ef201
|
||||
- 2c6c3627bd6c982990239487f1abd02e08a02e6cf16edb105a8012d444d870c3
|
||||
- 51f0161b906011b52c6613376b1ae937670da69322113a246a09f807c62f6921
|
||||
- 772e9f4c7db33d251d5c6e357199c819e569d130857dc225549b40845ff0890d
|
||||
- aa315286e6ad281ad61182235533c41e806e5a787e0b6d1e7eef3f09d137d2e9
|
||||
- fe331502606802feac15e514d9b9ea83fee8b6ffef71335479a2e68d84adc6b0
|
||||
- 0a5c7ea47cd1b15f01f5f51a33adda7e655bc0f0b0615baa8e271f4c3351e21d
|
||||
- 1ea9ba32c526d1cc91ab5e5bd364ec5e9e8cb67179a471872f6e26f0ae773d42
|
||||
- 280b10153a522681163658cb49f632cde3f38d768b736ddbc901d99a1a772833
|
||||
- 2a96b1889dc221c17296fcc2bb34b908ca9734376f0f361660200935916ef201
|
||||
- 2c6c3627bd6c982990239487f1abd02e08a02e6cf16edb105a8012d444d870c3
|
||||
- 51f0161b906011b52c6613376b1ae937670da69322113a246a09f807c62f6921
|
||||
- 772e9f4c7db33d251d5c6e357199c819e569d130857dc225549b40845ff0890d
|
||||
- aa315286e6ad281ad61182235533c41e806e5a787e0b6d1e7eef3f09d137d2e9
|
||||
- fe331502606802feac15e514d9b9ea83fee8b6ffef71335479a2e68d84adc6b0
|
||||
key-threshold: 3 # number of keys required
|
||||
|
||||
# ignore expiration date, see https://github.com/commercialhaskell/stack/pull/4614
|
||||
ignore-expiry: true
|
||||
|
||||
# So that all users, not just jovyan, can use the Stack default global project.
|
||||
allow-different-user: true
|
||||
|
||||
# stack install products will go here, not in /home/$USER/.local/bin
|
||||
local-bin-path: /opt/bin
|
||||
|
||||
# We're going to be loosey with version bounds.
|
||||
allow-newer: true
|
||||
|
||||
# Force color
|
||||
color: always
|
||||
ignore-expiry: true
|
@ -13,8 +13,10 @@ ENV DEBIAN_FRONTEND=noninteractive \
|
||||
PATH="/opt/base/bin:${PATH}" \
|
||||
HOME="/home/jovyan"
|
||||
|
||||
# Copy files
|
||||
# start script
|
||||
COPY start-sh/* /usr/local/bin/
|
||||
# jupyter config(to disable hide files)
|
||||
COPY 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 && \
|
||||
# install base packages
|
||||
|
61
python/cpu/jupyter_server_config.py
Normal file
61
python/cpu/jupyter_server_config.py
Normal file
@ -0,0 +1,61 @@
|
||||
# Copyright (c) Jupyter Development Team.
|
||||
# Distributed under the terms of the Modified BSD License.
|
||||
# mypy: ignore-errors
|
||||
import os
|
||||
import stat
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
from jupyter_core.paths import jupyter_data_dir
|
||||
|
||||
c = get_config() # noqa: F821
|
||||
c.ServerApp.ip = "0.0.0.0"
|
||||
c.ServerApp.open_browser = False
|
||||
|
||||
# to output both image/svg+xml and application/pdf plot formats in the notebook file
|
||||
c.InlineBackend.figure_formats = {"png", "jpeg", "svg", "pdf"}
|
||||
|
||||
# https://github.com/jupyter/notebook/issues/3130
|
||||
c.FileContentsManager.delete_to_trash = False
|
||||
|
||||
# https://github.com/jupyter/notebook/issues/7409
|
||||
c.ContentsManager.hide_globs = []
|
||||
|
||||
# Generate a self-signed certificate
|
||||
OPENSSL_CONFIG = """\
|
||||
[req]
|
||||
distinguished_name = req_distinguished_name
|
||||
[req_distinguished_name]
|
||||
"""
|
||||
if "GEN_CERT" in os.environ:
|
||||
dir_name = Path(jupyter_data_dir())
|
||||
dir_name.mkdir(parents=True, exist_ok=True)
|
||||
pem_file = dir_name / "notebook.pem"
|
||||
|
||||
# Generate an openssl.cnf file to set the distinguished name
|
||||
cnf_file = Path(os.getenv("CONDA_DIR", "/usr/lib")) / "ssl/openssl.cnf"
|
||||
if not cnf_file.exists():
|
||||
cnf_file.write_text(OPENSSL_CONFIG)
|
||||
|
||||
# Generate a certificate if one doesn't exist on a disk
|
||||
subprocess.check_call(
|
||||
[
|
||||
"openssl",
|
||||
"req",
|
||||
"-new",
|
||||
"-newkey=rsa:2048",
|
||||
"-days=365",
|
||||
"-nodes",
|
||||
"-x509",
|
||||
"-subj=/C=XX/ST=XX/L=XX/O=generated/CN=generated",
|
||||
f"-keyout={pem_file}",
|
||||
f"-out={pem_file}",
|
||||
]
|
||||
)
|
||||
# Restrict access to the file
|
||||
pem_file.chmod(stat.S_IRUSR | stat.S_IWUSR)
|
||||
c.ServerApp.certfile = str(pem_file)
|
||||
|
||||
# Change default umask for all subprocesses of the Server if set in the environment
|
||||
if "NB_UMASK" in os.environ:
|
||||
os.umask(int(os.environ["NB_UMASK"], 8))
|
@ -9,11 +9,14 @@ ENV DEBIAN_FRONTEND=noninteractive \
|
||||
NB_USER=jovyan \
|
||||
NB_UID=1000 \
|
||||
NB_GID=100 \
|
||||
SHELL=/bin/bash \
|
||||
PATH="/opt/base/bin:${PATH}" \
|
||||
HOME="/home/jovyan"
|
||||
|
||||
# Copy files
|
||||
# start script
|
||||
COPY start-sh/* /usr/local/bin/
|
||||
# jupyter config(to disable hide files)
|
||||
COPY 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 && \
|
||||
# install base packages
|
||||
|
61
python/gpu/jupyter_server_config.py
Normal file
61
python/gpu/jupyter_server_config.py
Normal file
@ -0,0 +1,61 @@
|
||||
# Copyright (c) Jupyter Development Team.
|
||||
# Distributed under the terms of the Modified BSD License.
|
||||
# mypy: ignore-errors
|
||||
import os
|
||||
import stat
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
from jupyter_core.paths import jupyter_data_dir
|
||||
|
||||
c = get_config() # noqa: F821
|
||||
c.ServerApp.ip = "0.0.0.0"
|
||||
c.ServerApp.open_browser = False
|
||||
|
||||
# to output both image/svg+xml and application/pdf plot formats in the notebook file
|
||||
c.InlineBackend.figure_formats = {"png", "jpeg", "svg", "pdf"}
|
||||
|
||||
# https://github.com/jupyter/notebook/issues/3130
|
||||
c.FileContentsManager.delete_to_trash = False
|
||||
|
||||
# https://github.com/jupyter/notebook/issues/7409
|
||||
c.ContentsManager.hide_globs = []
|
||||
|
||||
# Generate a self-signed certificate
|
||||
OPENSSL_CONFIG = """\
|
||||
[req]
|
||||
distinguished_name = req_distinguished_name
|
||||
[req_distinguished_name]
|
||||
"""
|
||||
if "GEN_CERT" in os.environ:
|
||||
dir_name = Path(jupyter_data_dir())
|
||||
dir_name.mkdir(parents=True, exist_ok=True)
|
||||
pem_file = dir_name / "notebook.pem"
|
||||
|
||||
# Generate an openssl.cnf file to set the distinguished name
|
||||
cnf_file = Path(os.getenv("CONDA_DIR", "/usr/lib")) / "ssl/openssl.cnf"
|
||||
if not cnf_file.exists():
|
||||
cnf_file.write_text(OPENSSL_CONFIG)
|
||||
|
||||
# Generate a certificate if one doesn't exist on a disk
|
||||
subprocess.check_call(
|
||||
[
|
||||
"openssl",
|
||||
"req",
|
||||
"-new",
|
||||
"-newkey=rsa:2048",
|
||||
"-days=365",
|
||||
"-nodes",
|
||||
"-x509",
|
||||
"-subj=/C=XX/ST=XX/L=XX/O=generated/CN=generated",
|
||||
f"-keyout={pem_file}",
|
||||
f"-out={pem_file}",
|
||||
]
|
||||
)
|
||||
# Restrict access to the file
|
||||
pem_file.chmod(stat.S_IRUSR | stat.S_IWUSR)
|
||||
c.ServerApp.certfile = str(pem_file)
|
||||
|
||||
# Change default umask for all subprocesses of the Server if set in the environment
|
||||
if "NB_UMASK" in os.environ:
|
||||
os.umask(int(os.environ["NB_UMASK"], 8))
|
Loading…
x
Reference in New Issue
Block a user