-
Notifications
You must be signed in to change notification settings - Fork 15
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
🧧 Recommendations #325
Open
WRadoslaw
wants to merge
50
commits into
Joystream:master
Choose a base branch
from
WRadoslaw:feat/recommendations
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
🧧 Recommendations #325
Changes from 44 commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
6748e4d
Initian setup
WRadoslaw c36b5b1
Override schema
WRadoslaw e1a8dc4
Add resolver to update video view
WRadoslaw d302d46
Switch account id for user id
WRadoslaw 723466a
Ineractions service: initial setup
WRadoslaw e099099
Interactions service: handlers
WRadoslaw 3bb5a1e
Rename methods
WRadoslaw eb52536
Add user upsert to auth api
WRadoslaw 7bd0359
Add video upsert to the mappings and processor
WRadoslaw 91384ef
Add resolvers for videos scenarios
WRadoslaw 1626888
Small fixes to resolver
WRadoslaw cf7495f
Handle next recommendation error
WRadoslaw 59706d7
DEV: homepageVideos debugging
WRadoslaw 5a7263d
Small logic improvements
WRadoslaw 340b314
Initial docs work
WRadoslaw 2fabee9
New env vars
WRadoslaw 32dddd8
Prettier
WRadoslaw bff051e
Interactions server docs
WRadoslaw 36c72c0
Decrease queue size after reaching export block
WRadoslaw 54540ea
Add update loop and change queue based batch logic
WRadoslaw 85d25c3
Switch to single queue and make scheduling sync
WRadoslaw 1950d19
Remove awaits for sync methods
WRadoslaw 17c6d6e
Remove not existing method call
WRadoslaw 39ca0a1
Always init batch loop
WRadoslaw e0afbf7
Remove initially enabled manager on dev
WRadoslaw 41c622b
Parse IDs
WRadoslaw 579662d
Handle custom item id
WRadoslaw 45721a8
Fix response error if where is empty
WRadoslaw 6e10adf
Init schedule loop on auth and interactions servers
WRadoslaw 73bf1a7
Add missing user id parsing in methods
WRadoslaw ed225c7
Change timestamp format to avoid error
WRadoslaw 1420552
Decrease ip limiting on interactions server
WRadoslaw 9304bcf
Adjust provider logic and fix similiar items query
WRadoslaw 85bb1d5
Watch next video resolver
WRadoslaw 48d6090
Add remove video event to the recombee
WRadoslaw bb5330d
Script to quickly setup recombee database
WRadoslaw cfc6291
Add channel oriented schedules to the processor
WRadoslaw 6455b1e
Add logic for channel clicked handler
WRadoslaw 77144ce
Add logic for channel follow
WRadoslaw 58f64fe
Add n-trigram language detection for recommendation system
WRadoslaw a44c381
Remove channel from sync
WRadoslaw aaba1f4
Setup mongodb for interactions
WRadoslaw 567c202
Save interactions to mongodb
WRadoslaw ee8755d
Avoid running interactions-api container if env vars are not present
WRadoslaw acd5c21
Merge branch 'master' into feat/recommendations
WRadoslaw c99c599
Post merge fixes and self review fixes
WRadoslaw c1ec1d5
CI fixes
WRadoslaw e285b34
Fix checks
WRadoslaw 4a666fc
Initial PR fixes
WRadoslaw edba6ec
Persisted queue idea
WRadoslaw 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
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
6 changes: 3 additions & 3 deletions
6
db/migrations/1701263174334-Data.js → db/migrations/1704717446430-Data.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,21 @@ | ||
# User recommendations in Orion | ||
User recommendations are outsourced to the external provider. | ||
Initial implementation was done with the Recombee API, and it is out of the box solution offered. | ||
|
||
### Abstraction | ||
All the logic for the provider was abstracted and ecapsulated in [`RecommendationServiceManager`](../../../src/utils/RecommendationServiceManager.ts) this means, that if you want to change | ||
the provider you just have to adjust the logic inside it and Orion will use the service to send data and get recommendations. | ||
|
||
### Syncing data | ||
- Video data gets upserted only through processor | ||
- User data get upserted through `auth-server` | ||
- Interactions data is proxied thorugh `interactions-server` where the request are limited both by IP and interactions. | ||
Only iteraction that is not coming thorugh the server is rating interaction (like, dislike), which will be synced through processor on MemberRemark event. | ||
|
||
### Env variables | ||
Recombee client is constructed with 2 variables `RECOMMENDATION_SERVICE_PRIVATE_KEY` and `RECOMMENDATION_SERVICE_DATABASE` both self-explanatory. | ||
`FORCE_RECOMMENDATION_DATA_SYNC` variable is a boolean that indicate whether processor should consider export block height in terms of syncing videos and ratings with recommendations service. | ||
If set to true - it will sync all the data for the first block even if last exported block is greater. | ||
|
||
If those two values are provided, when you use `make prepare` command, it will set up item properties and segments supported by Orion. | ||
If you want to run set up script directly use `make setup-recommendations`. |
Oops, something went wrong.
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.
This change will start the recommendation service containers even if only one of the env var is present.
Expected behaviour should be to start with
--profile interactions
when both of these are present