mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-04 16:09:05 +00:00
ci: enable mimalloc for ARM (#884)
This commit is contained in:
@@ -23,7 +23,7 @@ jobs:
|
||||
file_ext: .tar.gz
|
||||
- arch: aarch64-unknown-linux-gnu
|
||||
os: ubuntu-2004-8-cores
|
||||
features: ""
|
||||
features: "--features mimalloc"
|
||||
file_name: openobserve-${{ github.ref_name }}-linux-arm64
|
||||
file_ext: .tar.gz
|
||||
- arch: x86_64-apple-darwin
|
||||
@@ -33,7 +33,7 @@ jobs:
|
||||
file_ext: .tar.gz
|
||||
- arch: aarch64-apple-darwin
|
||||
os: macos-latest
|
||||
features: "--no-default-features"
|
||||
features: ""
|
||||
file_name: openobserve-${{ github.ref_name }}-darwin-arm64
|
||||
file_ext: .tar.gz
|
||||
- arch: x86_64-pc-windows-msvc
|
||||
|
||||
@@ -24,12 +24,11 @@ ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc \
|
||||
CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++ \
|
||||
RUSTFLAGS='-C target-feature=+aes,+crc,+lse,+neon'
|
||||
RUN --mount=type=cache,target=/root/.cache/sccache du -sh /root/.cache/sccache
|
||||
RUN --mount=type=cache,target=/root/.cache/sccache cargo build --release --target aarch64-unknown-linux-gnu \
|
||||
RUN --mount=type=cache,target=/root/.cache/sccache cargo build --release --features mimalloc --target aarch64-unknown-linux-gnu \
|
||||
&& sccache --show-stats \
|
||||
&& du -sh /root/.cache/sccache
|
||||
RUN mv /app/target/aarch64-unknown-linux-gnu/release/openobserve /app/target/release/openobserve
|
||||
|
||||
# FROM gcr.io/distroless/cc:latest-arm64 as runtime
|
||||
# FROM gcr.io/distroless/cc:latest-arm64 as runtime
|
||||
FROM public.ecr.aws/debian/debian:bullseye-slim as runtime
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates
|
||||
|
||||
@@ -20,7 +20,7 @@ COPY . /app
|
||||
COPY --from=webBuilder /web/dist web/dist
|
||||
|
||||
RUN --mount=type=cache,target=/root/.cache/sccache du -sh /root/.cache/sccache
|
||||
RUN --mount=type=cache,target=/root/.cache/sccache RUSTFLAGS='-C target-feature=+sse2,+sse3,+ssse3,+sse4.1,+sse4.2' cargo build --release --target x86_64-unknown-linux-gnu \
|
||||
RUN --mount=type=cache,target=/root/.cache/sccache RUSTFLAGS='-C target-feature=+sse2,+sse3,+ssse3,+sse4.1,+sse4.2' cargo build --release --features mimalloc --target x86_64-unknown-linux-gnu \
|
||||
&& sccache --show-stats \
|
||||
&& du -sh /root/.cache/sccache
|
||||
RUN mv /app/target/x86_64-unknown-linux-gnu/release/openobserve /app/target/release/openobserve
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
FROM public.ecr.aws/docker/library/node:18.12.1-bullseye as webBuilder
|
||||
WORKDIR /web
|
||||
COPY ./web /web/
|
||||
|
||||
RUN npm install
|
||||
RUN NODE_OPTIONS="--max-old-space-size=8192" npm run build
|
||||
|
||||
# FROM public.ecr.aws/docker/library/rust:bullseye as builder
|
||||
FROM public.ecr.aws/zinclabs/rust:bullseye-sccache as builder
|
||||
|
||||
# RUN rustup toolchain install nightly-2023-05-21
|
||||
# RUN rustup default nightly-2023-05-21
|
||||
# RUN rustup target add aarch64-unknown-linux-gnu
|
||||
# RUN diff -u <(rustc --print cfg) <(rustc -C target-cpu=native --print cfg)
|
||||
RUN rustc --version && sccache --version
|
||||
|
||||
WORKDIR /app
|
||||
COPY . /app
|
||||
COPY --from=webBuilder /web/dist web/dist
|
||||
|
||||
ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc \
|
||||
CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc \
|
||||
CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++ \
|
||||
RUSTFLAGS='-C target-feature=+aes,+crc,+lse,+neon'
|
||||
RUN --mount=type=cache,target=/root/.cache/sccache du -sh /root/.cache/sccache
|
||||
RUN --mount=type=cache,target=/root/.cache/sccache cargo build --release --features mimalloc --target aarch64-unknown-linux-gnu \
|
||||
&& sccache --show-stats \
|
||||
&& du -sh /root/.cache/sccache
|
||||
RUN mv /app/target/aarch64-unknown-linux-gnu/release/openobserve /app/target/release/openobserve
|
||||
|
||||
# FROM gcr.io/distroless/cc:latest-arm64 as runtime
|
||||
FROM public.ecr.aws/debian/debian:bullseye-slim as runtime
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates
|
||||
RUN apt-get install -y curl htop iftop sysstat procps lsof net-tools
|
||||
RUN update-ca-certificates
|
||||
COPY --from=builder /app/target/release/openobserve /
|
||||
CMD ["/openobserve"]
|
||||
@@ -1,34 +0,0 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
FROM public.ecr.aws/docker/library/node:18.12.1-bullseye as webBuilder
|
||||
WORKDIR /web
|
||||
COPY ./web /web/
|
||||
|
||||
RUN npm install
|
||||
RUN NODE_OPTIONS="--max-old-space-size=8192" npm run build
|
||||
|
||||
# FROM public.ecr.aws/docker/library/rust:bullseye as builder
|
||||
FROM public.ecr.aws/zinclabs/rust:bullseye-sccache as builder
|
||||
|
||||
# RUN rustup toolchain install nightly-2023-05-21
|
||||
# RUN rustup default nightly-2023-05-21
|
||||
# RUN rustup target add x86_64-unknown-linux-gnu
|
||||
# RUN diff -u <(rustc --print cfg) <(rustc -C target-cpu=native --print cfg)
|
||||
RUN rustc --version && sccache --version
|
||||
|
||||
WORKDIR /app
|
||||
COPY . /app
|
||||
COPY --from=webBuilder /web/dist web/dist
|
||||
|
||||
RUN --mount=type=cache,target=/root/.cache/sccache du -sh /root/.cache/sccache
|
||||
RUN --mount=type=cache,target=/root/.cache/sccache RUSTFLAGS='-C target-feature=+sse2,+sse3,+ssse3,+sse4.1,+sse4.2' cargo build --release --features mimalloc --target x86_64-unknown-linux-gnu \
|
||||
&& sccache --show-stats \
|
||||
&& du -sh /root/.cache/sccache
|
||||
RUN mv /app/target/x86_64-unknown-linux-gnu/release/openobserve /app/target/release/openobserve
|
||||
|
||||
# FROM gcr.io/distroless/cc as runtime
|
||||
FROM public.ecr.aws/debian/debian:bullseye-slim as runtime
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates
|
||||
RUN apt-get install -y curl htop iftop sysstat procps lsof net-tools
|
||||
RUN update-ca-certificates
|
||||
COPY --from=builder /app/target/release/openobserve /
|
||||
CMD ["/openobserve"]
|
||||
@@ -24,7 +24,7 @@ ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc \
|
||||
CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc \
|
||||
CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++ \
|
||||
RUSTFLAGS='-C target-feature=+aes,+crc,+lse,+neon'
|
||||
RUN cargo build --release --target aarch64-unknown-linux-gnu
|
||||
RUN cargo build --release --features mimalloc --target aarch64-unknown-linux-gnu
|
||||
RUN mv /app/target/aarch64-unknown-linux-gnu/release/openobserve /app/target/release/openobserve
|
||||
|
||||
FROM gcr.io/distroless/cc:latest-arm64 as runtime
|
||||
|
||||
@@ -55,12 +55,6 @@ phases:
|
||||
- docker manifest push public.ecr.aws/zinclabs/openobserve-dev:$GIT_TAG-$GIT_HASH
|
||||
- docker manifest push public.ecr.aws/zinclabs/openobserve-dev:latest
|
||||
|
||||
# build openobserve-mimalloc
|
||||
- docker pull public.ecr.aws/zinclabs/rust:bullseye-sccache
|
||||
- docker build -t openobserve:latest-arm64-mimalloc -f deploy/build/Dockerfile.mimalloc.aarch64 .
|
||||
- docker tag openobserve:latest-arm64-mimalloc public.ecr.aws/zinclabs/openobserve-dev:$GIT_TAG-$GIT_HASH-arm64-mimalloc
|
||||
- docker push public.ecr.aws/zinclabs/openobserve-dev:$GIT_TAG-$GIT_HASH-arm64-mimalloc
|
||||
|
||||
cache:
|
||||
paths:
|
||||
- /root/.cache/
|
||||
|
||||
@@ -31,7 +31,7 @@ phases:
|
||||
|
||||
# build openobserve
|
||||
- docker pull public.ecr.aws/zinclabs/rust:bullseye-sccache
|
||||
- docker build -t openobserve:latest-amd64 -f deploy/build/Dockerfile.mimalloc.amd64 .
|
||||
- docker build -t openobserve:latest-amd64 -f deploy/build/Dockerfile.amd64 .
|
||||
- docker tag openobserve:latest-amd64 public.ecr.aws/zinclabs/openobserve-dev:$GIT_TAG-$GIT_HASH-amd64
|
||||
- docker tag openobserve:latest-amd64 public.ecr.aws/zinclabs/openobserve-dev:latest-amd64
|
||||
- docker push public.ecr.aws/zinclabs/openobserve-dev:$GIT_TAG-$GIT_HASH-amd64
|
||||
|
||||
Reference in New Issue
Block a user