diff --git a/.github/workflows/publish_indexify.yaml b/.github/workflows/publish_indexify.yaml index 91173db22..ad585fd05 100644 --- a/.github/workflows/publish_indexify.yaml +++ b/.github/workflows/publish_indexify.yaml @@ -27,20 +27,18 @@ jobs: - uses: actions/checkout@v4 - run: rustup toolchain install nightly --component rustfmt - run: cargo +nightly fmt --check - - run: sudo apt update && sudo apt install protobuf-compiler protobuf-compiler-grpc - run: cargo install cargo-deb - - run: make package-ui - - run: cargo build --release - - run: cargo deb --no-build --no-strip + - run: make build-release-ubuntu20.04 + - run: cargo deb --no-build --no-strip --target x86_64-unknown-linux-gnu - uses: actions/upload-artifact@v4 with: name: indexify-linux-amd64 - path: target/release/indexify + path: target/x86_64-unknown-linux-gnu/release/indexify if-no-files-found: error - uses: actions/upload-artifact@v4 with: name: indexify-deb-linux-amd64 - path: target/debian/indexify_*.deb + path: target/x86_64-unknown-linux-gnu/debian/indexify_*.deb if-no-files-found: error build-linux-arm64-package: @@ -50,7 +48,6 @@ jobs: - uses: actions/checkout@v4 - run: rustup toolchain install nightly --component rustfmt - run: cargo +nightly fmt --check - - run: make package-ui - run: make build-release-aarch64 - run: cargo install cargo-deb - run: cargo deb --no-build --no-strip --target aarch64-unknown-linux-gnu diff --git a/Cargo.toml b/Cargo.toml index 87ca6adf2..7963e20e0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "indexify" -version = "0.1.16" +version = "0.1.17" edition = "2021" authors = ["Diptanu Gon Choudhury "] license = "Apache-2.0" diff --git a/Cross.toml b/Cross.toml index e8f29d774..e19cbc118 100644 --- a/Cross.toml +++ b/Cross.toml @@ -7,6 +7,13 @@ pre-build = [ "chown -R 1000:1000 /.npm" ] +[target.x86_64-unknown-linux-gnu] +dockerfile = "dockerfiles/Dockerfile_20.04.cross" +pre-build = [ + "apt-get update && apt-get install --assume-yes build-essential npm curl protobuf-compiler", + "mkdir -p /.npm", + "chown -R 1000:1000 /.npm" +] [build.env] passthrough = [ "PYO3_PYTHON=/usr/bin/python3.11", diff --git a/Makefile b/Makefile index bb9a689c4..83b583623 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,10 @@ build: ## Build rust application build-release: ## Build rust release cargo build --release +build-release-ubuntu20.04: + cargo install cross + cross build --target x86_64-unknown-linux-gnu --release + build-release-aarch64: cargo install cross cross build --target aarch64-unknown-linux-gnu --release @@ -98,4 +102,4 @@ serve-docs: cd docs && pip install -r requirements.txt mkdir -p docs/docs/example_code cp -r examples/* docs/docs/example_code - cd docs && mkdocs serve \ No newline at end of file + cd docs && mkdocs serve diff --git a/dockerfiles/Dockerfile_20.04.cross b/dockerfiles/Dockerfile_20.04.cross new file mode 100644 index 000000000..e6dcfbcdb --- /dev/null +++ b/dockerfiles/Dockerfile_20.04.cross @@ -0,0 +1,22 @@ +FROM --platform=linux/arm64/v8 python:3.11 AS python + +FROM ubuntu:22.04 +ARG DEBIAN_FRONTEND=noninteractive + +RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ + g++-aarch64-linux-gnu \ + libc6-dev-arm64-cross git clang + +ENV CROSS_TOOLCHAIN_PREFIX=aarch64-linux-gnu- +ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER="$CROSS_TOOLCHAIN_PREFIX"gcc \ + AR_aarch64_unknown_linux_gnu="$CROSS_TOOLCHAIN_PREFIX"ar \ + CC_aarch64_unknown_linux_gnu="$CROSS_TOOLCHAIN_PREFIX"gcc \ + CXX_aarch64_unknown_linux_gnu="$CROSS_TOOLCHAIN_PREFIX"g++ \ + RUST_TEST_THREADS=1 \ + PKG_CONFIG_PATH="/usr/lib/aarch64-linux-gnu/pkgconfig/:${PKG_CONFIG_PATH}" + +RUN apt install -y python3.11 python3.11-dev + +COPY --from=python /usr/local/lib/ /opt/sysroot/usr/lib/ + +ENV RUSTFLAGS="-L /opt/sysroot/usr/lib" diff --git a/src/data_manager.rs b/src/data_manager.rs index 9850a8015..b9c4fa08d 100644 --- a/src/data_manager.rs +++ b/src/data_manager.rs @@ -1,7 +1,7 @@ use std::{ - collections::HashMap, + collections::{hash_map::DefaultHasher, HashMap}, fmt, - hash::{DefaultHasher, Hash, Hasher}, + hash::{Hash, Hasher}, str::FromStr, sync::Arc, time::SystemTime,