Skip to content

feat(aspen): port CARLISLE structured logging, state markers, and jobby integration - #119

Open
kopardev wants to merge 2 commits into
mainfrom
issue_118
Open

feat(aspen): port CARLISLE structured logging, state markers, and jobby integration#119
kopardev wants to merge 2 commits into
mainfrom
issue_118

Conversation

@kopardev

@kopardev kopardev commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Changes

Port structured logging and UX improvements from CARLISLE's carlisle wrapper to ASPEN's aspen CLI script.

Phase 1 – Logging layer + cosmetic cleanup

  • Add 7 log functions: log_info, log_step, log_ok, log_warn, log_error, log_next, log_divider
  • Replace the noisy err() ASCII-art heredoc with a clean log_error "$@"; exit 1
  • Replace all raw echo calls in init(), preruncleanup(), reconfig(), set_singularity_binds(), dryrun(), runlocal(), runslurm(), run() local branch, reset(), and main()
  • dryrun() now prints log_ok + log_next guidance on completion

Phase 2 – Pre-run summary + print_versions()

  • New print_versions() function prints Snakemake and Singularity versions with OK/WARN status
  • runslurm() and runlocal() print a structured pre-run summary (mode, workdir, genome, log file, singularity cache) before launching

Phase 3 – Pipeline state markers + SIGTERM trap + jobby

  • New json_escape(), write_pipeline_state_marker(), and run_jobby_best_effort() functions
  • write_pipeline_state_marker() writes pipeline.{running,completed,failed,canceled} marker files and a pipeline.status.json sidecar in WORKDIR for machine-readable status tracking
  • submit_script.sbatch now embeds inline _write_pipeline_state_marker(), SIGTERM/SIGINT traps, ${PIPESTATUS[0]} exit-code capture, jobby post-run call (module load ccbrpipeliner fallback), and proper success/failure state writes
  • Stale-script guard: old submit_script.sbatch files lacking state marker logic are backed up and regenerated automatically
  • sbatch --parsable captures SLURM job ID; log_next guidance printed after submission (squeue, tail -f snakemake.log, pipeline.* status, sidecar path)

Issues

Closes #118

PR Checklist

  • This comment contains a description of changes with justifications, with any relevant issues linked.
  • Update docs if there are any API changes. (no API changes; this is CLI cosmetic/logging only)
  • Update CHANGELOG.md with a short description of any user-facing changes and reference the PR number. Guidelines: https://keepachangelog.com/en/1.1.0/
  • Test run completes successfully on biowulf.

…by integration

Phase 1 – Logging layer + cosmetic cleanup:
- Add log_info, log_step, log_ok, log_warn, log_error, log_next, log_divider functions
- Replace noisy err() ASCII-art heredoc with clean log_error + exit
- Replace all raw echo calls in init(), preruncleanup(), reconfig(),
  set_singularity_binds(), dryrun(), runlocal(), runslurm(), run() local
  branch, reset(), and main()
- dryrun() restructured to print log_ok/log_next guidance on completion

Phase 2 – Pre-run summary + print_versions():
- Add print_versions() printing Snakemake and Singularity versions with
  OK/WARN status
- runslurm() and runlocal() now print structured pre-run summary (mode,
  workdir, genome, log file, singularity cache) before launching

Phase 3 – Pipeline state markers + SIGTERM trap + jobby:
- Add json_escape() and write_pipeline_state_marker() to write
  pipeline.{running,completed,failed,canceled} marker files and a
  pipeline.status.json sidecar in WORKDIR
- write_pipeline_state_marker() called from runslurm() before and after
  sbatch submission
- submit_script.sbatch now embeds _write_pipeline_state_marker() inline,
  SIGTERM/SIGINT traps, snakemake exit-code capture via PIPESTATUS[0],
  jobby post-run call (with module load ccbrpipeliner fallback), and proper
  success/failure state marker writes
- Stale-script guard: if existing submit_script.sbatch lacks state marker
  logic, it is backed up and regenerated automatically
- Add run_jobby_best_effort() for best-effort jobby generation on
  submission failure
- sbatch submission now uses --parsable to capture SLURM job ID; emits
  log_next guidance (squeue, tail -f, pipeline.* status, sidecar path)

Closes #118
@github-actions github-actions Bot added the ASPEN RepoName label Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ASPEN RepoName

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: port CARLISLE logging and aesthetic improvements to aspen CLI script

1 participant