From 9d5a282f8674c8b2564514b724d0e775fab0b1ac Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Wed, 10 Jul 2024 17:41:05 +0100 Subject: [PATCH] FIX: Disable `delete_local_files` by default and provide in config --- octue/configuration.py | 3 +++ octue/runner.py | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/octue/configuration.py b/octue/configuration.py index 4525a002b..25d061d8b 100644 --- a/octue/configuration.py +++ b/octue/configuration.py @@ -22,6 +22,7 @@ class ServiceConfiguration: :param str|None diagnostics_cloud_path: the path to a cloud directory to store diagnostics (this includes the configuration, input values and manifest, and logs for each question) :param iter(dict)|None service_registries: the names and endpoints of the registries used to resolve service revisions when asking questions; these should be in priority order (highest priority first) :param str|None event_store_table_id: the full ID of the Google BigQuery table used as the event store e.g. "your-project.your-dataset.your-table" + :param bool delete_local_files: if `True`, delete any files downloaded and temporary directories created during an analysis once it's finished :param str|None directory: if provided, find the app source, twine, and app configuration relative to this directory :return None: """ @@ -36,6 +37,7 @@ def __init__( diagnostics_cloud_path=None, service_registries=None, event_store_table_id=None, + delete_local_files=False, directory=None, **kwargs, ): @@ -44,6 +46,7 @@ def __init__( self.diagnostics_cloud_path = diagnostics_cloud_path self.service_registries = service_registries self.event_store_table_id = event_store_table_id + self.delete_local_files = delete_local_files if directory: directory = os.path.abspath(directory) diff --git a/octue/runner.py b/octue/runner.py index 64baf57ef..5625f3a1c 100644 --- a/octue/runner.py +++ b/octue/runner.py @@ -47,7 +47,7 @@ class Runner: :param str|None diagnostics_cloud_path: the path to a cloud directory to store diagnostics (this includes the configuration, input values and manifest, and logs for each question) :param str|None project_name: name of Google Cloud project to get credentials from :param str|None service_id: the ID of the service being run - :param bool delete_local_files: if `True`, delete any files downloaded during the call to `Runner.run` once the analysis has finished + :param bool delete_local_files: if `True`, delete any files downloaded and temporary directories created during an analysis once it's finished :return None: """ @@ -63,7 +63,7 @@ def __init__( project_name=None, service_id=None, service_registries=None, - delete_local_files=True, + delete_local_files=False, ): self.app_source = app_src self.children = children @@ -135,6 +135,7 @@ def from_configuration( "project_name": project_name, "service_id": service_id, "service_registries": service_configuration.service_registries, + "delete_local_files": service_configuration.delete_local_files, } inputs |= overrides