-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #220 from Snowflake-Labs/tzayats/update-readme-sis
[Customer-Eval] Make changes to work in Sis
- Loading branch information
Showing
4 changed files
with
143 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
SET (streamlit_warehouse)=(SELECT CURRENT_WAREHOUSE()); | ||
|
||
CREATE DATABASE IF NOT EXISTS CORTEX_ANALYST_SEMANTICS_EVAL | ||
COMMENT = '{"origin": "sf_sit", | ||
"name": "skimantics", | ||
"version": {"major": 2, "minor": 0}, | ||
"attributes": {"deployment": "sis"}}'; | ||
|
||
CREATE SCHEMA IF NOT EXISTS CORTEX_ANALYST_SEMANTICS_EVAL.SEMANTIC_MODEL_GENERATOR | ||
COMMENT = '{"origin": "sf_sit", | ||
"name": "skimantics", | ||
"version": {"major": 2, "minor": 0}, | ||
"attributes": {"deployment": "sis"}}'; | ||
|
||
-- Create stage for App logic and 3rd party packages | ||
CREATE OR REPLACE STAGE CORTEX_ANALYST_SEMANTICS_EVAL.SEMANTIC_MODEL_GENERATOR.STREAMLIT_STAGE | ||
DIRECTORY = (ENABLE = true) | ||
COMMENT = '{"origin": "sf_sit", | ||
"name": "skimantics", | ||
"version": {"major": 2, "minor": 0}, | ||
"attributes": {"deployment": "sis"}}'; | ||
|
||
-- Upload 3rd party packages | ||
-- Run from sis_setup/ as paths are relative to this directory | ||
PUT file://app_utils/*.zip @CORTEX_ANALYST_SEMANTICS_EVAL.SEMANTIC_MODEL_GENERATOR.STREAMLIT_STAGE OVERWRITE = TRUE AUTO_COMPRESS = FALSE; | ||
-- Upload App logic | ||
PUT file://app.py @CORTEX_ANALYST_SEMANTICS_EVAL.SEMANTIC_MODEL_GENERATOR.STREAMLIT_STAGE/semantic_model_generator/ OVERWRITE = TRUE AUTO_COMPRESS = FALSE; | ||
PUT file://environment.yml @CORTEX_ANALYST_SEMANTICS_EVAL.SEMANTIC_MODEL_GENERATOR.STREAMLIT_STAGE/semantic_model_generator/ OVERWRITE = TRUE AUTO_COMPRESS = FALSE; | ||
PUT file://semantic_model_generator/*.py @CORTEX_ANALYST_SEMANTICS_EVAL.SEMANTIC_MODEL_GENERATOR.STREAMLIT_STAGE/semantic_model_generator/semantic_model_generator/ OVERWRITE = TRUE AUTO_COMPRESS = FALSE; | ||
PUT file://semantic_model_generator/data_processing/*.py @CORTEX_ANALYST_SEMANTICS_EVAL.SEMANTIC_MODEL_GENERATOR.STREAMLIT_STAGE/semantic_model_generator/semantic_model_generator/data_processing/ OVERWRITE = TRUE AUTO_COMPRESS = FALSE; | ||
PUT file://semantic_model_generator/protos/*.p* @CORTEX_ANALYST_SEMANTICS_EVAL.SEMANTIC_MODEL_GENERATOR.STREAMLIT_STAGE/semantic_model_generator/semantic_model_generator/protos/ OVERWRITE = TRUE AUTO_COMPRESS = FALSE; | ||
PUT file://semantic_model_generator/snowflake_utils/*.py @CORTEX_ANALYST_SEMANTICS_EVAL.SEMANTIC_MODEL_GENERATOR.STREAMLIT_STAGE/semantic_model_generator/semantic_model_generator/snowflake_utils/ OVERWRITE = TRUE AUTO_COMPRESS = FALSE; | ||
PUT file://semantic_model_generator/validate/*.py @CORTEX_ANALYST_SEMANTICS_EVAL.SEMANTIC_MODEL_GENERATOR.STREAMLIT_STAGE/semantic_model_generator/semantic_model_generator/validate/ OVERWRITE = TRUE AUTO_COMPRESS = FALSE; | ||
PUT file://images/*.png @CORTEX_ANALYST_SEMANTICS_EVAL.SEMANTIC_MODEL_GENERATOR.STREAMLIT_STAGE/semantic_model_generator/images/ OVERWRITE = TRUE AUTO_COMPRESS = FALSE; | ||
PUT file://journeys/*.py @CORTEX_ANALYST_SEMANTICS_EVAL.SEMANTIC_MODEL_GENERATOR.STREAMLIT_STAGE/semantic_model_generator/journeys/ OVERWRITE = TRUE AUTO_COMPRESS = FALSE; | ||
PUT file://partner/*.py @CORTEX_ANALYST_SEMANTICS_EVAL.SEMANTIC_MODEL_GENERATOR.STREAMLIT_STAGE/semantic_model_generator/partner/ OVERWRITE = TRUE AUTO_COMPRESS = FALSE; | ||
PUT file://app_utils/*.py @CORTEX_ANALYST_SEMANTICS_EVAL.SEMANTIC_MODEL_GENERATOR.STREAMLIT_STAGE/semantic_model_generator/app_utils/ OVERWRITE = TRUE AUTO_COMPRESS = FALSE; | ||
-- Create Streamlit | ||
CREATE OR REPLACE STREAMLIT CORTEX_ANALYST_SEMANTICS_EVAL.SEMANTIC_MODEL_GENERATOR.SEMANTIC_MODEL_GENERATOR | ||
ROOT_LOCATION = '@CORTEX_ANALYST_SEMANTICS_EVAL.SEMANTIC_MODEL_GENERATOR.STREAMLIT_STAGE/semantic_model_generator' | ||
MAIN_FILE = 'app.py' | ||
TITLE = "Semantic Model Generator (Eval)" | ||
IMPORTS = ('@cortex_analyst_semantics_eval.semantic_model_generator.streamlit_stage/looker_sdk.zip', | ||
'@cortex_analyst_semantics_eval.semantic_model_generator.streamlit_stage/strictyaml.zip') | ||
QUERY_WAREHOUSE = $streamlit_warehouse | ||
COMMENT = '{"origin": "sf_sit", | ||
"name": "skimantics", | ||
"version": {"major": 2, "minor": 0}, | ||
"attributes": {"deployment": "sis"}}'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
SET (streamlit_warehouse)=(SELECT CURRENT_WAREHOUSE()); | ||
|
||
CREATE DATABASE IF NOT EXISTS CORTEX_ANALYST_SEMANTICS_EVAL; | ||
USE DATABASE CORTEX_ANALYST_SEMANTICS_EVAL; | ||
|
||
-- Create API Integration for Git | ||
CREATE OR REPLACE API INTEGRATION git_api_integration_snowflake_labs | ||
API_PROVIDER = git_https_api | ||
API_ALLOWED_PREFIXES = ('https://github.com/Snowflake-Labs') | ||
ENABLED = TRUE; | ||
|
||
-- Create Git Repository | ||
CREATE OR REPLACE GIT REPOSITORY git_snowflake_semantic_model_generator | ||
API_INTEGRATION = git_api_integration_snowflake_labs | ||
ORIGIN = 'https://github.com/Snowflake-Labs/semantic-model-generator.git'; | ||
|
||
ALTER GIT REPOSITORY git_snowflake_semantic_model_generator FETCH; | ||
|
||
-- Create Schema to host streamlit app | ||
CREATE SCHEMA IF NOT EXISTS CORTEX_ANALYST_SEMANTICS_EVAL.SEMANTIC_MODEL_GENERATOR | ||
COMMENT = '{"origin": "sf_sit", | ||
"name": "skimantics", | ||
"version": {"major": 2, "minor": 0}, | ||
"attributes": {"deployment": "sis"}}'; | ||
|
||
|
||
-- Create stage for App logic and 3rd party packages | ||
CREATE OR REPLACE STAGE CORTEX_ANALYST_SEMANTICS_EVAL.SEMANTIC_MODEL_GENERATOR.STREAMLIT_STAGE | ||
DIRECTORY = (ENABLE = true) | ||
COMMENT = '{"origin": "sf_sit", | ||
"name": "skimantics", | ||
"version": {"major": 2, "minor": 0}, | ||
"attributes": {"deployment": "sis"}}'; | ||
|
||
-- Copy Files from Git Repository into App Stage | ||
COPY FILES | ||
INTO @CORTEX_ANALYST_SEMANTICS_EVAL.SEMANTIC_MODEL_GENERATOR.STREAMLIT_STAGE | ||
FROM @CORTEX_ANALYST_SEMANTICS_EVAL.PUBLIC.git_snowflake_semantic_model_generator/branches/customer-eval/app_utils/ | ||
PATTERN='.*[.]zip'; | ||
|
||
COPY FILES | ||
INTO @CORTEX_ANALYST_SEMANTICS_EVAL.SEMANTIC_MODEL_GENERATOR.STREAMLIT_STAGE/semantic_model_generator/ | ||
FROM @CORTEX_ANALYST_SEMANTICS_EVAL.PUBLIC.git_snowflake_semantic_model_generator/branches/customer-eval/ | ||
FILES = ('environment.yml', 'app.py'); | ||
|
||
COPY FILES | ||
INTO @CORTEX_ANALYST_SEMANTICS_EVAL.SEMANTIC_MODEL_GENERATOR.STREAMLIT_STAGE/semantic_model_generator/semantic_model_generator/ | ||
FROM @CORTEX_ANALYST_SEMANTICS_EVAL.PUBLIC.git_snowflake_semantic_model_generator/branches/customer-eval/semantic_model_generator/ | ||
PATTERN='.*[.]py'; | ||
|
||
RM @CORTEX_ANALYST_SEMANTICS_EVAL.SEMANTIC_MODEL_GENERATOR.STREAMLIT_STAGE/semantic_model_generator/semantic_model_generator/tests; | ||
RM @CORTEX_ANALYST_SEMANTICS_EVAL.SEMANTIC_MODEL_GENERATOR.STREAMLIT_STAGE/semantic_model_generator/semantic_model_generator/output_models; | ||
|
||
COPY FILES | ||
INTO @CORTEX_ANALYST_SEMANTICS_EVAL.SEMANTIC_MODEL_GENERATOR.STREAMLIT_STAGE/semantic_model_generator/images/ | ||
FROM @CORTEX_ANALYST_SEMANTICS_EVAL.PUBLIC.git_snowflake_semantic_model_generator/branches/customer-eval/images/ | ||
PATTERN='.*[.]png'; | ||
|
||
COPY FILES | ||
INTO @CORTEX_ANALYST_SEMANTICS_EVAL.SEMANTIC_MODEL_GENERATOR.STREAMLIT_STAGE/semantic_model_generator/journeys/ | ||
FROM @CORTEX_ANALYST_SEMANTICS_EVAL.PUBLIC.git_snowflake_semantic_model_generator/branches/customer-eval/journeys/ | ||
PATTERN='.*[.]py'; | ||
|
||
COPY FILES | ||
INTO @CORTEX_ANALYST_SEMANTICS_EVAL.SEMANTIC_MODEL_GENERATOR.STREAMLIT_STAGE/semantic_model_generator/partner/ | ||
FROM @CORTEX_ANALYST_SEMANTICS_EVAL.PUBLIC.git_snowflake_semantic_model_generator/branches/customer-eval/partner/ | ||
PATTERN='.*[.]py'; | ||
|
||
COPY FILES | ||
INTO @CORTEX_ANALYST_SEMANTICS_EVAL.SEMANTIC_MODEL_GENERATOR.STREAMLIT_STAGE/semantic_model_generator/app_utils/ | ||
FROM @CORTEX_ANALYST_SEMANTICS_EVAL.PUBLIC.git_snowflake_semantic_model_generator/branches/customer-eval/app_utils/ | ||
PATTERN='.*[.]py'; | ||
|
||
-- Create Streamlit App | ||
CREATE OR REPLACE STREAMLIT CORTEX_ANALYST_SEMANTICS_EVAL.SEMANTIC_MODEL_GENERATOR.SEMANTIC_MODEL_GENERATOR | ||
ROOT_LOCATION = '@CORTEX_ANALYST_SEMANTICS_EVAL.SEMANTIC_MODEL_GENERATOR.STREAMLIT_STAGE/semantic_model_generator' | ||
MAIN_FILE = 'app.py' | ||
TITLE = "Semantic Model Generator (with Eval)" | ||
IMPORTS = ('@cortex_analyst_semantics_eval.semantic_model_generator.streamlit_stage/looker_sdk.zip', | ||
'@cortex_analyst_semantics_eval.semantic_model_generator.streamlit_stage/strictyaml.zip') | ||
QUERY_WAREHOUSE = $streamlit_warehouse | ||
COMMENT = '{"origin": "sf_sit", | ||
"name": "skimantics", | ||
"version": {"major": 2, "minor": 0}, | ||
"attributes": {"deployment": "sis"}}'; |