-
Notifications
You must be signed in to change notification settings - Fork 32
✨👽️ Add log zip endpoints in api-server #8056
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 64 commits into
ITISFoundation:master
from
bisgaard-itis:114-expose-fileids-dirv2-and-logs-in-apiserver
Jul 17, 2025
Merged
Changes from 40 commits
Commits
Show all changes
64 commits
Select commit
Hold shift + click to select a range
ead97ac
implement rpc endpoint in dirv2 for getting log fileids
bisgaard-itis 2a06a99
add rpc client function
bisgaard-itis 100fc15
add docstring
bisgaard-itis 669779a
add unit tests for director-v2 rpc endpoint
bisgaard-itis e0c22ca
start adding dirv2 rpc client in api server
bisgaard-itis e1ce600
map exceptions
bisgaard-itis a964afe
Merge branch 'master' into 114-expose-fileids-dirv2-and-logs-in-apise…
bisgaard-itis 2b470bc
Merge branch 'master' into 114-expose-fileids-dirv2-and-logs-in-apise…
bisgaard-itis 9f0663c
add rpc storage client in api-server
bisgaard-itis 4a098e1
minor correction
bisgaard-itis 1645e74
added endpoint for exporting function jobs logs
bisgaard-itis cbc6c59
add endpoint for exporting as downloadlink
bisgaard-itis 52e7b28
add docstring
bisgaard-itis 7c6225a
Merge branch 'master' into 114-expose-fileids-dirv2-and-logs-in-apise…
bisgaard-itis 38aecfd
Merge branch 'master' into allow_zipping_endpoint_to_return_download_…
bisgaard-itis bf5686c
start adding tests
bisgaard-itis c8ef1c4
ensure result is serializable
bisgaard-itis 4c82001
fix import
bisgaard-itis 519ec7f
fix unitest
bisgaard-itis 3c9cfa8
commit forgotten change
bisgaard-itis cbf3f4c
remove default value
bisgaard-itis 65814f0
add test for invalid export type
bisgaard-itis d104e3e
Merge branch 'master' into allow_zipping_endpoint_to_return_download_…
bisgaard-itis b6e134a
Merge branch 'master' into 114-expose-fileids-dirv2-and-logs-in-apise…
bisgaard-itis 456ffe8
start adding test
bisgaard-itis f2b8933
Merge branch 'master' into allow_zipping_endpoint_to_return_download_…
bisgaard-itis 58dc8aa
changes according to PR feedback
bisgaard-itis 0415850
Merge branch 'master' into allow_zipping_endpoint_to_return_download_…
bisgaard-itis 31bdb4e
Merge branch '114-expose-fileids-dirv2-and-logs-in-apiserver' of gith…
bisgaard-itis c87a14b
Merge branch 'master' into 114-expose-fileids-dirv2-and-logs-in-apise…
bisgaard-itis 7531de3
Merge branch 'allow_zipping_endpoint_to_return_download_link' into 11…
bisgaard-itis 616c1d7
add export_as input
bisgaard-itis 9a2c13e
make project_id a kwargs
bisgaard-itis 80253dc
add mock of director v2 endpoint
bisgaard-itis 63d64c9
add fixture for mocking dirv2 rpc endpoint
bisgaard-itis 3ff886a
finish implementing test
bisgaard-itis e6000ca
expose task endpoints
bisgaard-itis b9b239b
services/api-server version: 0.9.1 → 0.10.0
bisgaard-itis 4ea610c
update openapi specs
bisgaard-itis 633daf3
Merge branch 'master' into 114-expose-fileids-dirv2-and-logs-in-apise…
bisgaard-itis 6a93f56
mock_registered_function_job -> mock_registered_project_function_job
bisgaard-itis a9d6f1b
mock_function_job -> mock_project_function_job
bisgaard-itis d8640c6
add fixtures for solver function jobs
bisgaard-itis 98e2a85
also cover solver function job test case
bisgaard-itis a083ea7
fix in tests
bisgaard-itis fe07ac6
fix imports
bisgaard-itis 556132c
fix tests in director-v2
bisgaard-itis c31e86a
Merge branch 'master' into 114-expose-fileids-dirv2-and-logs-in-apise…
bisgaard-itis 8929879
@pcrespov use RPCInterfaceError
bisgaard-itis 563c1a7
fix import
bisgaard-itis 9a77864
move error models to servicelib
bisgaard-itis 91eba98
fix unused argument pylint
bisgaard-itis f81d8b7
@wvangeit change handler name
bisgaard-itis 6d71d32
update openapi specs
bisgaard-itis 1b81707
move rpc name validation out of method @sanderegg
bisgaard-itis 8ad62ba
@sanderegg analyze_pipeline -> validate_pipeline
bisgaard-itis 0ef5ad6
@sanderegg move LOG_FILE_NAME to constants
bisgaard-itis 7392a35
also validate pipeline in rpc case @sanderegg
bisgaard-itis 446bd66
Merge branch 'master' into 114-expose-fileids-dirv2-and-logs-in-apise…
bisgaard-itis f358985
remove comments
bisgaard-itis e3ddb10
Merge branch 'master' into 114-expose-fileids-dirv2-and-logs-in-apise…
bisgaard-itis 13bd472
fix imports
bisgaard-itis b1ff618
handle PipelineTaskMissingError
bisgaard-itis eacc504
Merge branch 'master' into 114-expose-fileids-dirv2-and-logs-in-apise…
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
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
30 changes: 30 additions & 0 deletions
30
packages/pytest-simcore/src/pytest_simcore/helpers/director_v2_rpc_server.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,30 @@ | ||
| # pylint: disable=no-self-use | ||
| # pylint: disable=not-context-manager | ||
| # pylint: disable=protected-access | ||
| # pylint: disable=redefined-outer-name | ||
| # pylint: disable=unused-argument | ||
| # pylint: disable=unused-variable | ||
|
|
||
|
|
||
| from models_library.api_schemas_directorv2.computations import TaskLogFileIdGet | ||
| from models_library.projects import ProjectID | ||
| from pydantic import TypeAdapter, validate_call | ||
| from pytest_mock import MockType | ||
| from servicelib.rabbitmq._client_rpc import RabbitMQRPCClient | ||
|
|
||
|
|
||
| class DirectorV2SideEffects: | ||
| # pylint: disable=no-self-use | ||
| @validate_call(config={"arbitrary_types_allowed": True}) | ||
| async def get_computation_task_log_file_ids( | ||
| self, | ||
| rpc_client: RabbitMQRPCClient | MockType, | ||
| *, | ||
| project_id: ProjectID, | ||
| ) -> list[TaskLogFileIdGet]: | ||
| assert rpc_client | ||
| assert project_id | ||
|
|
||
| return TypeAdapter(list[TaskLogFileIdGet]).validate_python( | ||
| TaskLogFileIdGet.model_json_schema()["examples"], | ||
| ) |
48 changes: 48 additions & 0 deletions
48
packages/pytest-simcore/src/pytest_simcore/helpers/storage_rpc_server.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,48 @@ | ||
| # pylint: disable=no-self-use | ||
| # pylint: disable=not-context-manager | ||
| # pylint: disable=protected-access | ||
| # pylint: disable=redefined-outer-name | ||
| # pylint: disable=unused-argument | ||
| # pylint: disable=unused-variable | ||
|
|
||
|
|
||
| from typing import Literal | ||
|
|
||
| from models_library.api_schemas_rpc_async_jobs.async_jobs import ( | ||
| AsyncJobFilter, | ||
| AsyncJobGet, | ||
| ) | ||
| from models_library.api_schemas_webserver.storage import PathToExport | ||
| from models_library.products import ProductName | ||
| from models_library.users import UserID | ||
| from pydantic import TypeAdapter, validate_call | ||
| from pytest_mock import MockType | ||
| from servicelib.rabbitmq._client_rpc import RabbitMQRPCClient | ||
|
|
||
|
|
||
| class StorageSideEffects: | ||
| # pylint: disable=no-self-use | ||
| @validate_call(config={"arbitrary_types_allowed": True}) | ||
| async def start_export_data( | ||
| self, | ||
| rabbitmq_rpc_client: RabbitMQRPCClient | MockType, | ||
| *, | ||
| user_id: UserID, | ||
| product_name: ProductName, | ||
| paths_to_export: list[PathToExport], | ||
| export_as: Literal["path", "download_link"], | ||
| ) -> tuple[AsyncJobGet, AsyncJobFilter]: | ||
| assert rabbitmq_rpc_client | ||
| assert user_id | ||
| assert product_name | ||
| assert paths_to_export | ||
| assert export_as | ||
|
|
||
| async_job_get = TypeAdapter(AsyncJobGet).validate_python( | ||
| AsyncJobGet.model_json_schema()["examples"][0], | ||
| ) | ||
| async_job_filter = TypeAdapter(AsyncJobFilter).validate_python( | ||
| AsyncJobFilter.model_json_schema()["examples"][0], | ||
| ) | ||
|
|
||
| return async_job_get, async_job_filter |
36 changes: 36 additions & 0 deletions
36
.../service-library/src/servicelib/rabbitmq/rpc_interfaces/director_v2/computations_tasks.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,36 @@ | ||
| # pylint: disable=too-many-arguments | ||
| import logging | ||
|
|
||
| from models_library.api_schemas_directorv2 import ( | ||
| DIRECTOR_V2_RPC_NAMESPACE, | ||
| ) | ||
| from models_library.api_schemas_directorv2.computations import TaskLogFileIdGet | ||
| from models_library.projects import ProjectID | ||
| from models_library.rabbitmq_basic_types import RPCMethodName | ||
| from pydantic import TypeAdapter | ||
|
|
||
| from ....logging_utils import log_decorator | ||
| from ... import RabbitMQRPCClient | ||
|
|
||
| _logger = logging.getLogger(__name__) | ||
|
|
||
|
|
||
| _RPC_METHOD_NAME_ADAPTER: TypeAdapter[RPCMethodName] = TypeAdapter(RPCMethodName) | ||
|
|
||
|
|
||
| @log_decorator(_logger, level=logging.DEBUG) | ||
| async def get_computation_task_log_file_ids( | ||
| rabbitmq_rpc_client: RabbitMQRPCClient, *, project_id: ProjectID | ||
| ) -> list[TaskLogFileIdGet]: | ||
| """ | ||
| Raises: | ||
| ComputationalTaskMissingError | ||
| """ | ||
| result = await rabbitmq_rpc_client.request( | ||
| DIRECTOR_V2_RPC_NAMESPACE, | ||
| _RPC_METHOD_NAME_ADAPTER.validate_python("get_computation_task_log_file_ids"), | ||
bisgaard-itis marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| project_id=project_id, | ||
| ) | ||
| assert isinstance(result, list) # nosec | ||
| assert all(isinstance(item, TaskLogFileIdGet) for item in result) # nosec | ||
| return result | ||
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 |
|---|---|---|
| @@ -1 +1 @@ | ||
| 0.9.1 | ||
| 0.10.0 |
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.