Skip to content

Commit

Permalink
Add Dockerfile for Alpine Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
daper committed Jun 12, 2023
1 parent 668c556 commit 302ab01
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions Dockerfile.alpine
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
FROM python:alpine as base

RUN apk --no-cache add rustup \
&& rustup-init -yq --target nightly \
&& source "$HOME/.cargo/env"

FROM base as tikv_client

RUN apk --no-cache add \
git \
linux-headers \
gcc g++ \
cmake \
make \
clang14 \
openssl-dev \
openssl-libs-static \
protoc \
patchelf \
&& git clone https://github.com/tikv/client-py /root/client-py \
&& pip install maturin

ENV CARGO_ENCODED_RUSTFLAGS="-L/usr/lib" \
OPENSSL_NO_VENDOR=1

WORKDIR /root/client-py
RUN source "$HOME/.cargo/env" \
&& maturin build --release \
&& pip install target/wheels/*.whl

FROM base as nucliadb

RUN apk --no-cache add \
git \
gcc g++ \
cmake \
make \
openssl-dev \
openssl-libs-static \
patchelf \
&& git clone https://github.com/nuclia/nucliadb /root/nucliadb \
&& pip install maturin

ENV OPENSSL_NO_VENDOR=1

WORKDIR /root/nucliadb
RUN source "$HOME/.cargo/env" \
&& maturin build -m nucliadb_node/binding/Cargo.toml --release \
&& pip install target/wheels/*.whl

FROM python:alpine

COPY --from=tikv_client \
/root/client-py/target/wheels/*.whl /root/
COPY --from=nucliadb \
/root/nucliadb/target/wheels/*.whl /root/

RUN apk --no-cache add \
gcc g++ \
&& pip install /root/*.whl \
&& pip install nucliadb

ENTRYPOINT ["/usr/local/bin/nucliadb"]

1 comment on commit 302ab01

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: 302ab01 Previous: de57a03 Ratio
nucliadb/tests/benchmarks/test_search.py::test_search_returns_labels 80.47379783469417 iter/sec (stddev: 0.0001400732267473104) 57.754215104951115 iter/sec (stddev: 0.0006450570552202599) 0.72
nucliadb/tests/benchmarks/test_search.py::test_search_relations 187.39663550466537 iter/sec (stddev: 0.000020177536690075214) 143.60692081092313 iter/sec (stddev: 0.00028576229978305055) 0.77

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.