From 1efa4c8bac1d69a92ff68b5605ba02a077273bc2 Mon Sep 17 00:00:00 2001 From: ChihYu Yeh Date: Thu, 4 Jul 2024 15:25:08 +0800 Subject: [PATCH] update --- wren-ai-service/Makefile | 3 -- wren-ai-service/demo/app.py | 11 ++----- wren-ai-service/demo/utils.py | 31 ------------------- wren-ai-service/tools/dev/.env.example | 2 +- .../tools/dev/config.properties.example | 12 ++----- .../tools/dev/docker-compose-dev.yaml | 1 - wren-ai-service/tools/dev/launch-cli.sh | 2 -- 7 files changed, 6 insertions(+), 56 deletions(-) delete mode 100644 wren-ai-service/tools/dev/launch-cli.sh diff --git a/wren-ai-service/Makefile b/wren-ai-service/Makefile index 7d2decfcd1..e05e6cfbf2 100644 --- a/wren-ai-service/Makefile +++ b/wren-ai-service/Makefile @@ -42,9 +42,6 @@ prepare-wren-engine: mkdir -p tools/dev/etc/mdl echo "{\"catalog\": \"test_catalog\", \"schema\": \"test_schema\", \"models\": []}" \\ > tools/dev/etc/mdl/sample.json - -psql: - docker exec -it wren-engine-1 bash launch-cli.sh ## wren-engine related ## diff --git a/wren-ai-service/demo/app.py b/wren-ai-service/demo/app.py index 82a701332d..97c4e1e2be 100644 --- a/wren-ai-service/demo/app.py +++ b/wren-ai-service/demo/app.py @@ -7,10 +7,8 @@ DATA_SOURCES, ask, ask_details, - get_current_manifest, get_mdl_json, get_new_mdl_json, - is_current_manifest_available, prepare_duckdb, prepare_semantics, rerun_wren_engine, @@ -67,11 +65,7 @@ def onchange_demo_dataset(): col1, col2 = st.columns([2, 4]) with col1: - with st.expander("Current Deployed Model", expanded=True): - manifest_name, models, relationships = get_current_manifest() - st.markdown(f"Current Deployed Model: {manifest_name}") - show_er_diagram(models, relationships) - with st.expander("Deploy New Model"): + with st.expander("Deploy New Model", expanded=True): uploaded_file = st.file_uploader( f"Upload an MDL json file, and the file name must be [xxx]_[datasource]_mdl.json, now we support these datasources: {DATA_SOURCES}", type="json", @@ -163,8 +157,7 @@ def onchange_demo_dataset(): query = st.chat_input( "Ask a question about the database", - disabled=(not is_current_manifest_available()) - and st.session_state["semantics_preparation_status"] != "finished", + disabled=st.session_state["semantics_preparation_status"] != "finished", ) with col2: diff --git a/wren-ai-service/demo/utils.py b/wren-ai-service/demo/utils.py index 6bfd352336..04a24e5b67 100644 --- a/wren-ai-service/demo/utils.py +++ b/wren-ai-service/demo/utils.py @@ -20,37 +20,6 @@ load_dotenv() -def get_current_manifest(): - response = requests.get( - f"{WREN_ENGINE_API_URL}/v1/mdl", - ) - - assert response.status_code == 200 - - manifest = response.json() - - if manifest["schema"] == "test_schema" and manifest["catalog"] == "test_catalog": - return "None", [], [] - - return ( - f"{manifest['catalog']}.{manifest['schema']}", - manifest["models"], - manifest["relationships"], - ) - - -def is_current_manifest_available(): - response = requests.get( - f"{WREN_ENGINE_API_URL}/v1/mdl", - ) - - assert response.status_code == 200 - - manifest = response.json() - - return manifest["catalog"] != "text_catalog" and manifest["schema"] != "test_schema" - - def _update_wren_engine_configs(configs: list[dict]): response = requests.patch( f"{WREN_ENGINE_API_URL}/v1/config", diff --git a/wren-ai-service/tools/dev/.env.example b/wren-ai-service/tools/dev/.env.example index dac8fea551..3986f067ff 100644 --- a/wren-ai-service/tools/dev/.env.example +++ b/wren-ai-service/tools/dev/.env.example @@ -11,7 +11,7 @@ IBIS_SERVER_PORT=8000 # version # CHANGE THIS TO THE LATEST VERSION WREN_PRODUCT_VERSION=development -WREN_ENGINE_VERSION=latest +WREN_ENGINE_VERSION=0.5.0 WREN_AI_SERVICE_VERSION=latest WREN_UI_VERSION=latest IBIS_SERVER_VERSION=latest diff --git a/wren-ai-service/tools/dev/config.properties.example b/wren-ai-service/tools/dev/config.properties.example index b8655af060..b7e5cd7357 100644 --- a/wren-ai-service/tools/dev/config.properties.example +++ b/wren-ai-service/tools/dev/config.properties.example @@ -1,12 +1,6 @@ node.environment=production -pg-wire-protocol.auth.file= -pg-wire-protocol.enabled=true wren.directory=/usr/src/app/etc/mdl wren.experimental-enable-dynamic-fields=false -wren.datasource.type=bigquery -bigquery.project-id=wrenai -bigquery.credentials-key= -bigquery.location=asia-east1 -bigquery.bucket-name= -duckdb.storage.access-key= -duckdb.storage.secret-key= \ No newline at end of file +wren.datasource.type=duckdb +duckdb.connector.init-sql-path= +duckdb.connector.session-sql-path= \ No newline at end of file diff --git a/wren-ai-service/tools/dev/docker-compose-dev.yaml b/wren-ai-service/tools/dev/docker-compose-dev.yaml index eb7178a92a..3a3f0273da 100644 --- a/wren-ai-service/tools/dev/docker-compose-dev.yaml +++ b/wren-ai-service/tools/dev/docker-compose-dev.yaml @@ -17,7 +17,6 @@ services: - ${WREN_ENGINE_PORT}:${WREN_ENGINE_PORT} volumes: - ./etc:/usr/src/app/etc - - ${LAUNCH_CLI_PATH}:/usr/src/app/launch-cli.sh networks: - wren diff --git a/wren-ai-service/tools/dev/launch-cli.sh b/wren-ai-service/tools/dev/launch-cli.sh deleted file mode 100644 index cdd35a7aa4..0000000000 --- a/wren-ai-service/tools/dev/launch-cli.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -psql postgres://localhost:7432/wrenai?options=--search_path%3Dspider \ No newline at end of file