Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a unified start timestamp for scripts and config files #5244

Open
bentsherman opened this issue Aug 21, 2024 · 0 comments
Open

Provide a unified start timestamp for scripts and config files #5244

bentsherman opened this issue Aug 21, 2024 · 0 comments

Comments

@bentsherman
Copy link
Member

The nf-core pipeline template uses a custom timestamp in the various report file names:

def trace_timestamp = new java.util.Date().format( 'yyyy-MM-dd_HH-mm-ss')
timeline {
    enabled = true
    file    = "${params.outdir}/pipeline_info/execution_timeline_${trace_timestamp}.html"
}
report {
    enabled = true
    file    = "${params.outdir}/pipeline_info/execution_report_${trace_timestamp}.html"
}
// ...

This is problematic because the new config parser does not support top-level variable declarations like this.

The quick solution is to copy the timestamp expression into each report filename. But then there is a small chance that some report filenames might differ by one second since the timestamp is computed multiple times.

The deeper problem I think is that there is not a single start timestamp that can be used across all scripts and configs.

There is workflow.start:

But the default report file names use a different timestamp:

static final public String DEF_FILE_NAME = "report-${TraceHelper.launchTimestampFmt()}.html"

It should be possible to define a single timestamp that can be exposed to config files and also used by workflow.start. It would be another implicit config variable such as launchTime.

We could also try to expose the entire workflow variable, but it isn't resolved until later on, so we would have to do some config parser magic to lazy-evaluate expressions that use the workflow variable.

cc @ewels @pditommaso for your four cents

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant