Skip to content

Commit

Permalink
Pablo/be 244 duckdb error on nationwide (#293) (#247)
Browse files Browse the repository at this point in the history
* fix(CE): install and load httpfs in duckdb before usage

Co-authored-by: pabss-ai2 <[email protected]>
  • Loading branch information
github-actions[bot] and pabss-ai2 authored Jul 18, 2024
1 parent 48e5052 commit d8749f3
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 4 deletions.
19 changes: 17 additions & 2 deletions server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,30 @@ RUN apt-get update -qq && \
apt-get install --no-install-recommends -y build-essential autoconf automake libtool git libpq-dev libvips pkg-config m4 perl libltdl-dev curl git wget unzip default-libmysqlclient-dev

COPY getduckdb.sh .
# Make the script executable
RUN chmod +x getduckdb.sh
COPY getduckdbcli.sh .

# Make the scripts executable
RUN chmod +x getduckdb.sh getduckdbcli.sh

# Run the scripts
RUN ./getduckdb.sh
RUN ./getduckdbcli.sh

# Unzip and move DuckDB files
RUN unzip duckdb.zip -d libduckdb
RUN mv libduckdb/duckdb.* /usr/local/include
RUN mv libduckdb/libduckdb.so /usr/local/lib
RUN ldconfig /usr/local/lib

# Download and install the DuckDB CLI
RUN unzip duckdb_cli.zip -d duckdb_cli
RUN mv duckdb_cli/duckdb /usr/local/bin/
RUN chmod +x /usr/local/bin/duckdb

RUN ldconfig /usr/local/lib
# Load the httpfs extension into DuckDB
RUN echo "INSTALL httpfs; LOAD httpfs;" | duckdb

# # Navigate to the directory of the component you want to build
WORKDIR /

Expand Down
16 changes: 14 additions & 2 deletions server/Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,27 @@ RUN apt-get update -qq && \
apt-get install --no-install-recommends -y build-essential autoconf automake libtool git libpq-dev libvips pkg-config m4 perl libltdl-dev curl git wget unzip default-libmysqlclient-dev

COPY getduckdb.sh .
COPY getduckdbcli.sh .

# Make the script executable
RUN chmod +x getduckdb.sh
RUN chmod +x getduckdb.sh getduckdbcli.sh

RUN ./getduckdb.sh
RUN ./getduckdbcli.sh

# Unzip and move DuckDB files
RUN unzip duckdb.zip -d libduckdb
RUN mv libduckdb/duckdb.* /usr/local/include
RUN mv libduckdb/libduckdb.so /usr/local/lib
RUN ldconfig /usr/local/lib

# Download and install the DuckDB CLI
RUN unzip duckdb_cli.zip -d duckdb_cli
RUN mv duckdb_cli/duckdb /usr/local/bin/
RUN chmod +x /usr/local/bin/duckdb

RUN ldconfig /usr/local/lib
# Load the httpfs extension into DuckDB
RUN echo "INSTALL httpfs; LOAD httpfs;" | duckdb

WORKDIR /rails

Expand Down
10 changes: 10 additions & 0 deletions server/getduckdbcli.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

MACHINE=`uname -m`

case "$MACHINE" in
"x86_64" ) ARC=amd64 ;;
"aarch64" ) ARC=aarch64 ;;
esac

wget -O duckdb_cli.zip "https://github.com/duckdb/duckdb/releases/download/v1.0.0/duckdb_cli-linux-$ARC.zip"

0 comments on commit d8749f3

Please sign in to comment.