Skip to content

Commit

Permalink
fix CI failure when building manylinux and dev images
Browse files Browse the repository at this point in the history
  • Loading branch information
lidongze0629 committed Aug 9, 2024
1 parent 32cfcf4 commit fbffae5
Show file tree
Hide file tree
Showing 7 changed files with 170 additions and 217 deletions.
106 changes: 0 additions & 106 deletions .github/workflows/build-graphscope-manylinux-ext-images.yml

This file was deleted.

45 changes: 45 additions & 0 deletions .github/workflows/build-graphscope-manylinux-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build GraphScope Manylinux Images

# build `graphscope/manylinux2014` image based on centos7, including all necessary
# dependencies except vineyard
on:
workflow_dispatch:
pull_request:
branches:
- main
paths:
- 'python/graphscope/gsctl/scripts/**'
- '.github/workflows/build-graphscope-manylinux-images.yml'


concurrency:
group: ${{ github.repository }}-${{ github.event.number || github.head_ref || github.sha }}-${{ github.workflow }}
cancel-in-progress: true

env:
REGISTRY: registry.cn-hongkong.aliyuncs.com

jobs:
build-manylinux-image-amd64:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Build Image
run: |
cd ${GITHUB_WORKSPACE}/k8s
# output: graphscope/manylinux:amd64
make manylinux2014
- name: Release Image
if: ${{ github.event_name == 'workflow_dispatch' }}
env:
docker_password: ${{ secrets.DOCKER_PASSWORD }}
docker_username: ${{ secrets.DOCKER_USER }}
run: |
echo "${docker_password}" | sudo docker login --username="${docker_username}" ${{ env.REGISTRY }} --password-stdin
# manylinux2014 image
sudo docker tag graphscope/manylinux2014:amd64 ${{ env.REGISTRY }}/graphscope/manylinux2014:amd64
sudo docker push ${{ env.REGISTRY }}/graphscope/manylinux2014:amd64
13 changes: 10 additions & 3 deletions k8s/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ ifeq ($(REGISTRY),)
REGISTRY := registry.cn-hongkong.aliyuncs.com
endif

# x86_64 or aarch64
ARCH := $(shell uname -m)
PLATFORM := $(shell uname -m)
# can be: x86_64, aarch64
ARCH := $(subst x86_64,amd64,$(subst aarch64,arm64,$(PLATFORM)))


VERSION ?= latest
VINEYARD_VERSION ?= v0.23.0
Expand Down Expand Up @@ -41,6 +43,12 @@ interactive: interactive-frontend interactive-executor
all: coordinator analytical interactive learning
graphscope: all

manylinux2014:
cd $(WORKING_DIR)/../ && \
docker build \
-t graphscope/manylinux2014:${ARCH} \
-f $(DOCKERFILES_DIR)/manylinux2014.Dockerfile .

dev-wheel:
cd $(WORKING_DIR) && \
cd ../python/graphscope && \
Expand All @@ -50,7 +58,6 @@ dev-wheel:
-t graphscope/graphscope-dev:wheel-${VINEYARD_VERSION}-${ARCH} \
-f $(DOCKERFILES_DIR)/manylinux2014.Dockerfile .


manylinux2014-ext:
cd $(WORKING_DIR) && \
cd ../python/graphscope && \
Expand Down
73 changes: 73 additions & 0 deletions k8s/dockerfiles/graphscope-dev-wheel.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# the manylinux2014 image is based on manylinux2014, including all necessary
# dependencies except vineyard for graphscope's wheel package.
# It's tagged as the graphscope/graphscope-dev:wheel

ARG REGISTRY=registry.cn-hongkong.aliyuncs.com
#FROM vineyardcloudnative/manylinux-llvm:2014-11.0.0 AS llvm
FROM $REGISTRY/graphscope/manylinux2014:ext AS ext

# build form https://github.com/sighingnow/manylinux/tree/dyn-rebase
# usually we don't need to change this image unless the underlying python needs to be updated
FROM $REGISTRY/graphscope/manylinux2014:20230407

# shanghai zoneinfo
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
echo '$TZ' > /etc/timezone

# for programming output
RUN localedef -c -f UTF-8 -i en_US en_US.UTF-8
ENV LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8

ENV GRAPHSCOPE_HOME=/opt/graphscope

ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib:/usr/local/lib64
ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$GRAPHSCOPE_HOME/lib:$GRAPHSCOPE_HOME/lib64
ENV PATH=$PATH:$GRAPHSCOPE_HOME/bin:/home/graphscope/.local/bin:/home/graphscope/.cargo/bin

ENV JAVA_HOME=/usr/lib/jvm/java
ENV RUST_BACKTRACE=1

# install clang-11 with gold optimizer plugin, depends on header include/plugin-api.h
# COPY --from=llvm /opt/llvm11.0.0 /opt/llvm11
# ENV LLVM11_HOME=/opt/llvm11
# ENV LIBCLANG_PATH=$LLVM11_HOME/lib LLVM_CONFIG_PATH=$LLVM11_HOME/bin/llvm-config

# Copy the thirdparty c++ dependencies, maven, and hadoop
COPY --from=ext /opt/graphscope /opt/graphscope
COPY --from=ext /opt/openmpi /opt/openmpi
RUN chmod +x /opt/graphscope/bin/* /opt/openmpi/bin/*

RUN useradd -m graphscope -u 1001 \
&& echo 'graphscope ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

# Install jdk-11
RUN yum install -y sudo vim && \
yum install python3-pip -y && \
yum remove java-1.8.0-openjdk-devel java-1.8.0-openjdk java-1.8.0-openjdk-headless -y && \
yum install java-11-openjdk-devel -y && \
yum clean all -y --enablerepo='*' && \
rm -rf /var/cache/yum

RUN mkdir -p /opt/graphscope /opt/vineyard && chown -R graphscope:graphscope /opt/graphscope /opt/vineyard

USER graphscope
WORKDIR /home/graphscope

COPY --chown=graphscope:graphscope gsctl /home/graphscope/gsctl
ARG VINEYARD_VERSION=main
RUN cd /home/graphscope/gsctl && \
sudo python3 -m pip install click && \
python3 gsctl.py install-deps dev --v6d-version=$VINEYARD_VERSION -j $(nproc) && \
cd /home/graphscope && sudo rm -rf /home/graphscope/gsctl && \
sudo yum clean all -y && \
sudo rm -fr /var/cache/yum
RUN echo ". /home/graphscope/.graphscope_env" >> ~/.bashrc

SHELL [ "/usr/bin/scl", "enable", "rh-python38" ]

RUN python3 -m pip --no-cache install pyyaml --user
# Uncomment this line will results in a weird error when using the image together with commands, like
# docker run --rm graphscope/graphscope-dev:latest bash -c 'echo xxx && ls -la'
# The output of `ls -la` would not be shown.
# ENTRYPOINT ["/bin/bash", "-c", ". scl_source enable devtoolset-8 rh-python38 && $0 $@"]
41 changes: 0 additions & 41 deletions k8s/dockerfiles/manylinux2014-ext.Dockerfile

This file was deleted.

Loading

0 comments on commit fbffae5

Please sign in to comment.