-
Notifications
You must be signed in to change notification settings - Fork 284
Remove GetResources and ResourceList message #3744
Conversation
tests/golem/task/dummy/task.py
Outdated
min_version=golem.__version__, | ||
) | ||
|
||
header = TaskHeaderFactory() |
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.
Hey, no need for all these changes. You can just replace TaskHeader()
with TaskHeaderFactory(...)
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.
There is TaskHeaderFactory. Unfortunately most of this fields need to have specific values for the rest of the script to work properly (so they cannot be completely random).
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.
try this:
header = TaskHeaderFactory(
task_id=task_id,
task_owner=task_owner,
environment=environment,
deadline=timeout_to_deadline(14400),
subtask_timeout=1200,
subtasks_count=num_subtasks,
resource_size=params.shared_data_size + params.subtask_data_size,
estimated_memory=0,
max_price=MIN_PRICE,
min_version=golem.__version__,
timestamp=int(get_timestamp_utc()),
)
golem/task/tasksession.py
Outdated
@@ -140,9 +140,10 @@ def __init__(self, conn): | |||
# verified yet) | |||
self.msgs_to_send = [] | |||
self.err_msg = None # Keep track of errors | |||
self.resources_options = None # Download options for resources |
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.
Would it be possible to avoid adding this to TaskSession
instance? Like storing in Task[Manager|Keeper]
? Keeping TS stateless would allow to eventually simplify establishing new Session and making a simple operation as "send msgX to nodeY" easy. #2223
…into resource_list
59dae74
to
df2d9a5
Compare
@@ -336,6 +336,7 @@ def _new_compute_task_def(self, subtask_id, extra_data, | |||
int(timeout_to_deadline(self.header.subtask_timeout)), | |||
self.header.deadline, | |||
) | |||
ctd['resources'] = self.get_resources() |
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 isn't needed, is it?
ctd['resources']
is supposed to contain package IDs downloadable from p2p network, not actual filepaths
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.
hmm... I'm unsure ... right now, ResourceList
servers as a point to exchange the resources but the list is always assumed to contain just one element ... and then, when e.g. the resources are passed to the Concent, they're passed in a different way (using HTTP, not p2p) and are verified thanks to the hash contained in TTC itself ...
if now resources could comprise of multiple parts, hashes of each part would need to be specified somehow if Concent was to be able to verify each of them ...
so, the list here is not only needed, but actually, @badb the list should probably be a list of dicts (?) containing both locations (p2p IDs of those files) but also hashes of those files ...
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.
It's not needed yet. Will be in the next step. I can remove it and add when it's actually needed.
Right now way that resources are sent is not really much different than the previous one.
@shadeofblue Can you show me the part of the code where the resources are passed to Concent?
hmm, I feel undecided here... on one hand, I understand this is mostly a refactor aiming to remove an unnecessary exchange of messages and in this case, I can only second @jiivan that - if possible - it shouldn't add statefulness to On the other - I have one more uncertainty with regards to multiple-package resources and Concent - are we assuming those multi-package tasks right now just won't be supported by Concent? if so, maybe we should modify Golem not to allow the iow (in case we don't want Concent support for multi-package tasks right now):
On the other hand, if we could probably enable the Concent to process such muti-package tasks but then as I said above - we'd need to enable the Concent to also verify those additional resources - most likely by adding package hashes somewhere in TTC or earlier... of course, we'd need to modify the Concent itself to enable such support in the service itself... |
(1) Additional statefulness of Task Session has been removed. |
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.
lgtm
Codecov Report
@@ Coverage Diff @@
## develop #3744 +/- ##
==========================================
- Coverage 87.81% 87.71% -0.1%
==========================================
Files 216 216
Lines 19008 19009 +1
==========================================
- Hits 16691 16673 -18
- Misses 2317 2336 +19 |
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.
@badb I'm fine with those changes with the reservations that we discussed offline (iow, that we'll need to address those changes to TTC/TaskHeader in a future update)
Information about resources should be included in ComputeTaskDef. Thanks to that we can:
Do not merge before: golemfactory/golem-messages#308