Skip to content

Commit

Permalink
fix pgrx docker image ubuntu 22.04 aarch64
Browse files Browse the repository at this point in the history
Signed-off-by: Keming <[email protected]>
  • Loading branch information
kemingy committed Nov 4, 2024
1 parent d98106b commit a4656b1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ jobs:
- name: Test
run: |
# pg agnostic tests
docker run --rm -v .:/workspace $PGRX_IMAGE test --no-fail-fast --target $ARCH-unknown-linux-gnu --features pg17
docker run --rm -v .:/workspace $PGRX_IMAGE test --no-fail-fast --target ${{ matrix.arch }}-unknown-linux-gnu --features pg17
2 changes: 1 addition & 1 deletion .taplo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ indent_string = " "
keys = ["dependencies", "*-denpendencies", "lints", "patch.*"]

[rule.formatting]
reorder_keys = false
reorder_keys = true
reorder_arrays = true
align_comments = true

Expand Down
15 changes: 8 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,21 @@ pg16 = ["pgrx/pg16", "pgrx-catalog/pg16"]
pg17 = ["pgrx/pg17", "pgrx-catalog/pg17"]

[dependencies]
paste = "1"
pgrx = { version = "=0.12.8", default-features = false, features = ["cshim"] }
pgrx-catalog = "0.1.0"
rand = "0.8.5"
rand_chacha = "0.3.1"
rand_distr = "0.4.3"
serde = "1"
toml = "0.8.19"
validator = "0.18.1"

base = { git = "https://github.com/tensorchord/pgvecto.rs.git", branch = "rabbithole-2" }
common = { git = "https://github.com/tensorchord/pgvecto.rs.git", branch = "rabbithole-2" }
detect = { git = "https://github.com/tensorchord/pgvecto.rs.git", branch = "rabbithole-2" }
k_means = { git = "https://github.com/tensorchord/pgvecto.rs.git", branch = "rabbithole-2" }
quantization = { git = "https://github.com/tensorchord/pgvecto.rs.git", branch = "rabbithole-2" }
paste = "1"
serde = "1"
toml = "0.8.19"
rand = "0.8.5"
rand_chacha = "0.3.1"
rand_distr = "0.4.3"
validator = "0.18.1"

# lock algebra version forever so that the QR decomposition never changes for same input
nalgebra = { version = "=0.33.0", default-features = false }
Expand Down
8 changes: 6 additions & 2 deletions docker/pgrx.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# CNPG only support Debian 12 (Bookworm)
FROM ubuntu:22.04

ARG PGRX_VERSION=0.12.6
ARG RUSTC_WRAPPER=sccache

ENV DEBIAN_FRONTEND=noninteractive \
LANG=en_US.UTF-8 \
LC_ALL=en_US.UTF-8 \
RUSTC_WRAPPER=${RUSTC_WRAPPER} \
RUSTFLAGS="-Dwarnings"

RUN apt update && \
Expand All @@ -20,12 +19,17 @@ RUN apt update && \
clang && \
rm -rf /var/lib/apt/lists/*

# create a non-root user (make it compatible with Ubuntu 24.04)
RUN useradd -u 1000 -U -m ubuntu
USER ubuntu
ENV PATH="$PATH:/home/ubuntu/.cargo/bin"
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain=none -y

WORKDIR /workspace
COPY rust-toolchain.toml /workspace/rust-toolchain.toml
RUN set -ex; \
echo 'target.aarch64-unknown-linux-gnu.linker = "aarch64-linux-gnu-gcc"' >> ~/.cargo/config.toml; \
echo 'target.aarch64-unknown-linux-gnu.runner = ["qemu-aarch64-static", "-L", "/usr/aarch64-linux-gnu"]' >> ~/.cargo/config.toml
RUN rustup target add x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu

RUN cargo install cargo-pgrx --locked --version=${PGRX_VERSION} && \
Expand Down

0 comments on commit a4656b1

Please sign in to comment.