You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+29-54Lines changed: 29 additions & 54 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
This is an extension or plugin for Looker that integrates LLM's hosted on Vertex AI into a streaming dashboard summarization experience powered by Websockets.
This section describes how to set up the web server on Cloud Run powering the Generative AI and Websocket integrations
53
+
This section describes how to set up the API server on Cloud Run powering the Generative AI integrations.
57
54
58
55
#### Getting Started for Local Development
59
56
@@ -67,7 +64,7 @@ This section describes how to set up the web server on Cloud Run powering the Ge
67
64
2. Navigate (`cd`) to the template directory on your system
68
65
69
66
```bash
70
-
cd dashboard-summarization/websocket-service/src
67
+
cd dashboard-summarization/restful-service/src
71
68
```
72
69
73
70
3. Install the dependencies with [NPM](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm).
@@ -78,20 +75,7 @@ This section describes how to set up the web server on Cloud Run powering the Ge
78
75
79
76
> You may need to update your Node version or use a [Node version manager](https://github.com/nvm-sh/nvm) to change your Node version.
80
77
81
-
4. Update `looker-example.ini` to `looker.ini` and replace environment variables Admin API Credentials. **IMPORTANT** use a section header that matches the host of your Looker instance. Example below:
client_id=<From your looker user's api credentials>
88
-
client_secret=<From your looker user's api credentials>
89
-
verify_ssl=true
90
-
```
91
-
92
-
This is configured to support deployment to multiple Looker instances reusing the same backend.
93
-
94
-
5. Start the development server
78
+
4. Start the development server
95
79
96
80
```bash
97
81
npm run start
@@ -107,47 +91,35 @@ This is configured to support deployment to multiple Looker instances reusing th
107
91
108
92
2. Navigate to template directory
109
93
```bash
110
-
cd dashboard-summarization/websocket-service/src
94
+
cd dashboard-summarization/restful-service/src
111
95
```
112
96
113
-
3. Update `looker-example.ini` to `looker.ini` and replace environment variables Admin API Credentials. **IMPORTANT** use a section header that matches the host of your Looker instance. Example below:
client_id=<From your looker user's api credentials>
120
-
client_secret=<From your looker user's api credentials>
121
-
verify_ssl=true
122
-
```
123
-
124
-
This is configured to support deployment to multiple Looker instances reusing the same backend.
125
-
126
-
4. Update cloudbuild.yaml
97
+
3. Update cloudbuild.yaml
127
98
```
128
99
<YOUR_REGION> = Your deployment region
129
100
<YOUR_PROJECT_ID> = Your GCP project ID
130
101
```
131
102
132
-
5. Build Docker File and Submit to Artifact Registry, replacing the `REGION` variable with your deployment region.
103
+
4. Build Docker File and Submit to Artifact Registry, replacing the `REGION` variable with your deployment region.
133
104
*Skip this step if you already have a deployed image.* Please see the [official docs](https://cloud.google.com/build/docs/configuring-builds/create-basic-configuration) for creating the yaml file.
8. Deploy resources. [*Ensure Application Default Credentials for GCP for Exported in your Environment first.*](https://cloud.google.com/docs/authentication/provide-credentials-adc#google-idp)
122
+
7. Deploy resources. [*Ensure Application Default Credentials for GCP for Exported in your Environment first.*](https://cloud.google.com/docs/authentication/provide-credentials-adc#google-idp)
151
123
152
124
```terraform
153
125
terraform init
@@ -157,7 +129,7 @@ This is configured to support deployment to multiple Looker instances reusing th
157
129
terraform apply
158
130
```
159
131
160
-
9. Save Deployed Cloud Run URL Endpoint
132
+
8. Save Deployed Cloud Run URL Endpoint
161
133
162
134
#### Optional: Setup Log Sink to BQ for LLM Cost Estimation and Request Logging
163
135
@@ -166,7 +138,7 @@ estimate and monitor costs. Please see [Google Cloud's docs](https://cloud.googl
2. Navigate (`cd`) to the root directory in the cloned repo
189
161
190
162
3. Ensure All the Appropriate Environment Variables are set. Copy .env.example file and save as .env
191
-
*See Export Integration Steps below for Slack and Gchat Variables. These are optional, except WEBSOCKET_SERVICE*
163
+
*See Export Integration Steps below for Slack and Gchat Variables. These are optional, except RESTFUL_SERVICE & GENAI_CLIENT_SECRET*. To Note, the GenAI Client Secret will be used as an environment variable only in development. When you deploy the extension to production, you'll need to save it as a user attribute in Looker with a specific format. This is so that the secret is secured and not evaluated client side. More instructions on this in the `Deployment` instructions further down.
192
164
```
193
165
SLACK_CLIENT_ID=
194
166
SLACK_CLIENT_SECRET=
195
167
CHANNEL_ID=
196
168
SPACE_ID=
197
-
WEBSOCKET_SERVICE=<Required: Cloud run endpoint url>
169
+
RESTFUL_SERVICE=<Required: Cloud run endpoint url>
170
+
GENAI_CLIENT_SECRET=<same secret value used to secure Cloud Run service>
198
171
```
199
172
200
173
4. Install the dependencies with [NPM](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm).
@@ -215,7 +188,7 @@ WEBSOCKET_SERVICE=<Required: Cloud run endpoint url>
215
188
npm run develop
216
189
```
217
190
218
-
Great! Your extension is now running and serving the JavaScript at http://localhost:8080/bundle.js.
191
+
Great! Your extension is now running and serving the JavaScript at https://localhost:3000/dashboard_summarization.js.
219
192
220
193
6. Now log in to Looker and create a new project.
221
194
@@ -233,8 +206,8 @@ WEBSOCKET_SERVICE=<Required: Cloud run endpoint url>
@@ -275,7 +249,7 @@ WEBSOCKET_SERVICE=<Required: Cloud run endpoint url>
275
249
9. Commit your changes and deploy your them to production through the Project UI.
276
250
277
251
10. Reload the page and click the `Browse` dropdown menu. You should see your extension in the list.
278
-
- The extension will load the JavaScript from the `url` provided in the `application` definition. By default, this is https://localhost:8080/bundle.js. If you change the port your server runs on in the package.json, you will need to also update it in the manifest.lkml.
252
+
- The extension will load the JavaScript from the `url` provided in the `application` definition. By default, this is https://localhost:3000/dashboard_summarization.js. If you change the port your server runs on in the package.json, you will need to also update it in the manifest.lkml.
279
253
280
254
- Refreshing the extension page will bring in any new code changes from the extension template, although some changes will hot reload.
281
255
@@ -286,7 +260,8 @@ The process above requires your local development server to be running to load t
286
260
287
261
1. In your extension project directory on your development machine, build the extension by running the command `npm run build`.
288
262
2. Drag and drop the generated JavaScript file(bundle.js) contained in the `dist` directory into the Looker project interface.
289
-
3. Modify your `manifest.lkml` to use `file` instead of `url` and point it at the `bundle.js` file.
263
+
3. Modify your `manifest.lkml` to use `file` instead of `url` and point it at the `dashboard_summarization.js` file.
264
+
4.[IMPORTANT] Create a User Attribute in Looker following this naming convention `<extension_id>_genai_client_secret`. Note any dash or :: in the extension_id name will need to be replaced with an underscore. Typically the extension id will be your lookml project name where the extension lives followed by the name of the extension ie. `dashboard-summarization`. See [the docs](https://cloud.google.com/looker/docs/extension-framework-react-and-js-code-examples#user_attributes) for more details
290
265
291
266
Note that the additional JavaScript files generated during the production build process do not have to be mentioned in the manifest. These files will be loaded dynamically by the extension as and when they are needed. Note that to utilize code splitting, the Looker server must be at version 7.21 or above.
0 commit comments