Skip to content

Commit a8c7c35

Browse files
committed
Delete old runs
1 parent 5dcf568 commit a8c7c35

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

v03_pipeline/lib/tasks/delete_old_runs.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,5 @@ def run(self) -> None:
4848
# Delete run dirs until we encounter the first of the N successful runs to keep.
4949
oldest_successful_run_index = run_dir_paths.index(successful_run_dir_paths[-MIN_SUCCESSFUL_RUNS])
5050
for run_dir_path in run_dir_paths[:oldest_successful_run_index]:
51-
# NB: our existing GCSorLocalTarget does not work here because
52-
# the LocalTarget API does not support removing directories.
53-
if run_dir_path.startswith('gs://'):
54-
gcs.GCSTarget(pathname).remove(recursive=True)
55-
else:
56-
shutil.rmtree(run_dir_path)
51+
GCSorLocalTarget(run_dir_path.replace('file:', '')).remove()
5752
self._complete = True

v03_pipeline/lib/tasks/delete_old_runs_test.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,12 @@ def test_leave_incomplete_runs(self) -> None:
103103
)
104104
self.assertFalse(
105105
hl.hadoop_exists(
106-
runs_path(
107-
ReferenceGenome.GRCh38,
108-
DatasetType.SNV_INDEL,
109-
),
110-
'manual__2024-01-05'
106+
os.path.join(
107+
runs_path(
108+
ReferenceGenome.GRCh38,
109+
DatasetType.SNV_INDEL,
110+
),
111+
'manual__2024-01-05',
112+
)
111113
)
112114
)

0 commit comments

Comments
 (0)