-
Notifications
You must be signed in to change notification settings - Fork 32
🎨 expose service_run_id as an env var for both comp and new style dynamic services
#6942
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
GitHK
merged 28 commits into
ITISFoundation:master
from
GitHK:pr-osparc-allow-user-services-to-request-dy-sidecar-run-id
Dec 19, 2024
Merged
Changes from 22 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
24ff119
run_id can now be requested as an env var on request by a service
df34a54
Merge branch 'master' into pr-osparc-allow-user-services-to-request-d…
GitHK 47c4eb8
Merge remote-tracking branch 'upstream/master' into pr-osparc-allow-u…
daccfdc
added context for run_id in comp tasks
8d9b796
Merge branch 'pr-osparc-allow-user-services-to-request-dy-sidecar-run…
d6b89a9
added fixture and refactor tests
4204990
fixed broken tests
ff3298c
moved fixture where it is used
2d1b08e
refactor with proper values
13d56de
refactor
dfdacbb
fixed test
486fb33
refactor to use new RunID
978f407
refactor types
0cb9f1f
fixed type
af0bed3
repalced
a72b6b5
fixed imports
98de753
Merge remote-tracking branch 'upstream/master' into pr-osparc-allow-u…
b0d715c
Merge remote-tracking branch 'upstream/master' into pr-osparc-allow-u…
5b67d46
renamed run_id to service_run_id and RunID to ServiceRunID
e9be2ee
rename
40ac24e
refactor
fe7ee55
fixed naming
2ded5fe
Merge remote-tracking branch 'upstream/master' into pr-osparc-allow-u…
e726e78
fixed failing test
dc53e45
Merge remote-tracking branch 'upstream/master' into pr-osparc-allow-u…
f82d8b0
refactor
e652c83
fixed imports
1c44aec
fixed specs
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
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
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,40 @@ | ||
| import pytest | ||
| from models_library.projects import ProjectID | ||
| from models_library.projects_nodes import NodeID | ||
| from models_library.services_types import ServiceRunID | ||
| from models_library.users import UserID | ||
| from pydantic import PositiveInt | ||
|
|
||
|
|
||
| @pytest.mark.parametrize( | ||
| "user_id, project_id, node_id, iteration, expected_result", | ||
| [ | ||
| ( | ||
| 2, | ||
| ProjectID("e08356e4-eb74-49e9-b769-2c26e34c61d9"), | ||
| NodeID("a08356e4-eb74-49e9-b769-2c26e34c61d1"), | ||
| 5, | ||
| "comp_2_e08356e4-eb74-49e9-b769-2c26e34c61d9_a08356e4-eb74-49e9-b769-2c26e34c61d1_5", | ||
| ) | ||
| ], | ||
| ) | ||
| def test_run_id_get_resource_tracking_run_id( | ||
| user_id: UserID, | ||
| project_id: ProjectID, | ||
| node_id: NodeID, | ||
| iteration: PositiveInt, | ||
| expected_result: str, | ||
| ): | ||
| resource_tracking_service_run_id = ( | ||
| ServiceRunID.get_resource_tracking_run_id_for_computational( | ||
| user_id, project_id, node_id, iteration | ||
| ) | ||
| ) | ||
| assert isinstance(resource_tracking_service_run_id, ServiceRunID) | ||
| assert resource_tracking_service_run_id == expected_result | ||
|
|
||
|
|
||
| def test_get_resource_tracking_run_id_for_dynamic(): | ||
| assert isinstance( | ||
| ServiceRunID.get_resource_tracking_run_id_for_dynamic(), ServiceRunID | ||
| ) |
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
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.