From 0824e8aa417375747a1eb677eb31cbf127661898 Mon Sep 17 00:00:00 2001 From: Ye Cao Date: Thu, 8 Aug 2024 10:28:06 +0800 Subject: [PATCH] Refactor Dockerfile: update the mirror to Aliyun and fix RDMA configurations. Signed-off-by: Ye Cao --- CMakeLists.txt | 1 + docker/Dockerfile.vineyard-python-dev | 9 ++++-- docker/Dockerfile.vineyardd | 6 +++- docker/Makefile | 8 +++-- docker/pypa/Dockerfile.manylinux1 | 11 ++++++- docker/vineyardd/Dockerfile.alpine-builder | 34 ++++++++++++++-------- 6 files changed, 49 insertions(+), 20 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 83609022..d73bcd8f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1011,6 +1011,7 @@ if(BUILD_VINEYARD_PYTHON_BINDINGS) DEPENDS _C vineyard_internal_registry COMMENT "Copying python extensions." VERBATIM) + set_target_properties(_C PROPERTIES LINK_FLAGS "-Wl,--version-script=${LIBFABRIC_VERSION_SCRIPT}") endif() if(BUILD_VINEYARD_PYTHON_BINDINGS AND BUILD_VINEYARD_LLM_CACHE) diff --git a/docker/Dockerfile.vineyard-python-dev b/docker/Dockerfile.vineyard-python-dev index d1203959..1b8e99c5 100644 --- a/docker/Dockerfile.vineyard-python-dev +++ b/docker/Dockerfile.vineyard-python-dev @@ -13,7 +13,7 @@ # limitations under the License. # build vineyard-python-dev -FROM ghcr.io/v6d-io/v6d/vineyard-manylinux2014:20240329 as wheel +FROM ghcr.io/v6d-io/v6d/vineyard-manylinux2014:20240803 as wheel ENV python=cp310-cp310 @@ -47,8 +47,11 @@ COPY python/vineyard.cc /work/v6d/python/vineyard.cc COPY python/vineyard/llm /work/v6d/python/vineyard/llm RUN cd /work/v6d && \ - mkdir build && \ - cd build && \ + rm -rf /work/v6d/build && \ + cd /work/v6d/thirdparty/libfabric && \ + rm -f /work/v6d/thirdparty/libfabric/Makefile && \ + mkdir -p /work/v6d/build && \ + cd /work/v6d/build && \ export PATH=$PATH:/opt/python/$python/bin && \ pip3 install -U pip setuptools wheel && \ cmake .. -DBUILD_SHARED_LIBS=OFF \ diff --git a/docker/Dockerfile.vineyardd b/docker/Dockerfile.vineyardd index ce052128..ee584c00 100644 --- a/docker/Dockerfile.vineyardd +++ b/docker/Dockerfile.vineyardd @@ -53,7 +53,11 @@ RUN cd /tmp && \ cd /tmp && \ rm -rf libunwind-1.7.2.tar.gz libunwind-1.7.2/ -RUN cd /work/v6d && \ +RUN export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64:$LD_LIBRARY_PATH && \ + cd /work/v6d && \ + rm -rf /work/v6d/build && \ + cd /work/v6d/thirdparty/libfabric && \ + rm -f /work/v6d/thirdparty/libfabric/Makefile && \ mkdir -p /work/v6d/build && \ cd /work/v6d/build && \ cmake .. -DCMAKE_BUILD_TYPE=Release \ diff --git a/docker/Makefile b/docker/Makefile index fad4d8ba..b8249a16 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -18,7 +18,7 @@ ALPINE_TAG := $(ALPINE_MANIFEST_TAG)_$(PLATFORM) WHEEL_BUILDER_REGISTRY := $(REGISTRY) WHEEL_BUILDER_IMAGE := vineyard-manylinux2014 -WHEEL_BUILDER_MANIFEST_TAG := 20240329 +WHEEL_BUILDER_MANIFEST_TAG := 20240803 WHEEL_BUILDER_TAG := $(WHEEL_BUILDER_MANIFEST_TAG)_$(PLATFORM) WHEEL_PYTHON := cp311-cp311 @@ -116,10 +116,12 @@ build-dev: # build python-dev image build-python-dev: - docker build ../ \ + docker buildx build ../ \ --progress=$(BUILD_PROGRESS) \ -f ./Dockerfile.vineyard-python-dev \ - -t $(PYTHON_DEV_REGISTRY)/$(PYTHON_DEV_IMAGE):$(PYTHON_DEV_TAG) + -t $(PYTHON_DEV_REGISTRY)/$(PYTHON_DEV_IMAGE):$(PYTHON_DEV_TAG) \ + --load \ + --platform linux/$(ARCH) .PHONY: build-python-dev # build vineyard-fluid-fuse image diff --git a/docker/pypa/Dockerfile.manylinux1 b/docker/pypa/Dockerfile.manylinux1 index b0cbc359..dd393a02 100644 --- a/docker/pypa/Dockerfile.manylinux1 +++ b/docker/pypa/Dockerfile.manylinux1 @@ -13,12 +13,21 @@ # limitations under the License. ARG PLATFORM=x86_64 -FROM quay.io/pypa/manylinux2014_$PLATFORM:2024-03-25-9206bd9 +FROM quay.io/pypa/manylinux2014_$PLATFORM:2024-08-03-32dfa47 # re-declare after FROM, reusing the default value ARG PLATFORM ENV PLATFORM $PLATFORM +RUN mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup && \ + if [ "${PLATFORM}" = "x86_64" ]; then \ + curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo; \ + elif [ "${PLATFORM}" = "aarch64" ]; then \ + curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-altarch-7.repo; \ + fi && \ + yum -y update && \ + yum -y install devtoolset-10-libatomic-devel libtool + # target: ghcr.io/v6d-io/v6d/vineyard-manylinux2014:20240218_$PLATFORM # Not sure why bundled cmake(3.28.0) in pipx doesn't work diff --git a/docker/vineyardd/Dockerfile.alpine-builder b/docker/vineyardd/Dockerfile.alpine-builder index 50263840..f8756e43 100644 --- a/docker/vineyardd/Dockerfile.alpine-builder +++ b/docker/vineyardd/Dockerfile.alpine-builder @@ -40,14 +40,24 @@ RUN echo "multilib_policy=best" >> /etc/yum.conf && \ echo "skip_missing_names_on_install=False" >> /etc/yum.conf \ sed -i '/^override_install_langs=/d' /etc/yum.conf \ echo "exclude = d36uatko69830t.cloudfront.net" >> /etc/yum/pluginconf.d/fastestmirror.conf \ - yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && \ - yum-config-manager --enable extras && \ - yum -y update && \ - yum -y install yum-utils autoconf automake curl centos-release-scl-rh m4 make wget && \ - yum -y install devtoolset-10-binutils devtoolset-10-gcc devtoolset-10-gcc-c++ && \ - localedef -i en_US -f UTF-8 en_US.UTF-8 && \ - yum clean all && \ - rm -rf /var/cache/yum + mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup && \ + if [ "${PLATFORM}" = "x86_64" ]; then \ + curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo; \ + elif [ "${PLATFORM}" = "aarch64" ]; then \ + curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-altarch-7.repo; \ + fi && \ + yum-config-manager --enable extras && \ + yum -y update && \ + yum -y install yum-utils autoconf automake curl centos-release-scl-rh m4 make wget && \ + # for centos-scl-rh + sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-SCLo-* && \ + if [ "${PLATFORM}" = "x86_64" ]; then \ + sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://mirrors.aliyun.com|g' /etc/yum.repos.d/CentOS-SCLo-*; \ + elif [ "${PLATFORM}" = "aarch64" ]; then \ + sed -i 's|#baseurl=http://mirror.centos.org/centos|baseurl=http://mirrors.aliyun.com/centos-altarch|g' /etc/yum.repos.d/CentOS-SCLo-*; \ + fi && \ + yum -y install devtoolset-10-binutils devtoolset-10-gcc devtoolset-10-gcc-c++ devtoolset-10-libatomic-devel libtool && \ + localedef -i en_US -f UTF-8 en_US.UTF-8 ENV BASH_ENV=/opt/rh/devtoolset-10/enable ENV ENV=/opt/rh/devtoolset-10/enable @@ -164,9 +174,9 @@ RUN cd /tmp && \ # # note: remove shared libs RUN cd /tmp && \ - wget -q https://zlib.net/zlib-1.2.13.tar.gz && \ - tar zxf zlib-1.2.13.tar.gz && \ - cd zlib-1.2.13 && \ + wget -q https://zlib.net/zlib-1.3.1.tar.gz && \ + tar zxf zlib-1.3.1.tar.gz && \ + cd zlib-1.3.1 && \ mkdir build && \ cd build && \ cmake .. -DCMAKE_BUILD_TYPE=MinSizeRel \ @@ -174,7 +184,7 @@ RUN cd /tmp && \ make install -j`nproc` && \ rm -rf /usr/local/lib/libz.so* && \ cd /tmp && \ - rm -rf zlib-1.2.13.tar.gz zlib-1.2.13 + rm -rf zlib-1.3.1.tar.gz zlib-1.3.1 # install openssl: boringssl doesn't bring headers when installing RUN cd /tmp && \