Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
cyyeh committed Jul 4, 2024
1 parent ecf64ca commit 1efa4c8
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 56 deletions.
3 changes: 0 additions & 3 deletions wren-ai-service/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 ##


Expand Down
11 changes: 2 additions & 9 deletions wren-ai-service/demo/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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:
Expand Down
31 changes: 0 additions & 31 deletions wren-ai-service/demo/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion wren-ai-service/tools/dev/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 3 additions & 9 deletions wren-ai-service/tools/dev/config.properties.example
Original file line number Diff line number Diff line change
@@ -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=
wren.datasource.type=duckdb
duckdb.connector.init-sql-path=
duckdb.connector.session-sql-path=
1 change: 0 additions & 1 deletion wren-ai-service/tools/dev/docker-compose-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 0 additions & 2 deletions wren-ai-service/tools/dev/launch-cli.sh

This file was deleted.

0 comments on commit 1efa4c8

Please sign in to comment.