diff --git a/python-minimal/Dockerfile b/python-minimal/Dockerfile index d97e382e..73edf002 100644 --- a/python-minimal/Dockerfile +++ b/python-minimal/Dockerfile @@ -24,7 +24,7 @@ RUN wget -q "https://github.com/conda-forge/miniforge/releases/latest/download/M # Install essential Python packages mamba env update -n base -f conda-env.yml && \ # Install duckdb extensions - mamba run -n base python opt/install-duckdb-extensions.py && \ + mamba run -n base python /opt/install-duckdb-extensions.py && \ # Activate custom Conda env by default in shell echo ". ${MAMBA_DIR}/etc/profile.d/conda.sh && conda activate" >> ${HOME}/.bashrc && \ # Fix permissions diff --git a/r-minimal/Dockerfile b/r-minimal/Dockerfile index 4546a7db..54f0c19f 100644 --- a/r-minimal/Dockerfile +++ b/r-minimal/Dockerfile @@ -47,7 +47,7 @@ RUN /rocker_scripts/setup_R.sh && \ targets \ vaultr && \ # Install duckdb extensions - Rscript opt/install-duckdb-extensions.R && \ + Rscript /opt/install-duckdb-extensions.R && \ # Fix permissions chown -R ${USERNAME}:${GROUPNAME} ${HOME} ${R_HOME} && \ # Clean diff --git a/scripts/configure-duckdb.R b/scripts/configure-duckdb.R deleted file mode 100644 index 3ab962bc..00000000 --- a/scripts/configure-duckdb.R +++ /dev/null @@ -1,3 +0,0 @@ -con <- DBI::dbConnect(duckdb::duckdb()) -DBI::dbExecute(con, 'LOAD httpfs') -DBI::dbExecute(con, glue::glue('SET s3_endpoint=\"{Sys.getenv("AWS_S3_ENDPOINT")}\"')) diff --git a/scripts/configure-duckdb.py b/scripts/configure-duckdb.py deleted file mode 100644 index 91ca9371..00000000 --- a/scripts/configure-duckdb.py +++ /dev/null @@ -1,6 +0,0 @@ -import os - -import duckdb - -duckdb.sql("LOAD httpfs") -duckdb.sql(f"SET s3_endpoint=\"{os.getenv('AWS_S3_ENDPOINT')}\"") diff --git a/scripts/install-duckdb-extensions.R b/scripts/install-duckdb-extensions.R index b08882e1..c37b4d5e 100755 --- a/scripts/install-duckdb-extensions.R +++ b/scripts/install-duckdb-extensions.R @@ -3,3 +3,4 @@ con <- DBI::dbConnect(duckdb::duckdb()) DBI::dbExecute(con, glue::glue('SET extension_directory=\"{Sys.getenv("HOME")}\"')) DBI::dbExecute(con, 'INSTALL httpfs') DBI::dbExecute(con, 'INSTALL aws') +DBI::dbDisconnect(con, shutdown=TRUE) diff --git a/scripts/onyxia-init.sh b/scripts/onyxia-init.sh index c6ed2e8d..bd03f3fd 100644 --- a/scripts/onyxia-init.sh +++ b/scripts/onyxia-init.sh @@ -177,16 +177,6 @@ SET s3_endpoint='$AWS_S3_ENDPOINT'; EOF fi -# Configure duckdb Python API -if [[ -n $AWS_S3_ENDPOINT ]] && command -v python ; then - mamba run -n base python opt/configure-dubkdb.py -fi - -# Configure duckdb R API -if [[ -n $AWS_S3_ENDPOINT ]] && command -v R ; then - Rscript opt/configure-duckdb.R -fi - if [[ -e "$HOME/work" ]]; then if [[ $(id -u) = 0 ]]; then echo "cd $HOME/work" >> /etc/profile