From 342b2f98ff293844d222b8e1dfb91dc5d8fba129 Mon Sep 17 00:00:00 2001 From: levisingularity Date: Fri, 22 Nov 2024 00:45:25 -0300 Subject: [PATCH] das-toolbox-136: Fix dbms-peer was not loaded into the database connected to das-peer --- .../dbms_adapter/dbms_adapter_module.py | 8 ++++++- .../dbms_peer/dbms_peer_container_manager.py | 22 ++++++++++--------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/commands/dbms_adapter/dbms_adapter_module.py b/src/commands/dbms_adapter/dbms_adapter_module.py index 6365696..0d549ae 100644 --- a/src/commands/dbms_adapter/dbms_adapter_module.py +++ b/src/commands/dbms_adapter/dbms_adapter_module.py @@ -91,5 +91,11 @@ def _dbms_peer_container_manager_factory( self, ) -> DbmsPeerContainerManager: container_name = self._settings.get("dbms_peer.container_name") + adapter_server_port = 30100 - return DbmsPeerContainerManager(container_name) + return DbmsPeerContainerManager( + container_name, + options={ + "das_peer_port": adapter_server_port, + }, + ) diff --git a/src/commands/dbms_adapter/dbms_peer/dbms_peer_container_manager.py b/src/commands/dbms_adapter/dbms_peer/dbms_peer_container_manager.py index adeed0f..606d2bf 100644 --- a/src/commands/dbms_adapter/dbms_peer/dbms_peer_container_manager.py +++ b/src/commands/dbms_adapter/dbms_peer/dbms_peer_container_manager.py @@ -85,19 +85,21 @@ def start_container( context_target_path, ] + volumes = { + file.name: { + "bind": secrets_target_path, + "mode": "ro", + }, + context: { + "bind": context_target_path, + "mode": "ro", + }, + } + container = self._start_container( command=command_params, network_mode="host", - volumes={ - file.name: { - "bind": secrets_target_path, - "mode": "ro", - }, - context: { - "bind": context_target_path, - "mode": "ro", - }, - }, + volumes=volumes, ) self.logs()