Skip to content

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

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

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

Conversation

@adamrtalbot
Copy link
Copy Markdown
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
Copy Markdown

netlify Bot commented Feb 25, 2026

Deploy Preview for nextflow-docs-staging canceled.

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

…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>
@adamrtalbot adamrtalbot force-pushed the fix/azure-batch-starttask-fix branch from 686f2d0 to a0266f8 Compare February 26, 2026 18:24
@pditommaso pditommaso force-pushed the master branch 2 times, most recently from d9fa5cd to d752bc2 Compare February 28, 2026 13:10
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