-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Arnej/add Lab 101 hints #1584
Merged
Merged
Arnej/add Lab 101 hints #1584
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
28aad6e
add validation overrides (for people using docker/podman)
arnej27959 23ce0d5
add some actions for people to do at the start
arnej27959 d99670b
add using vespa CLI for queries
arnej27959 9ab40f5
fix typos
arnej27959 8fe9485
add JSON-format query template
arnej27959 95f0052
add link to vespa CLI release
arnej27959 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
actions to take at the start of training: | ||
|
||
- ensure you're able to login using a google | ||
or github account on https://console.vespa-cloud.com/ | ||
|
||
- You do not need to create your own "tenant" | ||
(the organization / billing entity in vespa cloud); | ||
if you contact Radu he will give you access to the | ||
"training1" tenant. | ||
|
||
- we'll assume you have installed standard developer tools: | ||
* git | ||
* curl | ||
- also recommended: | ||
* jq | ||
|
||
- ensure you have the "vespa" CLI tool installed: | ||
https://github.com/vespa-engine/vespa/releases/tag/v8.447.14 | ||
|
||
vespa auth login | ||
vespa auth show | ||
vespa config set target cloud | ||
# replace "myusername" with your user name | ||
vespa config set application training1.myusername-test1 | ||
|
||
git clone https://github.com/vespa-engine/sample-apps.git | ||
cd sample-apps/examples/training-artifacts/101/ch1 | ||
# you are "here" | ||
cd ecommerce | ||
vespa auth cert | ||
vespa deploy --wait 900 | ||
cd .. | ||
vespa document put f1f2-doc.json | ||
vespa document get id:ecommerce:product::1 | ||
vespa visit | ||
vespa query "yql=select * from product where true" | ||
vespa query "yql=select * from product where true" | jq ".root.children" | ||
vespa document remove id:ecommerce:product::1 | ||
|
||
- if you want to see usage of the underlying REST api, try these: | ||
vespa document -v put f1f2-doc.json | ||
vespa document -v get id:ecommerce:product::1 | ||
vespa query -v "yql=select field1 from product where true" | ||
vespa document -v remove id:ecommerce:product::1 |
4 changes: 4 additions & 0 deletions
4
examples/training-artifacts/101/ch1/ecommerce/validation-overrides.xml
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,4 @@ | ||
<validation-overrides> | ||
<allow until='2024-12-15'>indexing-change</allow> | ||
<allow until='2024-12-15'>schema-removal</allow> | ||
</validation-overrides> |
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 @@ | ||
{"id": "id:ecommerce:product::1", "fields": {"field1": "foo", "field2": "and bar"}} |
5 changes: 3 additions & 2 deletions
5
examples/training-artifacts/101/ch2/ecommerce/validation-overrides.xml
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,3 +1,4 @@ | ||
<validation-overrides> | ||
<!-- <allow until='2024-09-20'>indexing-change</allow> --> | ||
</validation-overrides> | ||
<allow until='2024-12-15'>indexing-change</allow> | ||
<allow until='2024-12-15'>schema-removal</allow> | ||
</validation-overrides> |
4 changes: 4 additions & 0 deletions
4
examples/training-artifacts/101/ch3/part-purchase/validation-overrides.xml
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,4 @@ | ||
<validation-overrides> | ||
<allow until='2024-12-15'>indexing-change</allow> | ||
<allow until='2024-12-15'>schema-removal</allow> | ||
</validation-overrides> |
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,70 @@ | ||
### group by item. Show first 3 | ||
vespa query "yql=select * from purchase where true | all( | ||
group(item) | ||
max(3) | ||
each( | ||
output(count()) | ||
) | ||
)" | ||
|
||
vespa query "yql=select * from purchase where true limit 0 | all( | ||
group(item) | ||
order(-count()) | ||
max(3) | ||
each( | ||
output(count() as(count_per_item)) | ||
) | ||
)" | ||
|
||
### use total $$$ instead of count. But output count as well | ||
vespa query "yql=select * from purchase where true limit 0 | all( | ||
group(item) | ||
order(-sum(price)) | ||
each( | ||
output(sum(price) as(revenue)) | ||
output(count()) | ||
) | ||
)" | ||
|
||
### sales by day | ||
vespa query "yql=select * from purchase where true limit 0 | all( | ||
group( | ||
time.date(date) | ||
) | ||
each( | ||
output(sum(price) as(revenue_per_day)) | ||
output(count()) | ||
) | ||
)" | jq ".root.children[].children[].children[]" | ||
|
||
### sales by day, by item | ||
vespa query "yql=select * from purchase where true limit 0 | all( | ||
group(time.date(date)) | ||
each( | ||
output(sum(price) as(revenue_per_day)) | ||
output(count()) | ||
all( | ||
group(item) | ||
order(-sum(price)) | ||
each( | ||
output(sum(price) as(revenue_per_item_per_day)) | ||
output(count()) | ||
) | ||
) | ||
) | ||
)" | jq ".root.children[].children[].children[]" | ||
|
||
|
||
### top items, but also show 3 sample orders | ||
vespa query "yql=select * from purchase where true limit 0 | all( | ||
group(item) | ||
order(-sum(price)) | ||
each( | ||
output(sum(price) as(revenue)) | ||
output(count()) | ||
max(3) | ||
each( | ||
output(summary()) | ||
) | ||
) | ||
)" |
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,56 @@ | ||
{ | ||
"yql": "select * from product where —--->WHERE QUERY CLAUSE GOES HERE <—-----", | ||
"presentation.summary": "medium", | ||
"ranking.profile": "closeness", | ||
"approximate_query_string": "Face Painting Stencil - QuickEZ/Gears #34", | ||
"input.query(q_embedding)": [ | ||
0.015, 0.024, 0.046, -0.019, -0.036, -0.023, -0.027, -0.093, | ||
-0.053, 0.055, -0.012, 0.082, 0.024, 0.023, 0.024, -0.038, | ||
0.037, -0.048, -0.1, -0.037, -0.045, 0.033, 0.023, -0.002, | ||
-0.024, -0.035, -0.021, -0.032, -0.097, -0.187, -0.003, | ||
0.044, -0.019, -0.021, 0.022, -0.026, 0.002, 0.048, 0.006, | ||
-0.041, 0.007, 0.062, -0.045, 0.019, 0.057, -0.027, 0.036, | ||
0.0, 0.052, 0.027, 0.0, -0.006, -0.007, -0.032, -0.064, 0.12, | ||
-0.036, -0.004, 0.026, 0.054, -0.037, 0.062, -0.339, -0.007, | ||
0.05, 0.024, 0.015, -0.009, -0.082, 0.018, 0.038, -0.019, | ||
-0.077, 0.028, 0.06, -0.016, 0.015, -0.02, 0.003, -0.087, | ||
-0.045, 0.052, -0.023, -0.017, -0.019, 0.033, -0.041, -0.056, | ||
0.006, -0.011, -0.028, -0.02, -0.023, -0.009, -0.054, 0.054, | ||
-0.014, 0.004, 0.062, 0.283, 0.035, 0.038, 0.09, -0.042, | ||
0.035, 0.012, -0.02, 0.036, -0.023, -0.011, -0.037, 0.008, | ||
-0.072, 0.044, 0.056, 0.029, -0.035, -0.045, 0.026, 0.079, | ||
-0.056, 0.022, -0.052, 0.007, -0.02, -0.013, -0.059, 0.059, | ||
-0.001, 0.02, 0.016, 0.058, -0.053, 0.003, -0.025, -0.002, | ||
0.052, -0.036, -0.017, 0.019, -0.007, -0.046, 0.154, -0.011, | ||
0.054, 0.046, 0.025, -0.0, -0.035, -0.059, 0.017, -0.002, | ||
0.036, 0.059, 0.073, -0.02, -0.05, -0.034, -0.029, 0.001, | ||
0.042, -0.024, 0.074, 0.149, 0.033, 0.004, 0.064, 0.011, | ||
0.072, -0.004, -0.028, 0.001, 0.037, 0.018, -0.025, 0.029, | ||
-0.015, 0.015, 0.035, -0.043, 0.018, 0.039, -0.05, -0.031, | ||
-0.025, 0.039, -0.058, 0.015, 0.018, 0.104, -0.025, 0.099, | ||
-0.097, 0.021, 0.036, 0.055, 0.04, 0.02, 0.008, -0.014, | ||
-0.011, -0.033, 0.046, -0.05, 0.004, -0.014, 0.007, 0.026, | ||
-0.024, -0.036, 0.011, -0.042, 0.044, 0.029, 0.032, 0.036, | ||
0.071, 0.017, 0.053, 0.061, 0.024, 0.006, -0.104, -0.065, | ||
0.03, 0.02, -0.015, -0.013, -0.014, -0.034, 0.073, 0.029, | ||
0.016, 0.033, 0.047, -0.009, -0.045, 0.011, -0.011, -0.034, | ||
0.053, 0.007, -0.058, 0.017, 0.029, -0.07, 0.0, -0.059, | ||
-0.008, 0.121, -0.004, -0.03, 0.078, 0.04, -0.048, -0.005, | ||
-0.147, 0.0, -0.058, 0.092, -0.051, -0.028, 0.007, -0.015, | ||
-0.046, -0.06, -0.06, -0.007, -0.066, -0.001, 0.039, 0.049, | ||
0.044, 0.012, 0.046, 0.007, 0.008, 0.039, -0.093, 0.01, | ||
-0.002, -0.025, -0.01, 0.055, -0.032, 0.013, -0.049, 0.01, | ||
0.02, -0.038, -0.016, -0.06, 0.036, -0.0, 0.114, -0.011, | ||
0.045, 0.028, -0.023, 0.004, -0.057, 0.019, -0.016, -0.002, | ||
-0.103, -0.027, -0.017, 0.026, -0.028, 0.004, -0.005, -0.004, | ||
0.018, 0.052, 0.029, -0.061, 0.01, 0.069, 0.008, -0.158, | ||
-0.055, 0.075, 0.01, -0.013, -0.042, 0.081, -0.053, 0.024, | ||
-0.033, 0.088, 0.044, 0.014, 0.015, 0.014, 0.047, 0.008, | ||
0.037, -0.02, -0.108, 0.001, 0.01, 0.11, -0.014, 0.03, 0.0, | ||
-0.016, -0.08, -0.073, 0.006, 0.01, -0.039, 0.064, -0.024, | ||
0.002, 0.127, 0.029, -0.05, 0.031, -0.01, 0.082, 0.004, | ||
0.015, -0.029, 0.017, -0.005, -0.007, 0.022, -0.043, -0.004, | ||
0.041, -0.004, -0.018, 0.018, -0.0, -0.012, 0.035, 0.001, | ||
-0.053, 0.064, -0.019, 0.011, -0.02, -0.097, -0.032 | ||
] | ||
} |
4 changes: 4 additions & 0 deletions
4
examples/training-artifacts/101/ch5/embedder_rrf_rag/validation-overrides.xml
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,4 @@ | ||
<validation-overrides> | ||
<allow until='2024-12-15'>indexing-change</allow> | ||
<allow until='2024-12-15'>schema-removal</allow> | ||
</validation-overrides> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't provide a validation-overrides because I thought this is a common problem people bump into and they'll "discover" how to do it.
But your change might just remove some unnecessary boilerplate, so +1. It's just that we might need to refresh these. Any better ideas than Slack reminders? :)