-
Notifications
You must be signed in to change notification settings - Fork 32
✨ 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
matusdrobuliak66
left a comment
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!
GitHK
left a comment
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
sanderegg
left a comment
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!
GitHK
left a comment
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-servermicroservice 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
projectsin 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_projectREST endpoint (POST /projects), we take a conservative approach:Instead, we introduce a new RPC controller:
projects_rpc. It exposes amark_project_as_jobmethod, 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_jobstable. Going forward, all newly created job-projects will be recorded in this table via themark_project_as_jobRPC method.Next Steps
Future PRs will leverage this mechanism to:
studyor asolver).Details
Database Schema Changes:
projects_to_jobswith columnsid,project_uuid, andjob_parent_resource_nameto 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_jobstable during migration.Error Handling Improvements:
RPCInterfaceErrorclass for handling RPC interface exceptions and provided a method to transform domain exceptions into interface exceptions. [1] [2]RPCInterfaceErrorand validate the correct transformation of domain errors.Webserver RPC Server Updates:
mark_project_as_jobin theWebserverRpcSideEffectsclass to mark a project as a job using the RabbitMQ RPC client.create_jobfunction in the API routes to use the newmark_project_as_jobmethod via the RPC client. [1] [2]Related issue/s
projects_to_jobstable in webserver #7386How to test
Dev-ops
None