-
Notifications
You must be signed in to change notification settings - Fork 32
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(models): add service tables #241
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #241 +/- ##
==========================================
+ Coverage 72.14% 72.79% +0.64%
==========================================
Files 7 7
Lines 955 985 +30
==========================================
+ Hits 689 717 +28
- Misses 266 268 +2
|
3d87f1c
to
441a391
Compare
441a391
to
861463a
Compare
Revision ID: 8da6ccf08af9 | ||
Revises: 2e82f33ee37d | ||
Create Date: 2024-11-19 10:51:51.199670 | ||
|
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.
todo: Remove empty line in the docstring.
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.
All other files (except workflow_sharing migration which has the additional rebase_date field) have the same format. Maybe better to follow the same structure? The empty line might be signaling that no rebasing has taken place.
sa.PrimaryKeyConstraint("service_id", name=op.f("pk_workflow_service")), | ||
schema="__reana", | ||
) | ||
# ### end Alembic commands ### |
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.
todo: Remove the "end Alembic" comment.
"""Downgrade to 2e82f33ee37d revision.""" | ||
op.drop_table("workflow_service", schema="__reana") | ||
op.drop_table("service", schema="__reana") | ||
# ### end Alembic commands ### |
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.
todo: Remove "end Alembic" comment.
class ServiceType(enum.Enum): | ||
"""Enumeration of service types.""" | ||
|
||
dask = 0 |
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 this one intended to be general Dask service? I wonder about distinguishing Dask cluster from Dask dashboard, for example in case there would be more services exposed from the Dask integration. But I guess these theoretical distinctions may not be useful as of yet...
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 think we can introduce a new service type relatively easily if we need an extra field in the future. Calling the service dask_dashboard
or something similar at the moment could be too specific.
reana_db/models.py
Outdated
id_ = Column(UUIDType, primary_key=True, default=generate_uuid) | ||
name = Column(String(255)) | ||
uri = Column(Text) # uri to access the service | ||
status = Column(Enum(RunStatus), nullable=False, default=RunStatus.created) |
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.
For admin use cases, it may be perhaps good to have some indexes, e.g. on the status
column so that we could ask "which users have Dask dashboards still open?". But this is something that we may also get to later.
861463a
to
1521648
Compare
1521648
to
25cd5e9
Compare
6b58661
to
6671ce2
Compare
6671ce2
to
68c344f
Compare
68c344f
to
5092280
Compare
5092280
to
f0da4c1
Compare
This PR adds
Service
table to db. Currently, we have onlydask
service but it is a generic implementation and can be used for other components associated with workflows in the future.