-
Notifications
You must be signed in to change notification settings - Fork 32
Store function outputs 🎨 ♻️ #8142
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
Merged
mergify
merged 16 commits into
ITISFoundation:master
from
wvangeit:store_function_outputs
Jul 25, 2025
Merged
Changes from 7 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
c72b338
Adding code to store job output/status in main db
wvangeit c5bd308
Merge branch 'master' into store_function_outputs
wvangeit dc39380
Add tests to status/output fetching function jobs
wvangeit 41eda48
Merge branch 'master' into store_function_outputs
wvangeit 3780338
Merge branch 'master' into store_function_outputs
wvangeit 521808a
Move some code in dependencies
wvangeit 696f1b5
Merge branch 'master' into store_function_outputs
wvangeit 592a347
Fix some pylint errors
wvangeit f77a390
Merge branch 'master' into store_function_outputs
wvangeit 85a4c31
Update openapi-specs
wvangeit b4d3cfa
Revert api route method rename to keep same openapi.json
wvangeit 6d9425b
Merge branch 'master' into store_function_outputs
wvangeit 5eb4e9a
Fix some duplicate code
wvangeit bd14d0f
Merge branch 'store_function_outputs' of github.com:wvangeit/osparc-s…
wvangeit 3f66241
Merge branch 'master' into store_function_outputs
wvangeit 81dc362
Merge branch 'master' into store_function_outputs
wvangeit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
services/api-server/src/simcore_service_api_server/api/dependencies/functions.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| from typing import Annotated | ||
|
|
||
| from fastapi import Depends | ||
| from models_library.functions import ( | ||
| FunctionJob, | ||
| FunctionJobID, | ||
| FunctionJobStatus, | ||
| FunctionOutputs, | ||
| RegisteredFunction, | ||
| ) | ||
| from models_library.products import ProductName | ||
| from models_library.users import UserID | ||
| from simcore_service_api_server.api.dependencies.authentication import ( | ||
| get_current_user_id, | ||
| get_product_name, | ||
| ) | ||
| from simcore_service_api_server.api.dependencies.webserver_rpc import ( | ||
| get_wb_api_rpc_client, | ||
| ) | ||
| from simcore_service_api_server.services_rpc.wb_api_server import WbApiRpcClient | ||
|
|
||
|
|
||
| async def get_stored_job_outputs( | ||
| function_job_id: FunctionJobID, | ||
| wb_api_rpc: Annotated[WbApiRpcClient, Depends(get_wb_api_rpc_client)], | ||
| user_id: Annotated[UserID, Depends(get_current_user_id)], | ||
| product_name: Annotated[ProductName, Depends(get_product_name)], | ||
| ) -> FunctionOutputs: | ||
|
|
||
| return await wb_api_rpc.get_function_job_outputs( | ||
| function_job_id=function_job_id, user_id=user_id, product_name=product_name | ||
| ) | ||
|
|
||
|
|
||
| async def get_function_job_dependency( | ||
| function_job_id: FunctionJobID, | ||
| wb_api_rpc: Annotated[WbApiRpcClient, Depends(get_wb_api_rpc_client)], | ||
| user_id: Annotated[UserID, Depends(get_current_user_id)], | ||
| product_name: Annotated[ProductName, Depends(get_product_name)], | ||
| ) -> FunctionJob: | ||
| return await wb_api_rpc.get_function_job( | ||
| function_job_id=function_job_id, user_id=user_id, product_name=product_name | ||
| ) | ||
|
|
||
|
|
||
| async def get_function_from_functionjob( | ||
| function_job: Annotated[FunctionJob, Depends(get_function_job_dependency)], | ||
| wb_api_rpc: Annotated[WbApiRpcClient, Depends(get_wb_api_rpc_client)], | ||
| user_id: Annotated[UserID, Depends(get_current_user_id)], | ||
| product_name: Annotated[ProductName, Depends(get_product_name)], | ||
| ) -> RegisteredFunction: | ||
| return await wb_api_rpc.get_function( | ||
| function_id=function_job.function_uid, | ||
| user_id=user_id, | ||
| product_name=product_name, | ||
| ) | ||
|
|
||
|
|
||
| async def get_stored_job_status( | ||
| function_job_id: FunctionJobID, | ||
| wb_api_rpc: Annotated[WbApiRpcClient, Depends(get_wb_api_rpc_client)], | ||
| user_id: Annotated[UserID, Depends(get_current_user_id)], | ||
| product_name: Annotated[ProductName, Depends(get_product_name)], | ||
| ) -> FunctionJobStatus: | ||
| return await wb_api_rpc.get_function_job_status( | ||
| function_job_id=function_job_id, user_id=user_id, product_name=product_name | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.