Skip to content

Commit

Permalink
Use pre-built llvm instead of build when making analytical docker (#2183
Browse files Browse the repository at this point in the history
)
  • Loading branch information
siyuan0322 committed Oct 31, 2022
1 parent 79a08d3 commit 25ab466
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 23 deletions.
5 changes: 2 additions & 3 deletions k8s/standalone/Makefile
Expand Up @@ -16,8 +16,8 @@ VERSION ?= latest
PROFILE ?= release

image-vineyard-runtime:
cd $(WORKING_DIR)/../.. && docker build -t ${REGISTRY}/$(DOCKER_ORG)/vineyard-runtime:${VERSION} \
-f $(WORKING_DIR)/runtime/vineyard.Dockerfile .
cd $(WORKING_DIR) && docker build --squash -t ${REGISTRY}/$(DOCKER_ORG)/vineyard-runtime:${VERSION} \
-f $(WORKING_DIR)/vineyard.Dockerfile .

image-coordinator:
cd $(WORKING_DIR)/../.. && docker build --target coordinator -t ${REGISTRY}/$(DOCKER_ORG)/coordinator:${VERSION} -f $(WORKING_DIR)/coordinator.Dockerfile .
Expand All @@ -44,7 +44,6 @@ image-learning:


push:
docker push ${REGISTRY}/$(DOCKER_ORG)/vineyard-runtime:${VERSION}
docker push ${REGISTRY}/$(DOCKER_ORG)/coordinator:${VERSION}
docker push ${REGISTRY}/$(DOCKER_ORG)/analytical:${VERSION}
docker push ${REGISTRY}/$(DOCKER_ORG)/analytical-java:${VERSION}
Expand Down
23 changes: 3 additions & 20 deletions k8s/standalone/analytical.Dockerfile
Expand Up @@ -11,6 +11,7 @@ RUN sudo chown -R graphscope:graphscope /home/graphscope/GraphScope
RUN cd /home/graphscope/GraphScope/ \
&& mkdir /home/graphscope/install \
&& make gae-install ENABLE_JAVA_SDK=OFF INSTALL_PREFIX=/home/graphscope/install \
&& make clean \
&& mkdir /home/graphscope/install-with-java \
&& make gae-install ENABLE_JAVA_SDK=ON INSTALL_PREFIX=/home/graphscope/install-with-java

Expand All @@ -23,35 +24,17 @@ USER graphscope
WORKDIR /home/graphscope

############### RUNTIME: GAE-JAVA #######################
FROM vineyardcloudnative/manylinux-llvm:2014-11.0.0 AS llvm
FROM registry.cn-hongkong.aliyuncs.com/graphscope/vineyard-runtime:$BASE_VERSION AS analytical-java

COPY --from=builder /home/graphscope/install-with-java /opt/graphscope/
COPY --from=llvm /opt/llvm11.0.0 /opt/llvm11

# Installed size: 200M
RUN yum install -y java-1.8.0-openjdk-devel \
&& yum clean all \
&& rm -rf /var/cache/yum

# install clang-11 with gold optimizer plugin, depends on header include/plugin-api.h
# Installed size: 1.5G
# TODO: Don't compile from scratch
RUN cd /tmp && \
mkdir -p binutils/include && \
cd binutils/include && \
wget -q https://raw.githubusercontent.com/bminor/binutils-gdb/binutils-2_37-branch/include/plugin-api.h && \
cd /tmp && \
wget -q https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-11.1.0.tar.gz && \
tar zxf /tmp/llvmorg-11.1.0.tar.gz -C /tmp/ && \
cd llvm-project-llvmorg-11.1.0/ && \
cmake -G "Unix Makefiles" -DLLVM_ENABLE_PROJECTS='clang;lld' \
-DCMAKE_INSTALL_PREFIX=/opt/llvm11 \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_TARGETS_TO_BUILD=X86 \
-DLLVM_BINUTILS_INCDIR=/tmp/binutils/include \
./llvm && \
make install -j`nproc` && \
rm -rf /tmp/llvm-project-llvmorg-11.1.0 /tmp/llvmorg-11.1.0.tar.gz /tmp/binutils

ENV JAVA_HOME /usr/lib/jvm/java

ENV LLVM11_HOME=/opt/llvm11
Expand Down

0 comments on commit 25ab466

Please sign in to comment.