-
Notifications
You must be signed in to change notification settings - Fork 28
✨ api and web-server: introduce job-project mapping via projects_to_jobs
table and RPC integration
#7435
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
✨ api and web-server: introduce job-project mapping via projects_to_jobs
table and RPC integration
#7435
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7435 +/- ##
==========================================
+ Coverage 87.40% 88.02% +0.62%
==========================================
Files 1729 1727 -2
Lines 66864 66141 -723
Branches 1133 1171 +38
==========================================
- Hits 58441 58221 -220
+ Misses 8102 7587 -515
- Partials 321 333 +12
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
71bd5d3
to
9ea3cb6
Compare
projects_to_jobs
table and RPC integration
6e6de87
to
33347b9
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.
Thanks!
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 consider my DB change suggestion
packages/postgres-database/src/simcore_postgres_database/models/projects_to_jobs.py
Outdated
Show resolved
Hide resolved
packages/pytest-simcore/src/pytest_simcore/helpers/webserver_rpc_server.py
Show resolved
Hide resolved
services/api-server/src/simcore_service_api_server/models/api_resources.py
Outdated
Show resolved
Hide resolved
services/web/server/src/simcore_service_webserver/projects/_controller/projects_rpc.py
Show resolved
Hide resolved
6a9d7b9
to
fc2d577
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.
very nice thanks for the explanations!
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.
Thanks a lot for the change!
packages/postgres-database/src/simcore_postgres_database/models/projects_to_jobs.py
Show resolved
Hide resolved
19fef3a
to
e6e332c
Compare
cdba1aa
to
14eb2c8
Compare
|
What do these changes do?
The
api-server
microservice exposes a resource-oriented REST API, defining resources such assolvers
,studies
, and (soon)programs
. These resources can spawnjobs
, whose resource names follow the pattern:/solvers/{solver_id}/version/{version_id}/jobs/{job_id}
/studies/{study_id}/jobs/{job_id}
Internally, these jobs are implemented as
projects
in theweb-server
. To distinguish job-based projects from front-end-created ones, we introduce a new table:projects_to_jobs
. Managed by theweb-server
, it stores the resource parent of each job-project mapping. This enables more effective handling of API-originated job requests.To avoid modifying the existing and already cluttered
create_project
REST endpoint (POST /projects
), we take a conservative approach:Instead, we introduce a new RPC controller:
projects_rpc
. It exposes amark_project_as_job
method, which is called after a job is successfully created and its UUID is assigned. This RPC marks the project as a job by registering it inprojects_to_jobs
.Also note that this PR migrates existing job-related projects into the new
projects_to_jobs
table. Going forward, all newly created job-projects will be recorded in this table via themark_project_as_job
RPC method.Next Steps
Future PRs will leverage this mechanism to:
study
or asolver
).Details
Database Schema Changes:
projects_to_jobs
with columnsid
,project_uuid
, andjob_parent_resource_name
to map projects used as jobs in the public API. This change includes creating the table, adding constraints, and populating it with initial data. [1] [2]projects_to_jobs
table during migration.Error Handling Improvements:
RPCInterfaceError
class for handling RPC interface exceptions and provided a method to transform domain exceptions into interface exceptions. [1] [2]RPCInterfaceError
and validate the correct transformation of domain errors.Webserver RPC Server Updates:
mark_project_as_job
in theWebserverRpcSideEffects
class to mark a project as a job using the RabbitMQ RPC client.create_job
function in the API routes to use the newmark_project_as_job
method via the RPC client. [1] [2]Related issue/s
projects_to_jobs
table in webserver #7386How to test
Dev-ops
None