-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: baseline spadev0 integration #28
Conversation
integration/spadev0/util.go
Outdated
for _, document := range replicas { | ||
tasks = append(tasks, task.Task{ | ||
Requester: requester, | ||
Module: task.HTTP, // TODO: Bitswap |
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.
@xinaxu , do you think we should have an entirely separate Module here? ex task.Spade
? Reason I ask is I don't see the metadata
retrieve_type
used anywhere (maybe I'm not looking in the right place though).. is is OK to use that metadata for control flow?
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.
Reason it is not used is because it is currently assuming there is only one type of retrieve_type and I'm expecting, as part of this PR or next PR, you will fork the logic, i.e., if retrieve_type is spade, do spade, otherwise, do regular.
Also, metadata will be part of the result payload, so you will be able to query the result collection with certain filtering on metadata.
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.
Meanwhile, please double check the current retrieval logic to make sure that it will not panic or crash on unexpected metadata/retrieve_type. You should be fine just by looking at your code
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.
Finally, have you checked the logic here. This is where retrieval worker polls the task queue for tasks. If we end up filling the task but no-one is pulling from it, the task queue will get full and no new tasks will be added. I think you're fine by looking at your logic but want to make sure that you're aware.
RetrievalBot/pkg/task/task_worker.go
Line 98 in 342f350
if strings.HasPrefix(t.acceptedCountries, "!") { |
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.
Meanwhile, please double check the current retrieval logic to make sure that it will not panic or crash on unexpected metadata/retrieve_type. You should be fine just by looking at your code
Yup, confirmed - the metadata retrieve_type
is not actually read anywhere in the codebase, so should not cause any issues.
Finally, have you checked the logic here. This is where retrieval worker polls the task queue for tasks. If we end up filling the task but no-one is pulling from it, the task queue will get full and no new tasks will be added. I think you're fine by looking at your logic but want to make sure that you're aware.
should we add some kind of back-pressure check to decide to not run the integration if the queue is too full?
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 is a very dcent first pass! The method is solid, left a few comments regarding implementation errors ( nothing architecturally bad though )
bfc54bc
to
12bbdf6
Compare
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.
Please take a look at the comments before merging
integration/spadev0/util.go
Outdated
for _, document := range replicas { | ||
tasks = append(tasks, task.Task{ | ||
Requester: requester, | ||
Module: task.HTTP, // TODO: Bitswap |
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.
Reason it is not used is because it is currently assuming there is only one type of retrieve_type and I'm expecting, as part of this PR or next PR, you will fork the logic, i.e., if retrieve_type is spade, do spade, otherwise, do regular.
Also, metadata will be part of the result payload, so you will be able to query the result collection with certain filtering on metadata.
integration/spadev0/util.go
Outdated
for _, document := range replicas { | ||
tasks = append(tasks, task.Task{ | ||
Requester: requester, | ||
Module: task.HTTP, // TODO: Bitswap |
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.
Meanwhile, please double check the current retrieval logic to make sure that it will not panic or crash on unexpected metadata/retrieve_type. You should be fine just by looking at your code
integration/spadev0/util.go
Outdated
for _, document := range replicas { | ||
tasks = append(tasks, task.Task{ | ||
Requester: requester, | ||
Module: task.HTTP, // TODO: Bitswap |
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.
Finally, have you checked the logic here. This is where retrieval worker polls the task queue for tasks. If we end up filling the task but no-one is pulling from it, the task queue will get full and no new tasks will be added. I think you're fine by looking at your logic but want to make sure that you're aware.
RetrievalBot/pkg/task/task_worker.go
Line 98 in 342f350
if strings.HasPrefix(t.acceptedCountries, "!") { |
Closes #24
Adds an integration to the Retrieval bot codebase to enable pulling CIDs from Spade and adding them to the task queue