From 04411d82228ce0b9cbd16f78c008dbed99cb8f1c Mon Sep 17 00:00:00 2001 From: Oleksandr Mazur Date: Fri, 14 Nov 2025 09:40:09 +0200 Subject: [PATCH] moved embucket start into run.sh --- .github/workflows/dbt-gitlab-run.yml | 9 ---- test/dbt_integration_tests/dbt-gitlab/run.sh | 22 ++++---- .../dbt-gitlab/upload.py | 51 ------------------- 3 files changed, 13 insertions(+), 69 deletions(-) delete mode 100644 test/dbt_integration_tests/dbt-gitlab/upload.py diff --git a/.github/workflows/dbt-gitlab-run.yml b/.github/workflows/dbt-gitlab-run.yml index 2a80f6e61..9d9ed12fa 100644 --- a/.github/workflows/dbt-gitlab-run.yml +++ b/.github/workflows/dbt-gitlab-run.yml @@ -21,15 +21,6 @@ jobs: with: submodules: true - - name: Start Embucket Server (Docker) - run: | - docker run -d \ - --name embucket-server \ - -p 3000:3000 \ - embucket/embucket - echo "Starting Embucket server..." - sleep 20 - - name: Set up Python uses: actions/setup-python@v6 with: diff --git a/test/dbt_integration_tests/dbt-gitlab/run.sh b/test/dbt_integration_tests/dbt-gitlab/run.sh index cbfd2467f..9285fea06 100755 --- a/test/dbt_integration_tests/dbt-gitlab/run.sh +++ b/test/dbt_integration_tests/dbt-gitlab/run.sh @@ -1,5 +1,18 @@ #!/bin/bash +# Start Embucket container with NO persistent storage +echo "Starting Embucket container with clean environment..." +docker run -d --rm --name em \ + -p 3000:3000 \ + -p 8080:8080 \ + --env OBJECT_STORE_BACKEND=memory \ + --env SLATEDB_PREFIX=memory \ + --env DATA_FORMAT=arrow \ + embucket/embucket-labs >/dev/null 2>&1 + +echo "✓ Embucket container started successfully with CLEAN environment!" +echo "" + # Parse --target and --model arguments while [[ "$#" -gt 0 ]]; do case $1 in @@ -89,15 +102,6 @@ echo "Installing the requirements" pip install -r requirements.txt >/dev/null 2>&1 echo "" -# Load data and create embucket catalog if the embucket is a target -echo "###############################" -echo "" -echo "Creating embucket database" -if [ "$DBT_TARGET" = "embucket" ]; then - $PYTHON_CMD upload.py -fi -echo "" - mkdir -p assets # Run DBT commands diff --git a/test/dbt_integration_tests/dbt-gitlab/upload.py b/test/dbt_integration_tests/dbt-gitlab/upload.py deleted file mode 100644 index 053efd515..000000000 --- a/test/dbt_integration_tests/dbt-gitlab/upload.py +++ /dev/null @@ -1,51 +0,0 @@ -import os - -import snowflake.connector - -url = "http://localhost:3000" -database = "embucket" -schema = "public" - - -def bootstrap(table_name="sample_table"): - cursor = get_cursor() - - # Volume - cursor.execute(f"CREATE EXTERNAL VOLUME IF NOT EXISTS test STORAGE_LOCATIONS = (\ - (NAME = 'file_vol' STORAGE_PROVIDER = 'FILE' STORAGE_BASE_URL = '{os.getcwd()}/data'))") - print(f"Volume 'test' created at '{os.getcwd()}/data' created or already exists.") - - # Database - cursor.execute(f"CREATE DATABASE IF NOT EXISTS {database} EXTERNAL_VOLUME = test") - print(f"Database {database} created or already exists.") - - # Schema - cursor.execute(f"CREATE SCHEMA IF NOT EXISTS {database}.{schema}") - print(f"Schema {database}.{schema} created or already exists.") - - # Sample Table - cursor.execute(f"CREATE TABLE IF NOT EXISTS {database}.{schema}.{table_name} \ - (id INT, name VARCHAR, created_at TIMESTAMP)") - print(f"Sample table {database}.{schema}.{table_name} created or already exists.") - - -def get_cursor(): - con = snowflake.connector.connect( - host=os.getenv("EMBUCKET_HOST", "localhost"), - port=os.getenv("EMBUCKET_PORT", 3000), - protocol=os.getenv("EMBUCKET_PROTOCOL", "http"), - user=os.getenv("EMBUCKET_USER", "embucket"), - password=os.getenv("EMBUCKET_PASSWORD", "embucket"), - account=os.getenv("EMBUCKET_ACCOUNT", "acc"), - warehouse=os.getenv("EMBUCKET_WAREHOUSE", ""), - database=os.getenv("EMBUCKET_DATABASE", database), - schema=os.getenv("EMBUCKET_SCHEMA", schema), - session_parameters={ - "QUERY_TAG": "dbt-testing", - }, - ) - return con.cursor() - - -if __name__ == "__main__": - bootstrap()