MotherDuck-Open-Source / metabase_duckdb_driver

Metabase DuckDB Driver shipped as 3rd party plugin
Apache License 2.0
45 stars 5 forks source link

Docker setup and connection #7

Open sugendran opened 3 months ago

sugendran commented 3 months ago

Dropping some notes while it's fresh. Had to do the following to get a working container (dockerfile below). Also had to use the SaaS connection string (https://motherduck.com/docs/key-tasks/authenticating-to-motherduck/#syntax) for connecting to motherduck. Don't enter the token in the field that renders on the screen because it complains about not understanding how to use it

Dockerfile

FROM eclipse-temurin:11-jre-jammy

# not using the default metabase image because of duckdb and glibc compatibility
# https://github.com/metabase/metabase/blob/master/bin/docker/

# dependencies
RUN apt-get update && \
    apt-get install -y bash fontconfig curl fonts-noto fonts-noto-cjk ca-certificates-java && \
    mkdir -p /app/certs && \
    curl https://truststore.pki.rds.amazonaws.com/global/global-bundle.pem -o /app/certs/rds-combined-ca-bundle.pem  && \
    keytool -noprompt -import -trustcacerts -alias aws-rds -file /app/certs/rds-combined-ca-bundle.pem -keystore /etc/ssl/certs/java/cacerts -keypass changeit -storepass changeit && \
    curl https://cacerts.digicert.com/DigiCertGlobalRootG2.crt.pem -o /app/certs/DigiCertGlobalRootG2.crt.pem  && \
    keytool -noprompt -import -trustcacerts -alias azure-cert -file /app/certs/DigiCertGlobalRootG2.crt.pem -keystore /etc/ssl/certs/java/cacerts -keypass changeit -storepass changeit && \
    mkdir -p /plugins && chmod a+rwx /plugins

ENV MB_PLUGINS_DIR=/plugins/

ADD https://downloads.metabase.com/v0.50.4/metabase.jar /app
ADD https://github.com/MotherDuck-Open-Source/metabase_duckdb_driver/releases/download/0.2.7/duckdb.metabase-driver.jar /plugins/
RUN chmod 744 /plugins/duckdb.metabase-driver.jar

COPY ./run_metabase.sh /app/

# expose our default runtime port
EXPOSE 3000

ENTRYPOINT ["/app/run_metabase.sh"]
guenp commented 3 months ago

Thanks so much for sharing this! I tried it out and it works. I was able to use the md:my_db string without using saas_mode, and passing the token also works without errors.

hrl20 commented 3 months ago

Hi @sugendran, a new version of the connector has been released. If the token field still doesn't work, do you mind sharing the error message?

sugendran commented 3 months ago

Good news. It worked, no errors.

sugendran commented 3 months ago

One other thing would be to have it refresh the schema on demand. I press the button in the admin interface but it doesn't refetch the schema

sugendran commented 3 months ago

Correction.. i had to hard refresh.. maybe some heavy caching on metabase

wj-c commented 1 week ago

One other thing would be to have it refresh the schema on demand. I press the button in the admin interface but it doesn't refetch the schema

The scheme doesn't update itself