-
Notifications
You must be signed in to change notification settings - Fork 474
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
Pass dependencies in schedule jobs #2379
Pass dependencies in schedule jobs #2379
Conversation
7021ff4
to
3c225e9
Compare
3c225e9
to
5409cd7
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.
We need a solution for initial outputs computed in Listener
. I don't see evidence for that in your test-case.
) | ||
|
||
db.apply(m) | ||
assert m.upstream.triggered_schedule_jobs == True # noqa |
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.
Ok nice test.
|
||
db.execute(table.insert(data)) | ||
|
||
# Insert data |
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 add comments - why is this a useful test? Can we now solve the problem mentioned on the issue (https://github.com/orgs/superduper-io/projects/1?pane=issue&itemId=71398398)?
deps, features = db.apply(features_listener) | ||
|
||
trainable_model.trainer = MyTrainer( | ||
'test', select=features_listener.outputs_select, key=features_listener.outputs |
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 not what we want to test. We need a single db.apply
.
@@ -172,3 +189,53 @@ def test_listener_cleanup(db, data): | |||
|
|||
db.remove('listener', listener1.identifier, force=True) | |||
assert not db.databackend.check_output_dest(listener1.predict_id) | |||
|
|||
|
|||
def test_listener_chaining_with_trainer(db): |
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 do db.apply
for a single Application
, not multiple db.apply
calls.
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.
done
if from_type == 'DB': | ||
ids = [event.id for event in events] | ||
else: | ||
ids = [] | ||
for event in events: | ||
ids += event.id |
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.
Is the logic the same?
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.
if from_type
is not DB
i.e COMPONENT
this means its a startup job and hence it will have all ids into one event.
consumers = self._get_consumers(db, components) | ||
# All consumer are executed one by one. | ||
for consumer in consumers: | ||
events = queue[consumer] | ||
queue[consumer] = [] | ||
component = components[consumer] | ||
# Consume | ||
jobs = consume_events(db, component=component, events=events) | ||
queue_jobs[consumer].extend(jobs) |
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’m not sure if this will break the dependencies or the running order
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.
fixed
5409cd7
to
a8e9335
Compare
a8e9335
to
7c459d3
Compare
identifier="listener1", | ||
uuid="listener1", | ||
) | ||
features_listener.db = db |
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.
Shouldn't be necessary with db.apply
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.
features_listener.outputs_select
will fail
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 check the one comment before merging.
7c459d3
to
d24d3df
Compare
d24d3df
to
a1f61e4
Compare
ff1b95d
to
c04795c
Compare
Description
fix ##2329
Related Issues
Checklist
make unit_testing
andmake integration-testing
successfully?Additional Notes or Comments