mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-11-29 18:38:44 +08:00
enhance: make milvus image with asan available (#37050)
issue: #35854 Signed-off-by: chyezh <chyezh@outlook.com>
This commit is contained in:
parent
49b562207c
commit
f07aa72589
8
Makefile
8
Makefile
@ -28,8 +28,8 @@ ifdef disk_index
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
use_asan = OFF
|
use_asan = OFF
|
||||||
ifdef USE_ASAN
|
ifeq ($(USE_ASAN), ON)
|
||||||
use_asan =${USE_ASAN}
|
use_asan = ${USE_ASAN}
|
||||||
CGO_LDFLAGS := $(shell go env CGO_LDFLAGS) -fno-stack-protector -fno-omit-frame-pointer -fno-var-tracking -fsanitize=address
|
CGO_LDFLAGS := $(shell go env CGO_LDFLAGS) -fno-stack-protector -fno-omit-frame-pointer -fno-var-tracking -fsanitize=address
|
||||||
CGO_CFLAGS := $(shell go env CGO_CFLAGS) -fno-stack-protector -fno-omit-frame-pointer -fno-var-tracking -fsanitize=address
|
CGO_CFLAGS := $(shell go env CGO_CFLAGS) -fno-stack-protector -fno-omit-frame-pointer -fno-var-tracking -fsanitize=address
|
||||||
MILVUS_GO_BUILD_TAGS := $(MILVUS_GO_BUILD_TAGS),use_asan
|
MILVUS_GO_BUILD_TAGS := $(MILVUS_GO_BUILD_TAGS),use_asan
|
||||||
@ -384,12 +384,12 @@ codecov-cpp: build-cpp-with-coverage
|
|||||||
# Build each component and install binary to $GOPATH/bin.
|
# Build each component and install binary to $GOPATH/bin.
|
||||||
install: milvus
|
install: milvus
|
||||||
@echo "Installing binary to './bin'"
|
@echo "Installing binary to './bin'"
|
||||||
@(env USE_ASAN=$(USE_ASAN) GOPATH=$(GOPATH) LIBRARY_PATH=$(LIBRARY_PATH) bash $(PWD)/scripts/install_milvus.sh)
|
@(env GOPATH=$(GOPATH) LIBRARY_PATH=$(LIBRARY_PATH) bash $(PWD)/scripts/install_milvus.sh)
|
||||||
@echo "Installation successful."
|
@echo "Installation successful."
|
||||||
|
|
||||||
gpu-install: milvus-gpu
|
gpu-install: milvus-gpu
|
||||||
@echo "Installing binary to './bin'"
|
@echo "Installing binary to './bin'"
|
||||||
@(env USE_ASAN=$(USE_ASAN) GOPATH=$(GOPATH) LIBRARY_PATH=$(LIBRARY_PATH) bash $(PWD)/scripts/install_milvus.sh)
|
@(env GOPATH=$(GOPATH) LIBRARY_PATH=$(LIBRARY_PATH) bash $(PWD)/scripts/install_milvus.sh)
|
||||||
@echo "Installation successful."
|
@echo "Installation successful."
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
FROM amazonlinux:2023
|
FROM amazonlinux:2023
|
||||||
|
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
|
ARG MILVUS_ASAN_LIB
|
||||||
|
|
||||||
RUN yum install -y wget libgomp libaio libatomic openblas-devel && \
|
RUN yum install -y wget libgomp libaio libatomic openblas-devel && \
|
||||||
rm -rf /var/cache/yum/*
|
rm -rf /var/cache/yum/*
|
||||||
@ -29,7 +30,7 @@ COPY --chown=root:root --chmod=774 ./lib/ /milvus/lib/
|
|||||||
|
|
||||||
ENV PATH=/milvus/bin:$PATH
|
ENV PATH=/milvus/bin:$PATH
|
||||||
ENV LD_LIBRARY_PATH=/milvus/lib:$LD_LIBRARY_PATH:/usr/lib
|
ENV LD_LIBRARY_PATH=/milvus/lib:$LD_LIBRARY_PATH:/usr/lib
|
||||||
ENV LD_PRELOAD=/milvus/lib/libjemalloc.so
|
ENV LD_PRELOAD=${MILVUS_ASAN_LIB}:/milvus/lib/libjemalloc.so
|
||||||
ENV MALLOC_CONF=background_thread:true
|
ENV MALLOC_CONF=background_thread:true
|
||||||
|
|
||||||
ENTRYPOINT ["/tini", "--"]
|
ENTRYPOINT ["/tini", "--"]
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
FROM rockylinux/rockylinux:8
|
FROM rockylinux/rockylinux:8
|
||||||
|
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
|
ARG MILVUS_ASAN_LIB
|
||||||
|
|
||||||
RUN dnf install -y wget libgomp libaio libatomic
|
RUN dnf install -y wget libgomp libaio libatomic
|
||||||
|
|
||||||
@ -33,7 +34,7 @@ COPY ./lib/ /milvus/lib/
|
|||||||
|
|
||||||
ENV PATH=/milvus/bin:$PATH
|
ENV PATH=/milvus/bin:$PATH
|
||||||
ENV LD_LIBRARY_PATH=/milvus/lib:$LD_LIBRARY_PATH:/usr/lib
|
ENV LD_LIBRARY_PATH=/milvus/lib:$LD_LIBRARY_PATH:/usr/lib
|
||||||
ENV LD_PRELOAD=/milvus/lib/libjemalloc.so
|
ENV LD_PRELOAD=${MILVUS_ASAN_LIB}:/milvus/lib/libjemalloc.so
|
||||||
ENV MALLOC_CONF=background_thread:true
|
ENV MALLOC_CONF=background_thread:true
|
||||||
|
|
||||||
ENTRYPOINT ["/tini", "--"]
|
ENTRYPOINT ["/tini", "--"]
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
FROM ubuntu:focal-20240530
|
FROM ubuntu:focal-20240530
|
||||||
|
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
|
ARG MILVUS_ASAN_LIB
|
||||||
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y --no-install-recommends curl ca-certificates libaio-dev libgomp1 libopenblas-dev && \
|
apt-get install -y --no-install-recommends curl ca-certificates libaio-dev libgomp1 libopenblas-dev && \
|
||||||
@ -30,7 +31,7 @@ COPY --chown=root:root --chmod=774 ./lib/ /milvus/lib/
|
|||||||
|
|
||||||
ENV PATH=/milvus/bin:$PATH
|
ENV PATH=/milvus/bin:$PATH
|
||||||
ENV LD_LIBRARY_PATH=/milvus/lib:$LD_LIBRARY_PATH:/usr/lib
|
ENV LD_LIBRARY_PATH=/milvus/lib:$LD_LIBRARY_PATH:/usr/lib
|
||||||
ENV LD_PRELOAD=/milvus/lib/libjemalloc.so
|
ENV LD_PRELOAD=${MILVUS_ASAN_LIB}:/milvus/lib/libjemalloc.so
|
||||||
ENV MALLOC_CONF=background_thread:true
|
ENV MALLOC_CONF=background_thread:true
|
||||||
|
|
||||||
ENTRYPOINT ["/tini", "--"]
|
ENTRYPOINT ["/tini", "--"]
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
FROM ubuntu:jammy-20240530
|
FROM ubuntu:jammy-20240530
|
||||||
|
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
|
ARG MILVUS_ASAN_LIB
|
||||||
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y --no-install-recommends curl ca-certificates libaio-dev libgomp1 libopenblas-dev && \
|
apt-get install -y --no-install-recommends curl ca-certificates libaio-dev libgomp1 libopenblas-dev && \
|
||||||
@ -30,7 +31,7 @@ COPY --chown=root:root --chmod=774 ./lib/ /milvus/lib/
|
|||||||
|
|
||||||
ENV PATH=/milvus/bin:$PATH
|
ENV PATH=/milvus/bin:$PATH
|
||||||
ENV LD_LIBRARY_PATH=/milvus/lib:$LD_LIBRARY_PATH:/usr/lib
|
ENV LD_LIBRARY_PATH=/milvus/lib:$LD_LIBRARY_PATH:/usr/lib
|
||||||
ENV LD_PRELOAD=/milvus/lib/libjemalloc.so
|
ENV LD_PRELOAD=${MILVUS_ASAN_LIB}:/milvus/lib/libjemalloc.so
|
||||||
ENV MALLOC_CONF=background_thread:true
|
ENV MALLOC_CONF=background_thread:true
|
||||||
|
|
||||||
ENTRYPOINT ["/tini", "--"]
|
ENTRYPOINT ["/tini", "--"]
|
||||||
|
Loading…
Reference in New Issue
Block a user