-
Notifications
You must be signed in to change notification settings - Fork 1
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 #4 from kaarthik108/chore/refractor-incremental-in…
…gest-chromadb chore/refractor-incremental-ingest-chromadb
- Loading branch information
Showing
32 changed files
with
1,385 additions
and
567 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,5 @@ DATABASE= | |
SCHEMA= | ||
ROLE= | ||
|
||
OPENAI_API_KEY= | ||
OPENAI_API_KEY= | ||
LLM_MODEL=gpt-3.5-turbo-16k |
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,94 @@ | ||
name: Deploy to Snowflake | ||
|
||
on: | ||
push: | ||
branches: | ||
- prod | ||
paths: | ||
- "src/**" | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
environment: ${{ github.ref_name }} | ||
|
||
env: | ||
ACCOUNT: ${{ vars.SNOWFLAKE_ACCOUNT }} | ||
USER_NAME: ${{ vars.SNOWFLAKE_USER }} | ||
PASSWORD: ${{ secrets.SNOWFLAKE_PWD }} | ||
ROLE: ${{ vars.SNOWFLAKE_ROLE }} | ||
DATABASE: ${{ vars.SNOWFLAKE_DATABASE }} | ||
SCHEMA: ${{ vars.SNOWFLAKE_SCHEMA }} | ||
WAREHOUSE: ${{ vars.SNOWFLAKE_WAREHOUSE }} | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cache/pypoetry | ||
key: ${{ runner.os }}-poetry-${{ hashFiles('**/pyproject.toml') }} | ||
restore-keys: | | ||
${{ runner.os }}-poetry- | ||
- name: Install Poetry | ||
run: | | ||
curl -sSL https://install.python-poetry.org | python3 - | ||
- name: Install dependencies | ||
run: | | ||
poetry install | ||
- name: Build | ||
run: | | ||
poetry build | ||
- name: Get changed files | ||
id: changed-files | ||
uses: tj-actions/changed-files@v37 | ||
|
||
- name: Deploy to Snowflake | ||
run: | | ||
IFS=$'\n' | ||
for file in ${{ steps.changed-files.outputs.all_modified_files }}; do | ||
# Skip if path is not under src | ||
if [[ $file != src/* ]]; then | ||
continue | ||
fi | ||
# Extract the path relative to src | ||
rel_path="${file#src/}" | ||
component_type=$(echo $rel_path | cut -d'/' -f1) | ||
component_name=$(echo $rel_path | cut -d'/' -f2) | ||
component_path="src/$component_type/$component_name" | ||
# Check if the component directory exists | ||
if [ ! -d "$component_path" ]; then | ||
echo "Directory $component_path does not exist. Skipping..." | ||
continue | ||
fi | ||
echo "Component Type: $component_type" | ||
echo "Component Name: $component_name" | ||
case $component_type in | ||
task) | ||
poetry run snowdev deploy --task $component_name || echo "Failed to deploy task $component_name" | ||
;; | ||
streamlit) | ||
poetry run snowdev deploy --streamlit $component_name || echo "Failed to deploy streamlit $component_name" | ||
;; | ||
udf) | ||
poetry run snowdev deploy --udf $component_name || echo "Failed to deploy udf $component_name" | ||
;; | ||
sproc) | ||
poetry run snowdev deploy --sproc $component_name || echo "Failed to deploy sproc $component_name" | ||
;; | ||
esac | ||
done |
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,57 @@ | ||
# SnowDev CLI Documentation | ||
|
||
SnowDev is a CLI tool designed to deploy Snowflake components such as UDFs, Stored Procedures, Streamlit apps, and tasks. Below is the detailed documentation of all the commands available in the SnowDev CLI. | ||
|
||
## 1. `init` | ||
- **Description**: Initialize the project structure. | ||
- **Usage**: `snowdev init` | ||
|
||
## 2. `new` | ||
- **Description**: Create a new component. | ||
- **Usage**: `snowdev new [OPTIONS]` | ||
- **Options**: | ||
- `--udf <udf_name>`: The name of the UDF. | ||
- `--sproc <sproc_name>`: The name of the stored procedure. | ||
- `--streamlit <streamlit_name>`: The name of the Streamlit app. | ||
- `--task <task_name>`: The name of the task. | ||
|
||
## 3. `test` | ||
- **Description**: Test the deployment. | ||
- **Usage**: `snowdev test [OPTIONS]` | ||
- **Options**: | ||
- `--udf <udf_name>`: The name of the UDF. | ||
- `--sproc <sproc_name>`: The name of the stored procedure. | ||
|
||
## 4. `upload` | ||
- **Description**: Upload static content to stage, only for zipped external packages. | ||
- **Usage**: `snowdev upload` | ||
|
||
## 5. `add` | ||
- **Description**: Add a package and optionally upload. | ||
- **Usage**: `snowdev add --package <package_name>` | ||
|
||
## 6. `ai` | ||
- **Description**: Interact with AI components. Run embeddings or create new AI components. | ||
- **Usage**: `snowdev ai [OPTIONS]` | ||
- **Options**: | ||
- `--udf <udf_name>`: The name of the UDF. | ||
- `--sproc <sproc_name>`: The name of the stored procedure. | ||
- `--streamlit <streamlit_name>`: The name of the Streamlit app. | ||
- `--embed`: Run the embeddings. | ||
- `--task <task_name>`: The name of the task. | ||
|
||
## 7. `deploy` | ||
- **Description**: Deploy components. | ||
- **Usage**: `snowdev deploy [OPTIONS]` | ||
- **Options**: | ||
- `--udf <udf_name>`: The name of the UDF. | ||
- `--sproc <sproc_name>`: The name of the stored procedure. | ||
- `--streamlit <streamlit_name>`: The name of the Streamlit app. | ||
- `--task <task_name>`: The name of the task. | ||
|
||
## 8. `task` | ||
- **Description**: Commands for tasks. Actions: resume, suspend, execute. | ||
- **Usage**: `snowdev task --name <task_name> --action <action>` | ||
- **Options**: | ||
- `--name <task_name>`: The name of the task. (Required) | ||
- `--action <action>`: The action to be performed on the task. Choices: resume, suspend, execute. (Required) |
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 @@ | ||
import any external package here |
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 |
---|---|---|
@@ -1,9 +1,5 @@ | ||
name: snowflake-test | ||
channels: | ||
- snowflake | ||
snowflake: | ||
database: | ||
schema: | ||
role: | ||
dependencies: | ||
- pyyaml | ||
- pyyaml |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.