mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-11-29 10:28:41 +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
|
||||
|
||||
use_asan = OFF
|
||||
ifdef USE_ASAN
|
||||
use_asan =${USE_ASAN}
|
||||
ifeq ($(USE_ASAN), ON)
|
||||
use_asan = ${USE_ASAN}
|
||||
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
|
||||
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.
|
||||
install: milvus
|
||||
@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."
|
||||
|
||||
gpu-install: milvus-gpu
|
||||
@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."
|
||||
|
||||
clean:
|
||||
|
@ -12,6 +12,7 @@
|
||||
FROM amazonlinux:2023
|
||||
|
||||
ARG TARGETARCH
|
||||
ARG MILVUS_ASAN_LIB
|
||||
|
||||
RUN yum install -y wget libgomp libaio libatomic openblas-devel && \
|
||||
rm -rf /var/cache/yum/*
|
||||
@ -29,7 +30,7 @@ COPY --chown=root:root --chmod=774 ./lib/ /milvus/lib/
|
||||
|
||||
ENV PATH=/milvus/bin:$PATH
|
||||
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
|
||||
|
||||
ENTRYPOINT ["/tini", "--"]
|
||||
|
@ -13,6 +13,7 @@
|
||||
FROM rockylinux/rockylinux:8
|
||||
|
||||
ARG TARGETARCH
|
||||
ARG MILVUS_ASAN_LIB
|
||||
|
||||
RUN dnf install -y wget libgomp libaio libatomic
|
||||
|
||||
@ -33,7 +34,7 @@ COPY ./lib/ /milvus/lib/
|
||||
|
||||
ENV PATH=/milvus/bin:$PATH
|
||||
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
|
||||
|
||||
ENTRYPOINT ["/tini", "--"]
|
||||
|
@ -12,6 +12,7 @@
|
||||
FROM ubuntu:focal-20240530
|
||||
|
||||
ARG TARGETARCH
|
||||
ARG MILVUS_ASAN_LIB
|
||||
|
||||
RUN apt-get update && \
|
||||
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 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
|
||||
|
||||
ENTRYPOINT ["/tini", "--"]
|
||||
|
@ -12,6 +12,7 @@
|
||||
FROM ubuntu:jammy-20240530
|
||||
|
||||
ARG TARGETARCH
|
||||
ARG MILVUS_ASAN_LIB
|
||||
|
||||
RUN apt-get update && \
|
||||
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 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
|
||||
|
||||
ENTRYPOINT ["/tini", "--"]
|
||||
|
Loading…
Reference in New Issue
Block a user