Skip to content

Commit

Permalink
Merge branch 'main' of github.com:lilab-bcb/altocumulus
Browse files Browse the repository at this point in the history
  • Loading branch information
yihming committed Aug 23, 2024
2 parents 3a1b92b + aedf3f9 commit ff46d08
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
# - id: double-quote-string-fixer # for single quotes: uncomment and add black config “skip-string-normalization”
- id: trailing-whitespace
Expand All @@ -11,14 +11,14 @@ repos:
- id: docformatter
args: ["--in-place", "--wrap-summaries=100", "--wrap-descriptions=100", "--config=./pyproject.toml"]
- repo: https://github.com/psf/black
rev: 23.12.1
rev: 24.4.2
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/csachs/pyproject-flake8
rev: v6.1.0
rev: v7.0.0
hooks:
- id: pyproject-flake8
13 changes: 7 additions & 6 deletions alto/commands/parse_monitoring_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,12 @@ def execute(input_path, report_filename, plot_filename=None):
results = []
for i in range(len(log_paths)):
log_path = log_paths[i]

task, shard = get_task_and_shard(log_path) if is_dir else None, None
result = parse_log(
scheme + "://" + log_path,
details=generate_plot,
)
if task is not None:
if is_dir:
task, shard = get_task_and_shard(log_path)
result["task"] = task
result["shard"] = shard

Expand All @@ -88,21 +87,23 @@ def _figsize(nrow=1, ncol=1, aspect=1, size=3):
def get_task_and_shard(log_path):
p = Path(log_path)
shard_name = p.parent.name
if shard_name == "cacheCopy" or shard_name.startswith("attempt-") or shard_name == "execution":
if shard_name.startswith("attempt-") or shard_name in ("execution", "cacheCopy", "work"):
p = p.parent
shard_name = p.parent.name

if shard_name.startswith("shard-"):
if shard_name.startswith("shard-") or shard_name.isdigit():
task_name = p.parent.parent.name

else:
task_name = shard_name
shard_name = ""

if task_name.startswith("call-"):
task_name = task_name[len("call-") :]
elif task_name.endswith("_monitoring_log"):
task_name = task_name[: -len("_monitoring_log")]
# gs://output/cromwell_execution/xxx_workflow/92f48dc5-6/call-xxx_task/shard-0/monitoring.log
# gs://output/cromwell_execution/xxx_workflow/92f48dc5-6/call-xxx_task/shard-0/cacheCopy/monitoring.log
# aws-omics: task_monitoring_log/0/monitoring.log
return task_name, shard_name


Expand Down

0 comments on commit ff46d08

Please sign in to comment.