Skip to content

Conversation

@tcrespog
Copy link
Contributor

@tcrespog tcrespog commented Mar 11, 2025

Description

  • Replicate behaviour found in the GUI, which sets the value of the pre-run and post-run scripts to those of the CE if they are undefined.
  • Consider empty strings to be undefined values (equivalent to null).

Guidelines for testing

  • Using the CLI, launch a pipeline with pre-run script, post-run script and Nextflow config defined: the values of the pipeline are the ones that are taken into account.
  • Using the CLI, launch a pipeline with pre-run script, post-run script and Nextflow config defined using a CE that also has pre-run script, post-run script and Nextflow config defined: the values of the pipeline are the ones that are taken into account.
export TOWER_API_ENDPOINT=...
export TOWER_WORKSPACE_ID=...
export TOWER_ACCESS_TOKEN=...

tw launch --compute-env my-compute-env my-pipeline
  • Using the CLI, launch a pipeline without pre-run script, post-run script and Nextflow config defined using a CE that also has pre-run script, post-run script and Nextflow config defined: the values of the CE are the ones that are taken into account.

@tcrespog tcrespog self-assigned this Mar 11, 2025
@daria-seqera
Copy link

Hm, I've been trying to test this behaviour locally, however it works for me even before this fix (tried both the natively-compiled version from master and the linux one from the latest release).
What I'm doing is to run the following command:

TOWER_API_ENDPOINT=http://localhost:8080 ./tw --insecure launch test-cli-ce-pre-post --post-run=../pre-run-sh

test-cli-ce-pre-post has both scripts defined in the CE, and I can see that the post-run is being overwritten by my argument

Also, I wasn't sure whether you meant that the scripts are defined when you add a pipeline, or when you launch it, so I tested the other scenario too, where I have the scripts defined in the CE, and then overwritten when adding the pipeline. Not providing parameters from the cli:

TOWER_API_ENDPOINT=http://localhost:8080 ./tw --insecure launch test-ce-pre-post-redefined

and it also worked correctly.

What am I missing?

Copy link
Contributor

@weronikasosnowskaseqera weronikasosnowskaseqera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @tcrespog do we want to move this forward?

@tcrespog
Copy link
Contributor Author

Hey @tcrespog do we want to move this forward?

Hi, @weronikasosnowskaseqera. I realized that the nextflowConfig field has the same behaviour as preRunScript and postRunScript; however, nextflowConfig is not present among the class fields, so it requires an explicit update of the SDK. I was planning to do that, but had to address other matters.

@georgi-seqera
Copy link
Contributor

Hey @tcrespog - I have a PR with another version bump of the tower-java-sdk to a version that would supersede the one in this PR.
Would that be safe to merge without this PR or is this one a prerequisite to be merged in first?
The changes in this one look backwards compatible to me, but double checking.

@tcrespog
Copy link
Contributor Author

Would that be safe to merge without this PR or is this one a prerequisite to be merged in first?

Hi, @georgi-seqera. It is okay if you merge yours first. Thank you.

@alvaromartmart
Copy link
Member

alvaromartmart commented Jun 4, 2025

@tcrespog merge conflict seems easy but can you check if additional changes are required to move this PR forward?

@tcrespog tcrespog merged commit 38c325e into master Jun 26, 2025
12 checks passed
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

Successfully merging this pull request may close these issues.

8 participants