Skip to content

Commit 3995050

Browse files
authored
Base OpenEuler 22.03.SP2 docker image for CI. (#24)
* Base OpenEuler 22.03.SP2 docker image for CI. This docker image is suitable for Ascend310 series npus. * Add libs for OpenEuler CI images These libs for image and video encodeing/decoding may used by testing dnn. Add them as other dockerfiles do. Add python module requests, which is need for downloading dnn models.
1 parent 6b48bcb commit 3995050

File tree

1 file changed

+71
-0
lines changed
  • openeuler-github-actions-ascend310--22.03.sp2

1 file changed

+71
-0
lines changed
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Version: 20231107
2+
# Image name: quay.io/opencv-ci/opencv-openeuler-22.03.sp2-ascend310
3+
4+
FROM openeuler/openeuler:22.03-lts-sp2
5+
6+
RUN yum install -y \
7+
git \
8+
wget \
9+
gcc \
10+
g++ \
11+
cmake \
12+
make \
13+
python-pip \
14+
python3-devel \
15+
xorg-x11-server-Xvfb \
16+
ninja-build \
17+
libjpeg-devel \
18+
libpng-devel \
19+
libtiff-devel \
20+
openjpeg2-devel \
21+
LibRaw-devel \
22+
gtk3-devel
23+
24+
# Install CANN
25+
RUN wget https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/CANN/CANN%207.0.RC1/Ascend-cann-toolkit_7.0.RC1_linux-"$(uname -i)".run && \
26+
chmod +x Ascend-cann-toolkit_7.0.RC1_linux-"$(uname -i)".run && \
27+
./Ascend-cann-toolkit_7.0.RC1_linux-"$(uname -i)".run --quiet --install && \
28+
rm -f ./Ascend-cann-toolkit_7.0.RC1_linux-"$(uname -i)".run
29+
30+
# Install kernels
31+
RUN wget https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/CANN/CANN%207.0.RC1/Ascend-cann-kernels-310p_7.0.RC1_linux.run && \
32+
chmod +x Ascend-cann-kernels-310p_7.0.RC1_linux.run && \
33+
./Ascend-cann-kernels-310p_7.0.RC1_linux.run --quiet --install && \
34+
rm -f ./Ascend-cann-kernels-310p_7.0.RC1_linux.run
35+
36+
# Self-hosted runner UID is 1001, matches user id on host.
37+
RUN groupadd -g 1000 HwHiAiUser && \
38+
useradd ci -m -s /bin/bash -G users --uid=1001 && \
39+
usermod -a -G HwHiAiUser ci
40+
41+
USER ci
42+
43+
ENV LD_LIBRARY_PATH=/usr/local/Ascend/driver/lib64:/usr/local/Ascend/driver/lib64/common:/usr/local/Ascend/driver/lib64/driver:$LD_LIBRARY_PATH:/usr/lib64
44+
ENV ASCEND_TOOLKIT_HOME=/usr/local/Ascend/ascend-toolkit/latest
45+
ENV LD_LIBRARY_PATH=${ASCEND_TOOLKIT_HOME}/lib64:${ASCEND_TOOLKIT_HOME}/lib64/plugin/opskernel:${ASCEND_TOOLKIT_HOME}/lib64/plugin/nnengine:${ASCEND_TOOLKIT_HOME}/opp/built-in/op_impl/ai_core/tbe/op_tiling:$LD_LIBRARY_PATH
46+
ENV PYTHONPATH=${ASCEND_TOOLKIT_HOME}/python/site-packages:${ASCEND_TOOLKIT_HOME}/opp/built-in/op_impl/ai_core/tbe:$PYTHONPATH
47+
ENV PATH=${ASCEND_TOOLKIT_HOME}/bin:${ASCEND_TOOLKIT_HOME}/compiler/ccec_compiler/bin:$PATH
48+
ENV ASCEND_AICPU_PATH=${ASCEND_TOOLKIT_HOME}
49+
ENV ASCEND_OPP_PATH=${ASCEND_TOOLKIT_HOME}/opp
50+
ENV TOOLCHAIN_HOME=${ASCEND_TOOLKIT_HOME}/toolkit
51+
ENV ASCEND_HOME_PATH=${ASCEND_TOOLKIT_HOME}
52+
53+
RUN pip install \
54+
numpy \
55+
sympy \
56+
decorator \
57+
scipy \
58+
attrs \
59+
psutil \
60+
requests
61+
62+
RUN mkdir $HOME/opencv $HOME/opencv_contrib $HOME/build && \
63+
git config --global --add safe.directory "*" && \
64+
git config --global user.email "opencv.ci" && \
65+
git config --global user.name "opencv.ci" && \
66+
git config --global pull.rebase false
67+
68+
# Run docker build from the root directory of the repository
69+
COPY scripts/warnings-handling.py /home/ci/scripts/warnings-handling.py
70+
71+
WORKDIR /home/ci

0 commit comments

Comments
 (0)