Skip to content

Commit

Permalink
Fixes after testing.
Browse files Browse the repository at this point in the history
Signed-off-by: Revital Sur <eres@il.ibm.com>
  • Loading branch information
revit13 committed Feb 5, 2023
1 parent ce92168 commit dab7198
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion abm/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def filter_reply(self, lines, batch_size=100):
'''
def run_container(self, command):
volumes=[self.workdir + ':' + MOUNTDIR]
return super().run_container(command, self.connector, volumes, remove=True, detach=True, stream=True)
return super().run_container(command, self.connector, volumes=volumes, remove=True, detach=False, stream=True)

def open_socket_to_container(self, command):
volumes=[self.workdir + ':' + MOUNTDIR]
Expand Down
5 changes: 3 additions & 2 deletions abm/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@ def name_in_container(self, path, mountdir):
Run a docker container from the connector image.
Mount the workdir on /local. Remove the container after done.
'''
def run_container(self, command, image, volumes, environment=None, remove=True, detach=True, stream=True, init=False):
def run_container(self, command, image, volumes, environment=None, remove=True, detach=False, stream=True, init=False):
self.logger.debug("running command: " + command)
try:
_ = self.client.containers.run(image, volumes=volumes, network_mode='host',
reply = self.client.containers.run(image, volumes=volumes, network_mode='host',
environment=environment,
command=command, init=init, stream=stream, remove=remove, detach=detach)
return self.filter_reply(reply)
except docker.errors.DockerException as e:
self.logger.error('Running of docker container failed',
extra={'error': str(e)})
Expand Down
5 changes: 4 additions & 1 deletion abm/normalization.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def __init__(self, config, logger, workdir, asset_name=""):
def run_container(self, command):
volumes=[self.workdir + ':' + MOUNTDIR]
environment=["DEPLOYMENT_MODE=OSS", "AIRBYTE_ROLE=", "WORKER_ENVIRONMENT=DOCKER", "AIRBYTE_VERSION=" + self.airbyte_version]
super().run_container(command, self.normalization_image, volumes, environment, remove=True, detach=True, stream=True, init=True)
super().run_container(command, self.normalization_image, volumes, environment, remove=True, stream=True, init=True)

'''
Creates a normalization command
Expand All @@ -39,3 +39,6 @@ def create_normalization_command(self, catalog, config):
self.integration_type

return command

def filter_reply(self, reply):
return reply

0 comments on commit dab7198

Please sign in to comment.