diff --git a/src/dockerfile/ci-yr-base-arm b/src/dockerfile/ci-yr-base-arm new file mode 100644 index 0000000000000000000000000000000000000000..5b658e5d1930f03d7b42148467f0abd9a658e587 --- /dev/null +++ b/src/dockerfile/ci-yr-base-arm @@ -0,0 +1,222 @@ +# replace VERSION before run +FROM swr.cn-north-4.myhuaweicloud.com/openeuler/openjdk/OPENJDK:TAG + +# During build, ensure the following files are included: +# - OpenJDK8U-jdk_x64_linux_hotspot_8u382b05.tar.gz +# - apache-maven-3.9.11-bin.tar.gz +# - bazel-6.5.0.zip +# - go1.21.4.src.tar.gz +# - Python-3.9.11.tgz +# - Python-3.10.2.tgz +# - Python-3.11.4.tgz +# - ninja-1.13.1.tar.gz + +RUN yum install -y gcc gcc-c++ git make libstdc++-devel curl libtool \ + binutils binutils-devel libcurl-devel zlib zlib-devel automake expat-devel \ + python3-pip python3-mock patch openssl openssl-devel libssh-devel libffi-devel \ + sqlite-devel bison gawk texinfo glibc glibc-devel wget bzip2-devel sudo \ + rsync nfs-utils xz libuuid unzip util-linux-devel cpio libcap-devel libatomic \ + chrpath numactl-devel openeuler-lsb libasan dos2unix net-tools pigz cmake protobuf protobuf-devel patchelf + +# Create build tools directory +RUN mkdir -p /opt/buildtools/ + +ENV LANG=C.UTF-8 + +# ============================================================================== +# Download and install JDK 8 +# ============================================================================== +RUN cd /tmp \ + && wget https://mirrors.huaweicloud.com/eclipse/temurin-compliance/temurin/8/jdk8u382-b05/OpenJDK8U-jdk_aarch64_linux_hotspot_8u382b05.tar.gz \ + && tar xf OpenJDK8U-jdk_aarch64_linux_hotspot_8u382b05.tar.gz -C /opt/buildtools/ + +# ============================================================================== +# Install Apache Maven +# ============================================================================== +RUN cd /tmp && \ + wget https://mirrors.huaweicloud.com/apache/maven/maven-3/3.9.11/binaries/apache-maven-3.9.11-bin.tar.gz && \ + tar xf apache-maven-3.9.11-bin.tar.gz -C /opt/buildtools/ + +# Write environment variables to /etc/profile and set ENV +RUN echo '' >> /etc/profile && \ + echo '# MAVEN_HOME' >> /etc/profile && \ + echo 'export MAVEN_HOME=/opt/buildtools/apache-maven-3.9.11' >> /etc/profile && \ + echo 'export PATH=$MAVEN_HOME/bin:$PATH' >> /etc/profile + +ENV MAVEN_HOME=/opt/buildtools/apache-maven-3.9.11 +ENV PATH=$MAVEN_HOME/bin:$PATH + +# ============================================================================== +# Install Go 1.21.4 +# ============================================================================== +RUN cd /tmp && \ + git clone https://gitee.com/src-openeuler/golang.git -b openEuler-24.03-LTS && \ + cp /tmp/golang/go1.21.4.src.tar.gz /tmp && \ + mkdir -p /opt/buildtools/golang_go-1.21.4 && \ + tar -xvf go1.21.4.src.tar.gz && \ + cd /tmp/go/src && \ + bash make.bash && \ + mv /tmp/go /opt/buildtools/golang_go-1.21.4 && \ + yum remove -y golang + +RUN mkdir -p /opt/buildtools/go_workspace && \ + chmod 755 -R /opt/buildtools/golang_go-1.21.4 && \ + chmod 777 -R /opt/buildtools/go_workspace + +ENV GOROOT=/opt/buildtools/golang_go-1.21.4 +ENV GOPATH=/opt/buildtools/go_workspace +ENV PATH=$GOROOT/bin:$GOPATH/bin:$PATH +ENV GO111MODULE=on +ENV GONOSUMDB=* + +# ============================================================================== +# Install Python 3.9.11 +# ============================================================================== +RUN cd /tmp && \ + wget https://mirrors.huaweicloud.com/python/3.9.11/Python-3.9.11.tgz && \ + tar -xzf Python-3.9.11.tgz && \ + cd Python-3.9.11 && \ + ./configure --prefix=/opt/buildtools/python3.9 \ + --with-openssl=/usr \ + --enable-loadable-sqlite-extensions \ + --enable-shared && \ + make -j $(nproc) && \ + make install && \ + chmod -R 755 /opt/buildtools/python3.9 + +# ============================================================================== +# Install Python 3.10.2 +# ============================================================================== +RUN cd /tmp && \ + wget https://mirrors.huaweicloud.com/python/3.10.2/Python-3.10.2.tgz && \ + tar -xzf Python-3.10.2.tgz && \ + cd Python-3.10.2/ && \ + ./configure --prefix=/opt/buildtools/python3.10 \ + --with-openssl=/usr \ + --enable-loadable-sqlite-extensions \ + --enable-shared && \ + make -j $(nproc) && \ + make install && \ + chmod -R 755 /opt/buildtools/python3.10 + +# ============================================================================== +# Install Python 3.11.4 +# ============================================================================== +RUN cd /tmp && \ + wget https://mirrors.huaweicloud.com/python/3.11.4/Python-3.11.4.tgz && \ + tar -xzf Python-3.11.4.tgz && \ + cd Python-3.11.4 && \ + ./configure --prefix=/opt/buildtools/python3.11 \ + --with-openssl=/usr \ + --enable-loadable-sqlite-extensions \ + --enable-shared && \ + make -j $(nproc) && \ + make install && \ + chmod -R 755 /opt/buildtools/python3.11 + +# Create symbolic links for Python and pip versions +RUN ln -sf /opt/buildtools/python3.9/bin/python3.9 /usr/local/bin/python3.9 && \ + ln -sf /opt/buildtools/python3.9/bin/pip3.9 /usr/local/bin/pip3.9 +RUN ln -sf /opt/buildtools/python3.10/bin/python3.10 /usr/local/bin/python3.10 && \ + ln -sf /opt/buildtools/python3.10/bin/pip3.10 /usr/local/bin/pip3.10 +RUN ln -sf /opt/buildtools/python3.11/bin/python3.11 /usr/local/bin/python3.11 && \ + ln -sf /opt/buildtools/python3.11/bin/pip3.11 /usr/local/bin/pip3.11 + +# Set default python to python3.9 +RUN ln -sf /usr/local/bin/python3.9 /usr/bin/python3 && \ + ln -sf /usr/bin/python3 /usr/bin/python + +# Environment variables for Python installations +ENV PYTHON_PATH_3911=/opt/buildtools/python3.9 +ENV PYTHON_PATH_3102=/opt/buildtools/python3.10 +ENV PYTHON_PATH_3114=/opt/buildtools/python3.11 + +# Update library path to include Python shared libraries +ENV LD_LIBRARY_PATH="/usr/local/lib:/usr/lib" +ENV LD_LIBRARY_PATH=$PYTHON_PATH_3911/lib:$PYTHON_PATH_3102/lib:$PYTHON_PATH_3114/lib:$LD_LIBRARY_PATH + +# Add Python binaries to PATH +ENV PATH=$PYTHON_PATH_3911/bin:$PYTHON_PATH_3102/bin:$PYTHON_PATH_3114/bin:$PATH + +# Upgrade pip and install required packages for each Python version +RUN pip3.9 config --user set global.index https://mirrors.huaweicloud.com/repository/pypi && \ + pip3.9 config --user set global.index-url https://mirrors.huaweicloud.com/repository/pypi/simple && \ + pip3.9 config --user set global.trusted-host mirrors.huaweicloud.com && \ + pip3.9 install wheel==0.36.2 six==1.10.0 + +RUN pip3.10 config --user set global.index https://mirrors.huaweicloud.com/repository/pypi && \ + pip3.10 config --user set global.index-url https://mirrors.huaweicloud.com/repository/pypi/simple && \ + pip3.10 config --user set global.trusted-host mirrors.huaweicloud.com && \ + pip3.10 install wheel==0.36.2 + +RUN pip3.11 config --user set global.index https://mirrors.huaweicloud.com/repository/pypi && \ + pip3.11 config --user set global.index-url https://mirrors.huaweicloud.com/repository/pypi/simple && \ + pip3.11 config --user set global.trusted-host mirrors.huaweicloud.com && \ + pip3.11 install wheel==0.36.2 + +# ============================================================================== +# Install Ninja 1.13.1 +# ============================================================================== +RUN cd /tmp && \ + git clone https://gitee.com/src-openeuler/ninja-build.git -b openEuler-25.09 && \ + cp /tmp/ninja-build/ninja-1.13.1.tar.gz /tmp && \ + tar -xvf ninja-1.13.1.tar.gz && \ + cd ninja-1.13.1 && \ + ./configure.py --bootstrap && \ + mkdir -p /opt/buildtools/ninja-1.13.1 && \ + mv ninja /opt/buildtools/ninja-1.13.1 && \ + ln -sf /opt/buildtools/ninja-1.13.1/ninja /usr/local/bin/ninja + +# ============================================================================== +# Install Bazel 6.5.0 +# ============================================================================== +RUN cd /tmp && \ + wget -O bazel https://mirrors.huaweicloud.com/bazel/6.5.0/bazel-6.5.0-linux-arm64 && \ + chmod +x bazel && \ + mv bazel /usr/local/bin/bazel + +# ============================================================================== +# Clean up temporary files (optional, to reduce image size) +# ============================================================================== +RUN sed -i "s/TMOUT=300/TMOUT=0/g" /etc/profile +ENV TMOUT=0 + +RUN rm -rf /tmp/* + +# ============================================================================== +# Jenkins environment configuration +# ============================================================================== +ARG VERSION=3107.v665000b_51092 +ARG user=jenkins +ARG group=jenkins +ARG uid=1000 +ARG gid=1000 +ARG AGENT_WORKDIR=/home/${user}/agent + +RUN curl --create-dirs -fsSLo /usr/share/jenkins/agent.jar https://repo.jenkins-ci.org/artifactory/public/org/jenkins-ci/main/remoting/${VERSION}/remoting-${VERSION}.jar \ + && chmod 755 /usr/share/jenkins \ + && chmod 644 /usr/share/jenkins/agent.jar \ + && ln -sf /usr/share/jenkins/agent.jar /usr/share/jenkins/slave.jar + +RUN curl --create-dirs -fsSLo /usr/local/bin/jenkins-agent http://121.36.53.23/AdoptOpenJDK/jenkins-agent +#COPY jenkins-agent /usr/local/bin/jenkins-agent + +RUN chmod a+rx /usr/local/openjdk-17 \ + && chmod a+rx /usr/local/bin/jenkins-agent \ + && ln -s /usr/local/bin/jenkins-agent /usr/local/bin/jenkins-slave + +RUN groupadd -g ${gid} ${group} +RUN useradd -c "Jenkins user" -d /home/${user} -u ${uid} -g ${gid} -m ${user} +RUN echo "${user} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers + + +USER ${user} +ENV AGENT_WORKDIR=${AGENT_WORKDIR} +RUN mkdir /home/${user}/.jenkins && mkdir -p ${AGENT_WORKDIR} + +VOLUME /home/${user}/.jenkins +VOLUME ${AGENT_WORKDIR} +WORKDIR ${AGENT_WORKDIR} + + +ENTRYPOINT ["jenkins-agent"] \ No newline at end of file diff --git a/src/dockerfile/ci-yr-base-x86 b/src/dockerfile/ci-yr-base-x86 new file mode 100644 index 0000000000000000000000000000000000000000..fc73fad0948bee61c774ebc1ba36a5a516dcf5b2 --- /dev/null +++ b/src/dockerfile/ci-yr-base-x86 @@ -0,0 +1,213 @@ +# replace VERSION before run +FROM swr.cn-north-4.myhuaweicloud.com/openeuler/openjdk/OPENJDK:TAG + +# Assume all dependency packages have been copied into /tmp +# During build, ensure the following files are included: +# - OpenJDK8U-jdk_x64_linux_hotspot_8u382b05.tar.gz +# - apache-maven-3.9.11-bin.tar.gz +# - bazel-6.5.0.zip +# - go1.21.4.src.tar.gz +# - Python-3.9.11.tgz +# - Python-3.10.2.tgz +# - Python-3.11.4.tgz +# - ninja-1.13.1.tar.gz + +RUN yum install -y gcc gcc-c++ git make libstdc++-devel curl libtool \ + binutils binutils-devel libcurl-devel zlib zlib-devel automake expat-devel \ + python3-pip python3-mock patch openssl openssl-devel libssh-devel libffi-devel \ + sqlite-devel bison gawk texinfo glibc glibc-devel wget bzip2-devel sudo \ + rsync nfs-utils xz libuuid unzip util-linux-devel cpio libcap-devel libatomic \ + chrpath numactl-devel openeuler-lsb libasan dos2unix net-tools pigz cmake \ + protobuf protobuf-devel patchelf golang + +# Create build tools directory +RUN mkdir -p /opt/buildtools/ + +ENV LANG=C.UTF-8 + +# ============================================================================== +# Install JDK 8 +# ============================================================================== +RUN cd /tmp \ + && wget https://mirrors.huaweicloud.com/eclipse/temurin-compliance/temurin/8/jdk8u382-b05/OpenJDK8U-jdk_x64_linux_hotspot_8u382b05.tar.gz \ + && tar xf OpenJDK8U-jdk_x64_linux_hotspot_8u382b05.tar.gz -C /opt/buildtools/ + +# ============================================================================== +# Install Apache Maven +# ============================================================================== +RUN cd /tmp && \ + wget https://mirrors.huaweicloud.com/apache/maven/maven-3/3.9.11/binaries/apache-maven-3.9.11-bin.tar.gz && \ + tar xf apache-maven-3.9.11-bin.tar.gz -C /opt/buildtools/ + +# Write environment variables to /etc/profile and set ENV +RUN echo '' >> /etc/profile && \ + echo '#MAVEN_HOME' >> /etc/profile && \ + echo 'export MAVEN_HOME=/opt/buildtools/apache-maven-3.9.11' >> /etc/profile && \ + echo 'export PATH=$MAVEN_HOME/bin:$PATH' >> /etc/profile + +ENV MAVEN_HOME=/opt/buildtools/apache-maven-3.9.11 +ENV PATH=$MAVEN_HOME/bin:$PATH + +# ============================================================================== +# Install Go 1.21.4 +# ============================================================================== +RUN cd /tmp && \ + git clone https://gitee.com/src-openeuler/golang.git -b openEuler-24.03-LTS && \ + cp /tmp/golang/go1.21.4.src.tar.gz /tmp && \ + mkdir -p /opt/buildtools/golang_go-1.21.4 && \ + tar -xvf go1.21.4.src.tar.gz && \ + cd /tmp/go/src && \ + bash make.bash && \ + mv /tmp/go /opt/buildtools/golang_go-1.21.4 && \ + yum remove -y golang + +RUN mkdir -p /opt/buildtools/go_workspace && \ + chmod 755 -R /opt/buildtools/golang_go-1.21.4 && \ + chmod 777 -R /opt/buildtools/go_workspace + +ENV GOROOT=/opt/buildtools/golang_go-1.21.4 +ENV GOPATH=/opt/buildtools/go_workspace +ENV PATH=$GOROOT/bin:$GOPATH/bin:$PATH +ENV GO111MODULE=on +ENV GONOSUMDB=* + +# ============================================================================== +# Install Python 3.9.11 +# ============================================================================== +RUN cd /tmp && \ + wget https://mirrors.huaweicloud.com/python/3.9.11/Python-3.9.11.tgz && \ + tar -xzf Python-3.9.11.tgz && \ + cd Python-3.9.11 && \ + ./configure --prefix=/opt/buildtools/python3.9 \ + --with-openssl=/usr \ + --enable-loadable-sqlite-extensions \ + --enable-shared && \ + make -j $(nproc) && \ + make install && \ + chmod -R 755 /opt/buildtools/python3.9 + +# ============================================================================== +# Install Python 3.10.2 +# ============================================================================== +RUN cd /tmp && \ + wget https://mirrors.huaweicloud.com/python/3.10.2/Python-3.10.2.tgz && \ + tar -xzf Python-3.10.2.tgz && \ + cd Python-3.10.2/ && \ + ./configure --prefix=/opt/buildtools/python3.10 \ + --with-openssl=/usr \ + --enable-loadable-sqlite-extensions \ + --enable-shared && \ + make -j $(nproc) && \ + make install && \ + chmod -R 755 /opt/buildtools/python3.10 + +# ============================================================================== +# Install Python 3.11.4 +# ============================================================================== +RUN cd /tmp && \ + wget https://mirrors.huaweicloud.com/python/3.11.4/Python-3.11.4.tgz && \ + tar -xzf Python-3.11.4.tgz && \ + cd Python-3.11.4 && \ + ./configure --prefix=/opt/buildtools/python3.11 \ + --with-openssl=/usr \ + --enable-loadable-sqlite-extensions \ + --enable-shared && \ + make -j $(nproc) && \ + make install && \ + chmod -R 755 /opt/buildtools/python3.11 + +# ============================================================================== +# Python environment configuration +# ============================================================================== +RUN ln -sf /opt/buildtools/python3.9/bin/python3.9 /usr/local/bin/python3.9 && ln -sf /opt/buildtools/python3.9/bin/pip3.9 /usr/local/bin/pip3.9 +RUN ln -sf /opt/buildtools/python3.10/bin/python3.10 /usr/local/bin/python3.10 && ln -sf /opt/buildtools/python3.10/bin/pip3.10 /usr/local/bin/pip3.10 +RUN ln -sf /opt/buildtools/python3.11/bin/python3.11 /usr/local/bin/python3.11 && ln -sf /opt/buildtools/python3.11/bin/pip3.11 /usr/local/bin/pip3.11 +RUN ln -sf /usr/local/bin/python3.9 /usr/bin/python3 && ln -sf /usr/bin/python3 /usr/bin/python + +ENV PYTHON_PATH_3911=/opt/buildtools/python3.9 +ENV PYTHON_PATH_3102=/opt/buildtools/python3.10 +ENV PYTHON_PATH_3114=/opt/buildtools/python3.11 +ENV LD_LIBRARY_PATH=$PYTHON_PATH_3911/lib:$PYTHON_PATH_3102/lib:$PYTHON_PATH_3114/lib:/usr/lib:/usr/lib64 +ENV PATH=$PYTHON_PATH_3911/bin:$PYTHON_PATH_3102/bin:$PYTHON_PATH_3114/bin:$PATH + +RUN pip3.9 config --user set global.index https://mirrors.huaweicloud.com/repository/pypi && \ + pip3.9 config --user set global.index-url https://mirrors.huaweicloud.com/repository/pypi/simple && \ + pip3.9 config --user set global.trusted-host mirrors.huaweicloud.com && \ + pip3.9 install wheel==0.36.2 six==1.10.0 + +RUN pip3.10 config --user set global.index https://mirrors.huaweicloud.com/repository/pypi && \ + pip3.10 config --user set global.index-url https://mirrors.huaweicloud.com/repository/pypi/simple && \ + pip3.10 config --user set global.trusted-host mirrors.huaweicloud.com && \ + pip3.10 install wheel==0.36.2 + +RUN pip3.11 config --user set global.index https://mirrors.huaweicloud.com/repository/pypi && \ + pip3.11 config --user set global.index-url https://mirrors.huaweicloud.com/repository/pypi/simple && \ + pip3.11 config --user set global.trusted-host mirrors.huaweicloud.com && \ + pip3.11 install wheel==0.36.2 + +# ============================================================================== +# Install Ninja 1.13.1 +# ============================================================================== +RUN cd /tmp && \ + git clone https://gitee.com/src-openeuler/ninja-build.git -b openEuler-25.09 && \ + cp /tmp/ninja-build/ninja-1.13.1.tar.gz /tmp && \ + tar -xvf ninja-1.13.1.tar.gz && \ + cd ninja-1.13.1 && \ + ./configure.py --bootstrap && \ + mkdir -p /opt/buildtools/ninja-1.13.1 && \ + mv ninja /opt/buildtools/ninja-1.13.1 && \ + ln -sf /opt/buildtools/ninja-1.13.1/ninja /usr/local/bin/ninja + +# ============================================================================== +# Install Bazel 6.5.0 +# ============================================================================== +RUN cd /tmp && \ + wget -O bazel https://mirrors.huaweicloud.com/bazel/6.5.0/bazel-6.5.0-linux-x86_64 && \ + chmod +x bazel && \ + mv bazel /usr/local/bin/bazel + +# ============================================================================== +# Clean up temporary files +# ============================================================================== +RUN sed -i "s/TMOUT=300/TMOUT=0/g" /etc/profile +ENV TMOUT=0 + +RUN rm -rf /tmp/* + +# ============================================================================== +# Jenkins environment configuration +# ============================================================================== +ARG VERSION=3107.v665000b_51092 +ARG user=jenkins +ARG group=jenkins +ARG uid=1000 +ARG gid=1000 +ARG AGENT_WORKDIR=/home/${user}/agent + +RUN curl --create-dirs -fsSLo /usr/share/jenkins/agent.jar https://repo.jenkins-ci.org/artifactory/public/org/jenkins-ci/main/remoting/${VERSION}/remoting-${VERSION}.jar \ + && chmod 755 /usr/share/jenkins \ + && chmod 644 /usr/share/jenkins/agent.jar \ + && ln -sf /usr/share/jenkins/agent.jar /usr/share/jenkins/slave.jar + +RUN curl --create-dirs -fsSLo /usr/local/bin/jenkins-agent http://121.36.53.23/AdoptOpenJDK/jenkins-agent +#COPY jenkins-agent /usr/local/bin/jenkins-agent + +RUN chmod a+rx /usr/local/openjdk-17 \ + && chmod a+rx /usr/local/bin/jenkins-agent \ + && ln -s /usr/local/bin/jenkins-agent /usr/local/bin/jenkins-slave + +RUN groupadd -g ${gid} ${group} +RUN useradd -c "Jenkins user" -d /home/${user} -u ${uid} -g ${gid} -m ${user} +RUN echo "${user} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers + + +USER ${user} +ENV AGENT_WORKDIR=${AGENT_WORKDIR} +RUN mkdir /home/${user}/.jenkins && mkdir -p ${AGENT_WORKDIR} + +VOLUME /home/${user}/.jenkins +VOLUME ${AGENT_WORKDIR} +WORKDIR ${AGENT_WORKDIR} + + +ENTRYPOINT ["jenkins-agent"] \ No newline at end of file