Skip to content

Commit 2181716

Browse files
Merge pull request #121 from Intugle/cleanup/streamlit-integration
2 parents 82d6dde + 910f4ab commit 2181716

File tree

5 files changed

+139
-11
lines changed

5 files changed

+139
-11
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ For a detailed, hands-on introduction to the project, please see our quickstart
106106
| **Snowflake Horizon Catalog [ FMCG ]** | [`quickstart_fmcg_snowflake.ipynb`](notebooks/quickstart_fmcg_snowflake.ipynb) | Snowflake Notebook Only |
107107
| **Native Snowflake with Cortex Analyst [ Tech Manufacturing ]** | [`quickstart_native_snowflake.ipynb`](notebooks/quickstart_native_snowflake.ipynb) | [![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Intugle/data-tools/blob/main/notebooks/quickstart_native_snowflake.ipynb) |
108108
| **Native Databricks with AI/BI Genie [ Tech Manufacturing ]** | [`quickstart_native_databricks.ipynb`](notebooks/quickstart_native_databricks.ipynb) | [![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Intugle/data-tools/blob/main/notebooks/quickstart_native_databricks.ipynb) |
109+
| **Streamlit App** | [`quickstart_streamlit.ipynb`](notebooks/quickstart_streamlit.ipynb) | [![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Intugle/data-tools/blob/main/notebooks/quickstart_streamlit.ipynb) |
109110

110111
These datasets will take you through the following steps:
111112

@@ -290,11 +291,13 @@ You can launch the Streamlit application using the `intugle-mcp` command or `uvx
290291
```bash
291292
intugle-streamlit
292293
# Or using uvx
293-
uvx --from intugle intugle-streamlit
294+
uvx --from intugle[streamlit] intugle-streamlit
294295
```
295296

296297
Open the URL provided in your terminal (usually `http://localhost:8501`) to access the application. For more details, refer to the [Streamlit App documentation](https://intugle.github.io/data-tools/docs/streamlit-app).
297298

299+
To run the app in a cloud environment like Google Colab, please refer to our [Streamlit quickstart notebook](notebooks/quickstart_streamlit.ipynb).
300+
298301
## Community
299302

300303
Join our community to ask questions, share your projects, and connect with other users.

docsite/docs/examples.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ For a detailed, hands-on introduction to the project, please see our quickstart
1717
| **Snowflake Horizon Catalog [ FMCG ]** | [`quickstart_fmcg_snowflake.ipynb`](https://github.com/Intugle/data-tools/blob/main/notebooks/quickstart_fmcg_snowflake.ipynb) | Snowflake Notebook Only |
1818
| **Native Snowflake with Cortex Analyst [ Tech Manufacturing ]** | [`quickstart_native_snowflake.ipynb`](https://github.com/Intugle/data-tools/blob/main/notebooks/quickstart_native_snowflake.ipynb) | [![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Intugle/data-tools/blob/main/notebooks/quickstart_native_snowflake.ipynb) |
1919
| **Native Databricks with AI/BI Genie [ Tech Manufacturing ]** | [`quickstart_native_databricks.ipynb`](https://github.com/Intugle/data-tools/blob/main/notebooks/quickstart_native_databricks.ipynb) | [![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Intugle/data-tools/blob/main/notebooks/quickstart_native_databricks.ipynb) |
20+
| **Streamlit App** | [`quickstart_streamlit.ipynb`](https://github.com/Intugle/data-tools/blob/main/notebooks/quickstart_streamlit.ipynb) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Intugle/data-tools/blob/main/notebooks/quickstart_streamlit.ipynb) |
2021

2122
These datasets will take you through the following steps:
2223

docsite/docs/streamlit-app.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ You can launch the Streamlit application using the `intugle-streamlit` command o
4949
```bash
5050
intugle-streamlit
5151
# Or using uvx
52-
uvx --from intugle intugle-streamlit
52+
uvx --from intugle[streamlit] intugle-streamlit
5353
```
5454

5555
Open the URL provided in your terminal (usually `http://localhost:8501`) to access the application.
@@ -64,3 +64,9 @@ The application guides you through a simple, multi-step process, which is tracke
6464
4. **Build Semantic Model**: After preparing your data, click **"Create Semantic Model"**. You will be prompted to provide a "domain" (e.g., *Healthcare*, *Manufacturing*) to give the LLM context. The app will then profile the data and generate a business glossary for each table.
6565
5. **Predict Links**: Once profiling is complete, click **"Run Link Prediction"** to discover the relationships between your datasets.
6666
6. **Explore & Download**: View the results as an interactive graph or a detailed table. You can download the underlying YAML configuration files from the sidebar at any time.
67+
68+
## Running on Google Colab
69+
70+
To run the Streamlit app in a cloud environment like Google Colab, which requires exposing the server via a public URL, please refer to our quickstart notebook:
71+
72+
- [**Streamlit Quickstart Notebook**](https://github.com/Intugle/data-tools/blob/main/notebooks/quickstart_streamlit.ipynb)
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"id": "5a6f5a26",
6+
"metadata": {},
7+
"source": [
8+
"# Running the Intugle Streamlit App on Google Colab\n",
9+
"\n",
10+
"This notebook guides you through the process of running the Intugle semantic model builder, which is a Streamlit application, directly within a Google Colab environment.\n",
11+
"\n",
12+
"Since Colab provides a containerized environment, we cannot directly access the web server started by Streamlit. To solve this, we will use `ngrok`, a tool that creates a secure public URL (a \"tunnel\") to the Streamlit application running inside our Colab instance.\n",
13+
"\n",
14+
"**Steps:**\n",
15+
"\n",
16+
"1. **Install** the required Python packages.\n",
17+
"2. **Configure and run `ngrok`** to expose the Streamlit app.\n",
18+
"3. **Shut down** the tunnel when you are finished."
19+
]
20+
},
21+
{
22+
"cell_type": "markdown",
23+
"id": "c20194c1",
24+
"metadata": {},
25+
"source": [
26+
"## 1. Install Dependencies\n",
27+
"\n",
28+
"First, we need to install the `intugle` library. We use the `[streamlit]` extra, which ensures that Streamlit and all other necessary dependencies for the web app are installed at the same time."
29+
]
30+
},
31+
{
32+
"cell_type": "code",
33+
"execution_count": null,
34+
"id": "b26de4ff",
35+
"metadata": {},
36+
"outputs": [],
37+
"source": [
38+
"!pip install intugle[streamlit]"
39+
]
40+
},
41+
{
42+
"cell_type": "markdown",
43+
"id": "df8720f3",
44+
"metadata": {},
45+
"source": [
46+
"## 2. Configure and Run the Streamlit App\n",
47+
"\n",
48+
"Next, we will start the Intugle Streamlit app and expose it to the web using `ngrok`.\n",
49+
"\n",
50+
"**Important:** You need a free `ngrok` authentication token for this step.\n",
51+
"\n",
52+
"1. Go to the [ngrok Dashboard](https://dashboard.ngrok.com/get-started/your-authtoken) and sign up for a free account.\n",
53+
"2. Copy your authentication token.\n",
54+
"3. Paste the token into the `PYNGROK_TOKEN` variable in the code block below, replacing `<your-key>`.\n",
55+
"\n",
56+
"The script will then:\n",
57+
"1. Set your `ngrok` auth token.\n",
58+
"2. Start the Intugle Streamlit server in the background on its default port (`8501`).\n",
59+
"3. Create a secure public URL that tunnels traffic to the Streamlit server.\n",
60+
"\n",
61+
"Once you run the cell, click the public URL that is printed to access the application in your browser.\n"
62+
]
63+
},
64+
{
65+
"cell_type": "code",
66+
"execution_count": null,
67+
"id": "4564ff48",
68+
"metadata": {},
69+
"outputs": [],
70+
"source": [
71+
"from pyngrok import ngrok\n",
72+
"\n",
73+
"# TODO: Replace <your-key> with your actual ngrok authentication token.\n",
74+
"# You can get a free token from https://dashboard.ngrok.com/get-started/your-authtoken\n",
75+
"PYNGROK_TOKEN = \"<your-key>\"\n",
76+
"\n",
77+
"# Set authentication token\n",
78+
"ngrok.set_auth_token(PYNGROK_TOKEN)\n",
79+
"\n",
80+
"# Start the Intugle Streamlit server in the background on port 8501\n",
81+
"# The `nohup` command ensures it keeps running, and `&` runs it as a background process.\n",
82+
"!nohup intugle-streamlit &\n",
83+
"\n",
84+
"# Start an ngrok tunnel to expose the Streamlit server\n",
85+
"# This connects to the default Streamlit port (8501)\n",
86+
"ngrok_tunnel = ngrok.connect(addr='8501', proto='http', bind_tls=True)\n",
87+
"\n",
88+
"# Print the public URL to access the app\n",
89+
"print(' * Tunnel URL:', ngrok_tunnel.public_url)"
90+
]
91+
},
92+
{
93+
"cell_type": "markdown",
94+
"id": "808123d4",
95+
"metadata": {},
96+
"source": [
97+
"## 3. Shut Down the Tunnel\n",
98+
"\n",
99+
"When you are finished using the application, it is good practice to close the `ngrok` tunnel to release the resources. The following script will find all active tunnels and disconnect them.\n"
100+
]
101+
},
102+
{
103+
"cell_type": "code",
104+
"execution_count": null,
105+
"id": "4fb8abf7",
106+
"metadata": {},
107+
"outputs": [],
108+
"source": [
109+
"# Close all active tunnels\n",
110+
"from pyngrok import ngrok\n",
111+
"\n",
112+
"active_tunnels = ngrok.get_tunnels()\n",
113+
"for tunnel in active_tunnels:\n",
114+
" ngrok.disconnect(tunnel.public_url)\n",
115+
" print(f\"Closed tunnel: {tunnel.public_url}\")\n"
116+
]
117+
}
118+
],
119+
"metadata": {
120+
"language_info": {
121+
"name": "python"
122+
}
123+
},
124+
"nbformat": 4,
125+
"nbformat_minor": 5
126+
}

src/intugle/streamlit_app/.streamlit/config.toml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,4 @@ primaryColor = "#8B5CF6"
55
backgroundColor = "#ffffff"
66
secondaryBackgroundColor = "#F7F5FF"
77
textColor = "#111827"
8-
font = "sans serif"
9-
10-
[smtp]
11-
host = "smtp.gmail.com"
12-
port = 465
13-
username = "[email protected]"
14-
password = "1234"
15-
from_email = "[email protected]"
16-
from_name = "Intugle Bot"
8+
font = "sans serif"

0 commit comments

Comments
 (0)