-
Notifications
You must be signed in to change notification settings - Fork 32
🎨 Program jobs: Pass metadata and return display version #7562
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
bisgaard-itis
merged 14 commits into
ITISFoundation:master
from
bisgaard-itis:49-46-pass-metadata-and-return-display-version
Apr 29, 2025
Merged
Changes from 8 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
b3c78e9
propagate name and description when creating program jobs
bisgaard-itis 54b40c0
add test
bisgaard-itis 1ce4749
fix test
bisgaard-itis 02bab47
add version_display to Program schema
bisgaard-itis 9decbd5
check version display is propagated out
bisgaard-itis 4ebdc60
Merge branch 'master' into 49-46-pass-metadata-and-return-display-ver…
bisgaard-itis 0d44666
fix program example check and pylint test
bisgaard-itis 9e93e16
regenerate OAS
bisgaard-itis 6f08a70
Merge branch 'master' into 49-46-pass-metadata-and-return-display-ver…
bisgaard-itis 9acfecc
@pcrespov json_loads and default faker
bisgaard-itis d894816
@sanderegg fix relative imports
bisgaard-itis a32449e
@pcrespov constrain input string lengths
bisgaard-itis 4a611e9
@pcrespov name -> project_name
bisgaard-itis ee972c1
Merge branch 'master' into 49-46-pass-metadata-and-return-display-ver…
bisgaard-itis 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1321,7 +1321,7 @@ | |
| "programs" | ||
| ], | ||
| "summary": "Create Program Job", | ||
| "description": "Creates a job in a specific release with given inputs.\n\nNOTE: This operation does **not** start the job", | ||
| "description": "Creates a program job", | ||
| "operationId": "create_program_job", | ||
| "security": [ | ||
| { | ||
|
|
@@ -1384,6 +1384,15 @@ | |
| } | ||
| } | ||
| ], | ||
| "requestBody": { | ||
| "content": { | ||
| "application/json": { | ||
| "schema": { | ||
| "$ref": "#/components/schemas/Body_create_program_job_v0_programs__program_key__releases__version__jobs_post" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "responses": { | ||
| "201": { | ||
| "description": "Successful Response", | ||
|
|
@@ -6056,6 +6065,34 @@ | |
| ], | ||
| "title": "Body_complete_multipart_upload_v0_files__file_id__complete_post" | ||
| }, | ||
| "Body_create_program_job_v0_programs__program_key__releases__version__jobs_post": { | ||
| "properties": { | ||
| "name": { | ||
| "anyOf": [ | ||
| { | ||
| "type": "string" | ||
| }, | ||
| { | ||
| "type": "null" | ||
| } | ||
| ], | ||
| "title": "Name" | ||
| }, | ||
| "description": { | ||
| "anyOf": [ | ||
| { | ||
| "type": "string" | ||
| }, | ||
| { | ||
| "type": "null" | ||
| } | ||
| ], | ||
| "title": "Description" | ||
| } | ||
| }, | ||
| "type": "object", | ||
| "title": "Body_create_program_job_v0_programs__program_key__releases__version__jobs_post" | ||
| }, | ||
| "Body_upload_file_v0_files_content_put": { | ||
| "properties": { | ||
| "file": { | ||
|
|
@@ -7715,14 +7752,26 @@ | |
| ], | ||
| "title": "Url", | ||
| "description": "Link to get this resource" | ||
| }, | ||
| "version_display": { | ||
| "anyOf": [ | ||
| { | ||
| "type": "string" | ||
| }, | ||
| { | ||
| "type": "null" | ||
| } | ||
| ], | ||
| "title": "Version Display" | ||
| } | ||
| }, | ||
| "type": "object", | ||
| "required": [ | ||
| "id", | ||
| "version", | ||
| "title", | ||
| "url" | ||
| "url", | ||
| "version_display" | ||
| ], | ||
| "title": "Program", | ||
| "description": "A released program with a specific version", | ||
|
|
@@ -7732,7 +7781,8 @@ | |
| "maintainer": "[email protected]", | ||
| "title": "Sim4life", | ||
| "url": "https://api.osparc.io/v0/solvers/simcore%2Fservices%2Fdynamic%2Fsim4life/releases/8.0.0", | ||
| "version": "8.0.0" | ||
| "version": "8.0.0", | ||
| "version_display": "8.0.0" | ||
| } | ||
| }, | ||
| "RunningState": { | ||
|
|
||
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
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
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
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
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 |
|---|---|---|
|
|
@@ -30,6 +30,8 @@ | |
| class Program(BaseService, ApiServerOutputSchema): | ||
| """A released program with a specific version""" | ||
|
|
||
| version_display: str | None | ||
|
|
||
| model_config = ConfigDict( | ||
| extra="ignore", | ||
| json_schema_extra={ | ||
|
|
@@ -40,33 +42,50 @@ class Program(BaseService, ApiServerOutputSchema): | |
| "description": "Simulation framework", | ||
| "maintainer": "[email protected]", | ||
| "url": "https://api.osparc.io/v0/solvers/simcore%2Fservices%2Fdynamic%2Fsim4life/releases/8.0.0", | ||
| "version_display": "8.0.0", | ||
| } | ||
| }, | ||
| ) | ||
|
|
||
| @classmethod | ||
| def create_from_image(cls, image_meta: ServiceMetaDataPublished) -> "Program": | ||
| data = image_meta.model_dump( | ||
| include={"name", "key", "version", "description", "contact"}, | ||
| include={ | ||
| "name", | ||
| "key", | ||
| "version", | ||
| "description", | ||
| "contact", | ||
| "version_display", | ||
| }, | ||
| ) | ||
| return cls( | ||
bisgaard-itis marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| id=data.pop("key"), | ||
| version=data.pop("version"), | ||
| title=data.pop("name"), | ||
| url=None, | ||
| version_display=data.pop("version_display"), | ||
| **data, | ||
| ) | ||
|
|
||
| @classmethod | ||
| def create_from_service(cls, service: ServiceGetV2) -> "Program": | ||
| data = service.model_dump( | ||
| include={"name", "key", "version", "description", "contact"}, | ||
| include={ | ||
| "name", | ||
| "key", | ||
| "version", | ||
| "description", | ||
| "contact", | ||
| "version_display", | ||
| }, | ||
| ) | ||
| return cls( | ||
| id=data.pop("key"), | ||
| version=data.pop("version"), | ||
| title=data.pop("name"), | ||
| url=None, | ||
| version_display=data.pop("version_display"), | ||
| **data, | ||
| ) | ||
|
|
||
|
|
||
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.