Commit e896a5c
authored
feat(ui): add mustache templating in pod log url (#652)
# Description
There are so many cloud providers out there. This PR is used to add
templating for pod log urls. Instead of relying only on Stackdriver logs
(which is a Google product), we give our users the ability to create
their own log urls. There are some variables that can be used by our
users.
#### Image Builder Log
1. Available Variables
- `cluster_name` (string)
- `namespace_name` (string)
- `job_name` (string)
- `start_time` (string)
- `end_time` (string)
2. Usage
```
# merlin config.yaml
FeatureToggleConfig:
LogConfig:
LogImageBuilderURL: https://logviewer.sample.local/logs/viewer?cluster={{cluster_name}}&namespace={{namespace_name}}&job={{job_name}}
# it generates
# https://logviewer.sample.local/logs/viewer?cluster=caraml-cluster&namespace=caraml-namespace&job=job-caraml
```
#### Model Log
1. Available Variables
- `cluster_name` (string)
- `namespace_name` (string)
- `pod_names` (array of {`value`, `is_first`})
- `start_time` (string)
2. Usage
```
# merlin config.yaml
FeatureToggleConfig:
LogConfig:
LogModelURL: https://logviewer.sample.local/logs/viewer?cluster={{cluster_name}}&namespace={{namespace_name}}&pods={{#pod_names}}{{#is_first}}{{value}}{{/is_first}}{{^is_first}},{{value}}{{/is_first}}{{/pod_names}}
# it generates
# https://logviewer.sample.local/logs/viewer?cluster=caraml-cluster&namespace=caraml-namespace&pods=pod-1,pod-2,pod-3
```
# Modifications
## BE
- add `LogImageBuilderURL` and `LogModelURL`
## FE
- add mustache templating
- change Stackdriver urls to custom log url with backward compatibility
# Tests
<!-- Besides the existing / updated automated tests, what specific
scenarios should be tested? Consider the backward compatibility of the
changes, whether corner cases are covered, etc. Please describe the
tests and check the ones that have been completed. Eg:
- [x] Deploying new and existing standard models
- [ ] Deploying PyFunc models
-->
# Checklist
- [x] Added PR label
- [ ] Added unit test, integration, and/or e2e tests
- [x] Tested locally
- [ ] Updated documentation
- [ ] Update Swagger spec if the PR introduce API changes
- [ ] Regenerated Golang and Python client if the PR introduces API
changes
# Release Notes
<!--
Does this PR introduce a user-facing change?
If no, just write "NONE" in the release-note block below.
If yes, a release note is required. Enter your extended release note in
the block below.
If the PR requires additional action from users switching to the new
release, include the string "action required".
For more information about release notes, see kubernetes' guide here:
http://git.k8s.io/community/contributors/guide/release-notes.md
-->
```release-note
```1 parent d366454 commit e896a5c
File tree
6 files changed
+111
-32
lines changed- api
- cmd/api
- config
- ui/src
- components/logs
- utils
6 files changed
+111
-32
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
174 | 177 | | |
175 | 178 | | |
176 | 179 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
| 266 | + | |
266 | 267 | | |
267 | 268 | | |
268 | 269 | | |
| |||
281 | 282 | | |
282 | 283 | | |
283 | 284 | | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
284 | 290 | | |
285 | 291 | | |
286 | 292 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
| 20 | + | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
121 | 122 | | |
122 | 123 | | |
123 | 124 | | |
124 | | - | |
| 125 | + | |
125 | 126 | | |
126 | 127 | | |
127 | 128 | | |
128 | 129 | | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
140 | 155 | | |
141 | 156 | | |
142 | 157 | | |
| |||
165 | 180 | | |
166 | 181 | | |
167 | 182 | | |
168 | | - | |
| 183 | + | |
169 | 184 | | |
170 | 185 | | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
| 186 | + | |
178 | 187 | | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
186 | 216 | | |
187 | 217 | | |
188 | 218 | | |
| |||
199 | 229 | | |
200 | 230 | | |
201 | 231 | | |
202 | | - | |
| 232 | + | |
203 | 233 | | |
204 | 234 | | |
205 | 235 | | |
| |||
209 | 239 | | |
210 | 240 | | |
211 | 241 | | |
212 | | - | |
| 242 | + | |
213 | 243 | | |
214 | 244 | | |
215 | | - | |
| 245 | + | |
216 | 246 | | |
217 | 247 | | |
218 | 248 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
88 | 94 | | |
89 | 95 | | |
90 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
0 commit comments