Skip to content

Commit 4d44f2d

Browse files
Merge pull request #19 from kunalpuranik/readme-updates
chore(README): Updated deployment steps in README
2 parents 71f7c37 + 13789c8 commit 4d44f2d

File tree

1 file changed

+75
-35
lines changed

1 file changed

+75
-35
lines changed

README.md

Lines changed: 75 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ This section describes how to set up the web server on Cloud Run powering the Ge
6161

6262
```bash
6363
# cd ~/ Optional. your user directory is usually a good place to git clone to.
64-
git clone git@github.com:looker-open-source/dashboard-summarization.git
64+
git clone https://github.com/looker-open-source/dashboard-summarization.git
6565
```
6666

6767
2. Navigate (`cd`) to the template directory on your system
6868

6969
```bash
70-
cd websocket-service/src
70+
cd dashboard-summarization/websocket-service/src
7171
```
7272

7373
3. Install the dependencies with [NPM](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm).
@@ -78,20 +78,20 @@ This section describes how to set up the web server on Cloud Run powering the Ge
7878

7979
> 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.
8080
81-
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:
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:
8282

8383
Ex: Looker instance -> https://mycompany.cloud.looker.com
84-
```
85-
[mycompany]
86-
base_url=
87-
client_id=
88-
client_secret=
89-
verify_ssl=true
90-
```
84+
```
85+
[mycompany]
86+
base_url=<Your Looker instance URL>
87+
client_id=<From your looker user's api credentials>
88+
client_secret=<From your looker user's api credentials>
89+
verify_ssl=true
90+
```
9191

9292
This is configured to support deployment to multiple Looker instances reusing the same backend.
9393

94-
4. Start the development server
94+
5. Start the development server
9595

9696
```bash
9797
npm run start
@@ -100,19 +100,54 @@ This is configured to support deployment to multiple Looker instances reusing th
100100

101101
#### Deployment
102102

103-
1. Build Docker File and Submit to Artifact Registry, replacing the `REGION` variable with your deployment region.
103+
1. For deployment you will need to build the docker file and submit it to the [Artifact Registry](https://cloud.google.com/artifact-registry). You need to first create a repository. Update `location` to your deployment region, then run this command from root
104+
```bash
105+
gcloud artifacts repositories create dashboard-summarization-docker-repo --repository-format=docker --location=REGION
106+
```
107+
108+
2. Navigate to template directory
109+
```bash
110+
cd dashboard-summarization/websocket-service/src
111+
```
112+
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:
114+
115+
Ex: Looker instance -> https://mycompany.cloud.looker.com
116+
```
117+
[mycompany]
118+
base_url=<Your Looker instance URL>
119+
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
127+
```
128+
<YOUR_REGION> = Your deployment region
129+
<YOUR_PROJECT_ID> = Your GCP project ID
130+
```
131+
132+
5. Build Docker File and Submit to Artifact Registry, replacing the `REGION` variable with your deployment region.
104133
*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.
105134
```bash
106135
gcloud auth login && gcloud auth application-default login && gcloud builds submit --region=REGION --config cloudbuild.yaml
107136
```
108-
Save the returned docker image url.
109-
2. Navigate (`cd`) to the terraform directory on your system
137+
Save the returned docker image url. You can also get the docker image url from the Artifact Registry
138+
139+
6. Navigate (`cd`) to the terraform directory on your system
110140
```bash
111141
cd .. && cd terraform
112142
```
113-
3. Replace defaults in the `variables.tf` file for project, region, docker url and service name.
143+
7. Replace defaults in the `variables.tf` file for project, region, docker url and service name.
144+
```
145+
project_id=<GCP project ID>
146+
deployment_region=<Your deployement region>
147+
docker_image=<The docker image url from step 5>
148+
```
114149

115-
4. 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)
150+
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)
116151

117152
```terraform
118153
terraform init
@@ -122,7 +157,7 @@ This is configured to support deployment to multiple Looker instances reusing th
122157
terraform apply
123158
```
124159

125-
5. Save Deployed Cloud Run URL Endpoint
160+
9. Save Deployed Cloud Run URL Endpoint
126161

127162
#### Optional: Setup Log Sink to BQ for LLM Cost Estimation and Request Logging
128163

@@ -147,28 +182,42 @@ jsonPayload.component="dashboard-summarization-logs"
147182

148183
```bash
149184
# cd ~/ Optional. your user directory is usually a good place to git clone to.
150-
git clone git@github.com:looker-open-source/dashboard-summarization.git
185+
git clone https://github.com/looker-open-source/dashboard-summarization.git
151186
```
152187

153188
2. Navigate (`cd`) to the root directory in the cloned repo
154189

155-
3. Install the dependencies with [NPM](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm).
190+
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*
192+
```
193+
SLACK_CLIENT_ID=
194+
SLACK_CLIENT_SECRET=
195+
CHANNEL_ID=
196+
SPACE_ID=
197+
WEBSOCKET_SERVICE=<Required: Cloud run endpoint url>
198+
```
199+
200+
4. Install the dependencies with [NPM](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm).
156201

157202
```bash
158203
npm install
159204
```
160205

161206
> 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.
207+
> If you get errors installing dependencies, you may try
208+
```bash
209+
npm install --legacy-peer-deps
210+
```
162211

163-
4. Start the development server
212+
5. Start the development server
164213

165214
```bash
166215
npm run develop
167216
```
168217

169218
Great! Your extension is now running and serving the JavaScript at http://localhost:8080/bundle.js.
170219

171-
5. Now log in to Looker and create a new project.
220+
6. Now log in to Looker and create a new project.
172221

173222
This is found under **Develop** => **Manage LookML Projects** => **New LookML Project**.
174223

@@ -213,39 +262,30 @@ jsonPayload.component="dashboard-summarization-logs"
213262
}
214263
}
215264

216-
6. Create a `model` LookML file in your project. The name doesn't matter. The model and connection won't be used, and in the future this step may be eliminated.
265+
7. Create a `model` LookML file in your project. The name doesn't matter. The model and connection won't be used, and in the future this step may be eliminated.
217266

218267
- Add a connection in this model. It can be any connection, it doesn't matter which.
219268
- [Configure the model you created](https://docs.looker.com/data-modeling/getting-started/create-projects#configuring_a_model) so that it has access to some connection.
220269

221-
7. Connect your new project to Git. You can do this multiple ways:
270+
8. Connect your new project to Git. You can do this multiple ways:
222271

223272
- Create a new repository on GitHub or a similar service, and follow the instructions to [connect your project to Git](https://docs.looker.com/data-modeling/getting-started/setting-up-git-connection)
224273
- A simpler but less powerful approach is to set up git with the "Bare" repository option which does not require connecting to an external Git Service.
225274

226-
8. Commit your changes and deploy your them to production through the Project UI.
275+
9. Commit your changes and deploy your them to production through the Project UI.
227276

228-
9. Reload the page and click the `Browse` dropdown menu. You should see your extension in the list.
277+
10. Reload the page and click the `Browse` dropdown menu. You should see your extension in the list.
229278
- 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.
230279

231280
- Refreshing the extension page will bring in any new code changes from the extension template, although some changes will hot reload.
232281

233-
10. Ensure All the Appropriate Environment Variables are set.
234-
*See Export Integration Steps below for Slack and Gchat Variables. These are optional.*
235-
```
236-
SLACK_CLIENT_ID=
237-
SLACK_CLIENT_SECRET=
238-
CHANNEL_ID=
239-
SPACE_ID=
240-
WEBSOCKET_SERVICE=
241-
```
242282

243283
#### Deployment
244284

245285
The process above requires your local development server to be running to load the extension code. To allow other people to use the extension, a production build of the extension needs to be run. As the kitchensink uses code splitting to reduce the size of the initially loaded bundle, multiple JavaScript files are generated.
246286

247287
1. In your extension project directory on your development machine, build the extension by running the command `npm run build`.
248-
2. Drag and drop ALL of the generated JavaScript files contained in the `dist` directory into the Looker project interface.
288+
2. Drag and drop the generated JavaScript file(bundle.js) contained in the `dist` directory into the Looker project interface.
249289
3. Modify your `manifest.lkml` to use `file` instead of `url` and point it at the `bundle.js` file.
250290

251291
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

Comments
 (0)