Skip to content

Commit

Permalink
removed logs
Browse files Browse the repository at this point in the history
  • Loading branch information
LanderOtto committed Dec 11, 2023
1 parent fbb8674 commit dfe9bf7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 27 deletions.
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ omit = [
[tool.black]
exclude = "streamflow/cwl/antlr"

#[tool.pytest.ini_options]
#log_cli = true
#log_cli_level = "INFO"
#log_cli_format = "%(asctime)s [%(levelname)8s] %(message)s (%(filename)s:%(lineno)s)"
#log_cli_date_format = "%Y-%m-%d %H:%M:%S"
[tool.pytest.ini_options]
log_cli = true
log_cli_level = "INFO"
log_cli_format = "%(asctime)s [%(levelname)8s] %(message)s (%(filename)s:%(lineno)s)"
log_cli_date_format = "%Y-%m-%d %H:%M:%S"
3 changes: 0 additions & 3 deletions streamflow/deployment/connector/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ async def extract_tar_stream(
)
with open(path, "wb") as outputfile:
while content := await inputfile.read(transferBufferSize):
logger.info(
f"content {content}, inputfile.offset: {inputfile.offset}, tar: {tar.offset}"
)
outputfile.write(content)

# Otherwise, if copying a directory, modify the member path to
Expand Down
22 changes: 3 additions & 19 deletions streamflow/deployment/connector/ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,6 @@ def __init__(
async def _copy_local_to_remote_single(
self, src: str, dst: str, location: Location, read_only: bool = False
):
# logger.info(f"Copying single local to remote {location} -> {src} to {dst}")
async with self._get_data_transfer_process(
location=location.name,
command="tar xf - -C /",
Expand All @@ -330,17 +329,14 @@ async def _copy_local_to_remote_single(
encoding=None,
) as proc:
try:
# logger.info("Open write waiting remote data")
async with aiotarstream.open(
stream=StreamWriterWrapper(proc.stdin),
format=tarfile.GNU_FORMAT,
mode="w",
dereference=True,
copybufsize=self.transferBufferSize,
) as tar:
# logger.info("Start l-to-r copy")
await tar.add(src, arcname=dst)
# logger.info("End l-to-r copy")
except tarfile.TarError as e:
raise WorkflowExecutionException(
f"Error copying {src} to {dst} on location {location}: {e}"
Expand All @@ -349,7 +345,6 @@ async def _copy_local_to_remote_single(
async def _copy_remote_to_local(
self, src: str, dst: str, location: Location, read_only: bool = False
) -> None:
# logger.info(f"Copying remote {location} to local -> {src} to {dst}")
dirname, basename = posixpath.split(src)
async with self._get_data_transfer_process(
location=location.name,
Expand All @@ -358,15 +353,12 @@ async def _copy_remote_to_local(
encoding=None,
) as proc:
try:
# logger.info("Open reader waiting remote data")
async with aiotarstream.open(
stream=StreamReaderWrapper(proc.stdout),
mode="r",
copybufsize=self.transferBufferSize,
) as tar:
# logger.info("Start r-to-l copy")
await extract_tar_stream(tar, src, dst, self.transferBufferSize)
# logger.info("End r-to-l copy")
except tarfile.TarError as e:
raise WorkflowExecutionException(
f"Error copying {src} from location {location} to {dst}: {e}"
Expand All @@ -381,9 +373,6 @@ async def _copy_remote_to_remote(
source_connector: Connector | None = None,
read_only: bool = False,
) -> None:
# logger.info(
# f"Copying remote {source_location} to remote {locations} -> {src} to {dst}"
# )
source_connector = source_connector or self
if source_connector == self and source_location.name in [
loc.name for loc in locations
Expand Down Expand Up @@ -433,11 +422,9 @@ async def _copy_remote_to_remote(
)
)
# Multiplex the reader output to all the writers
# logger.info("Start r-to-r copying")
while content := await reader.read(
source_connector.transferBufferSize
):
# logger.info(f"iteration content: {content}")
for writer in writers:
writer.stdin.write(content)
await asyncio.gather(
Expand All @@ -446,7 +433,6 @@ async def _copy_remote_to_remote(
for writer in writers
)
)
# logger.info("End r-to-r copy")

def _get_command(
self,
Expand Down Expand Up @@ -674,11 +660,9 @@ async def get_available_locations(
) -> MutableMapping[str, AvailableLocation]:
locations = {}
for location_obj in self.nodes.values():
inpdir, outdir, tmpdir = await asyncio.gather(
self._get_existing_parent(location_obj.hostname, input_directory),
self._get_existing_parent(location_obj.hostname, output_directory),
self._get_existing_parent(location_obj.hostname, tmp_directory),
)
inpdir = await self._get_existing_parent(location_obj.hostname, input_directory)
outdir = await self._get_existing_parent(location_obj.hostname, output_directory)
tmpdir = await self._get_existing_parent(location_obj.hostname, tmp_directory)
hardware = await self._get_location_hardware(
location=location_obj.hostname,
input_directory=inpdir,
Expand Down

0 comments on commit dfe9bf7

Please sign in to comment.