|
67 | 67 | get_projects_networks_containers, |
68 | 68 | remove_dynamic_sidecar_network, |
69 | 69 | remove_dynamic_sidecar_stack, |
70 | | - remove_volumes_from_node, |
71 | 70 | try_to_remove_network, |
72 | 71 | ) |
73 | 72 | from ...errors import EntrypointContainerNotFoundError |
74 | | -from ...volumes import DY_SIDECAR_SHARED_STORE_PATH, DynamicSidecarVolumesPathsResolver |
| 73 | +from ...volumes_removal import remove_volumes_from_node |
75 | 74 |
|
76 | 75 | if TYPE_CHECKING: |
77 | 76 | # NOTE: TYPE_CHECKING is True when static type checkers are running, |
@@ -230,29 +229,13 @@ async def service_remove_sidecar_proxy_docker_networks_and_volumes( |
230 | 229 | task_progress.update( |
231 | 230 | message="removing volumes", percent=ProgressPercent(0.3) |
232 | 231 | ) |
233 | | - unique_volume_names = [ |
234 | | - DynamicSidecarVolumesPathsResolver.source( |
235 | | - path=volume_path, |
236 | | - node_uuid=scheduler_data.node_uuid, |
237 | | - run_id=scheduler_data.run_id, |
238 | | - ) |
239 | | - for volume_path in [ |
240 | | - DY_SIDECAR_SHARED_STORE_PATH, |
241 | | - scheduler_data.paths_mapping.inputs_path, |
242 | | - scheduler_data.paths_mapping.outputs_path, |
243 | | - *scheduler_data.paths_mapping.state_paths, |
244 | | - ] |
245 | | - ] |
246 | | - with log_context( |
247 | | - _logger, logging.DEBUG, f"removing volumes via service for {node_uuid}" |
248 | | - ): |
| 232 | + with log_context(_logger, logging.DEBUG, f"removing volumes '{node_uuid}'"): |
| 233 | + rabbitmq_client: RabbitMQClient = app.state.rabbitmq_client |
249 | 234 | await remove_volumes_from_node( |
250 | | - swarm_stack_name=swarm_stack_name, |
251 | | - volume_names=unique_volume_names, |
| 235 | + rabbitmq_client=rabbitmq_client, |
252 | 236 | docker_node_id=scheduler_data.dynamic_sidecar.docker_node_id, |
253 | | - user_id=scheduler_data.user_id, |
254 | | - project_id=scheduler_data.project_id, |
255 | | - node_uuid=scheduler_data.node_uuid, |
| 237 | + swarm_stack_name=swarm_stack_name, |
| 238 | + node_id=scheduler_data.node_uuid, |
256 | 239 | ) |
257 | 240 |
|
258 | 241 | _logger.debug( |
|
0 commit comments