-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merge lantern and lantern_extras repos
- Loading branch information
Showing
485 changed files
with
49,534 additions
and
17,096 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
FROM rust:1.78.0 as build | ||
# Copy the files in your machine to the Docker image | ||
WORKDIR /app | ||
COPY . . | ||
ENV ORT_STRATEGY="system" | ||
ARG RUSTFLAGS="" | ||
ENV RUSTFLAGS=$RUSTFLAGS | ||
ARG CXXFLAGS="" | ||
ENV CXXFLAGS=$CXXFLAGS | ||
|
||
ENV CC=/usr/bin/clang-18 | ||
ENV CXX=/usr/bin/clang++-18 | ||
# Remove lantern_extras from workspace | ||
RUN rm -rf lantern_extras && sed -i -e 's/"lantern_extras",//' Cargo.toml | ||
|
||
# Build your program for release | ||
RUN apt update && \ | ||
apt install -y --no-install-recommends lsb-release wget software-properties-common gnupg pkg-config curl libssl-dev && \ | ||
curl -s https://apt.llvm.org/llvm.sh | bash -s -- 18 && \ | ||
cargo build --release --package lantern_cli | ||
|
||
FROM debian:12 | ||
COPY --from=build /app/target/release/lantern-cli . | ||
ARG TARGETARCH | ||
ENV OS_ARCH="${TARGETARCH:-amd64}" | ||
|
||
RUN apt update && \ | ||
apt install -y wget && apt clean | ||
|
||
# Download onnxruntime | ||
RUN cd /tmp && \ | ||
ONNX_VERSION="1.16.1" && \ | ||
PACKAGE_URL="https://github.com/microsoft/onnxruntime/releases/download/v${ONNX_VERSION}/onnxruntime-linux-x64-${ONNX_VERSION}.tgz" && \ | ||
case "$OS_ARCH" in \ | ||
arm*|aarch64) \ | ||
PACKAGE_URL="https://github.com/microsoft/onnxruntime/releases/download/v${ONNX_VERSION}/onnxruntime-linux-aarch64-${ONNX_VERSION}.tgz"; \ | ||
esac && \ | ||
mkdir -p /usr/local/lib && \ | ||
cd /usr/local/lib && \ | ||
wget -qq $PACKAGE_URL && \ | ||
tar xzf ./onnx*.tgz && \ | ||
rm -rf ./onnx*.tgz && \ | ||
mv ./onnx* ./onnxruntime | ||
|
||
ENV ORT_STRATEGY=system | ||
ENV ORT_DYLIB_PATH=/usr/local/lib/onnxruntime/lib/libonnxruntime.so | ||
# Run the binary | ||
ENTRYPOINT ["./lantern-cli"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
FROM rust:1.78.0 as build | ||
# Copy the files in your machine to the Docker image | ||
WORKDIR /app | ||
COPY . . | ||
|
||
# Remove lantern_extras from workspace | ||
RUN rm -rf lantern_extras && sed -i -e 's/"lantern_extras",//' Cargo.toml | ||
|
||
ENV CC=/usr/bin/clang-18 | ||
ENV CXX=/usr/bin/clang++-18 | ||
# Build your program for release | ||
RUN apt update && \ | ||
apt install -y --no-install-recommends lsb-release wget software-properties-common gnupg pkg-config curl libssl-dev && \ | ||
curl -s https://apt.llvm.org/llvm.sh | bash -s -- 18 && \ | ||
cargo build --release --package lantern_cli | ||
|
||
FROM nvcr.io/nvidia/cuda:11.8.0-runtime-ubuntu22.04 | ||
COPY --from=build /app/target/release/lantern-cli . | ||
RUN apt update && \ | ||
apt install -y wget && apt clean | ||
# Download onnxruntime | ||
RUN mkdir -p /usr/local/lib && \ | ||
cd /usr/local/lib && \ | ||
wget -q https://github.com/microsoft/onnxruntime/releases/download/v1.16.1/onnxruntime-linux-x64-gpu-1.16.1.tgz && \ | ||
tar xzf ./onnx*.tgz && \ | ||
rm -rf ./onnx*.tgz && \ | ||
mv ./onnx* ./onnxruntime | ||
|
||
# Install libcudnn | ||
RUN wget -q https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/libcudnn8_8.7.0.84-1+cuda11.8_amd64.deb -O libcudnn.deb && \ | ||
dpkg -i libcudnn.deb && \ | ||
rm -rf libcudnn.deb | ||
|
||
RUN ln -s /usr/local/cuda/targets/x86_64-linux/lib/libnvrtc.so.11.2 /usr/local/cuda/targets/x86_64-linux/lib/libnvrtc.so | ||
ENV ORT_STRATEGY=system | ||
ENV ORT_DYLIB_PATH=/usr/local/lib/onnxruntime/lib/libonnxruntime.so | ||
# Run the binary | ||
ENTRYPOINT ["./lantern-cli"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
source "$(dirname "$0")/get_arch_and_platform.sh" | ||
cd $BUILD_DIR | ||
EXT_VERSION=$(cmake --system-information | awk -F= '$1~/CMAKE_PROJECT_VERSION:STATIC/{print$2}') | ||
PACKAGE_NAME=lantern-${EXT_VERSION}-postgres-${PG_VERSION}-${PLATFORM}-${ARCH} | ||
|
||
mkdir -p ${BUILD_DIR}/${PACKAGE_NAME}/src | ||
cp ${SOURCE_DIR}/scripts/packaging/* ${BUILD_DIR}/${PACKAGE_NAME}/ | ||
|
||
# For Mac OS and Postgres 16 the module will have .dylib extension | ||
# Instead of .so, so any of the files may not exist | ||
# So we will ignore the error from cp command | ||
cp ${BUILD_DIR}/*.{so,dylib} ${BUILD_DIR}/${PACKAGE_NAME}/src 2>/dev/null || true | ||
cp -r ${BUILD_DIR}/bitcode ${BUILD_DIR}/${PACKAGE_NAME}/src/bitcode 2>/dev/null || true | ||
cp ${BUILD_DIR}/*.sql ${BUILD_DIR}/${PACKAGE_NAME}/src | ||
|
||
for f in $(find "${SOURCE_DIR}/sql/updates/" -name "*.sql"); do | ||
dest_filename=$(echo $f | sed -E 's#(.*)/(.*\.sql)#lantern--\2#g') | ||
cp $f ${BUILD_DIR}/${PACKAGE_NAME}/src/${dest_filename} | ||
done | ||
|
||
cp ${BUILD_DIR}/lantern.control ${BUILD_DIR}/${PACKAGE_NAME}/src | ||
|
||
cd ${BUILD_DIR} && tar cf ${PACKAGE_NAME}.tar ${PACKAGE_NAME} | ||
rm -rf ${BUILD_DIR}/${PACKAGE_NAME} | ||
|
||
## Write output so we can use this in actions and upload artifacts | ||
echo "archive_package_name=${PACKAGE_NAME}.tar" >> "/tmp/gh-output.txt" | ||
echo "archive_package_path=${BUILD_DIR}/${PACKAGE_NAME}.tar" >> "/tmp/gh-output.txt" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.