Skip to content

Fix Azure Batch startTask.script not executing when copyToolInstallMode=node#6864

Open
adamrtalbot wants to merge 2 commits intomasterfrom
fix/azure-batch-starttask-fix
Open

Fix Azure Batch startTask.script not executing when copyToolInstallMode=node#6864
adamrtalbot wants to merge 2 commits intomasterfrom
fix/azure-batch-starttask-fix

Conversation

@adamrtalbot
Copy link
Collaborator

Summary

Fixes #6863

  • Combines azcopy install and user script into a single bash -c invocation instead of joining two separate bash -c commands with &&
  • The previous approach (bash -c "..." && bash -c '...') caused the shell to misinterpret the command boundary due to mixed quoting, silently dropping the user's startTask.script
  • Now collects raw shell commands, joins with &&, and wraps once: bash -c 'cmd1 && cmd2'

Changes

AzBatchService.groovy

  • createStartTask(): collect raw commands (without individual bash -c wrappers), combine into a single bash -c '...' invocation with proper single-quote escaping

AzBatchServiceTest.groovy

  • Updated 2 existing test expectations to match new single-invocation format
  • Added new test for combined azcopy + quoted user script scenario

Testing

  • All 88 existing AzBatchServiceTest tests pass
  • Manually verified on Azure Batch: startTask.script now executes correctly alongside azcopy install

@netlify
Copy link

netlify bot commented Feb 25, 2026

Deploy Preview for nextflow-docs-staging canceled.

Name Link
🔨 Latest commit a0266f8
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/69a08fcf12b2400008f4a89d

…de=node (#6863)

Combine azcopy install and user script into a single bash -c invocation
instead of joining two separate bash -c commands with &&, which caused
the shell to misinterpret the command boundary and silently drop the
user script.

Generated by Claude Code

Signed-off-by: adamrtalbot <12817534+adamrtalbot@users.noreply.github.com>
…rapping

The createStartTask method wraps the user script in bash -c '...' but
escaped single quotes by replacing ' with '' (two empty strings in bash)
instead of the correct '\'' idiom (end quote, escaped literal quote,
start quote). This caused scripts containing single quotes to be
misparsed, silently breaking commands while the startTask still exited 0.

Generated by Claude Code

Signed-off-by: adamrtalbot <12817534+adamrtalbot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Azure Batch: custom startTask.script never executes when copyToolInstallMode = 'node'

2 participants