Skip to content

Commit 9f9e8d5

Browse files
committed
Simplifies and resolves some issues. Tidies up code.
Signed-off-by: adamrtalbot <[email protected]>
1 parent 898c411 commit 9f9e8d5

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

plugins/nf-azure/src/main/nextflow/cloud/azure/batch/AzBatchExecutor.groovy

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,20 +100,18 @@ class AzBatchExecutor extends Executor implements ExtensionPoint {
100100
log.debug "[AZURE BATCH] Pool allocation mode determined as: ${poolAllocationMode}"
101101

102102
if( poolAllocationMode == 'BATCH_SERVICE' || poolAllocationMode == 'BatchService' ) {
103-
throw new AbortOperationException("Azure Low Priority VMs are deprecated and no longer supported for Batch Managed pool allocation mode. " +
104-
"Please update your configuration to use standard VMs instead, or migrate to User Subscription pool allocation mode. " +
105-
"Affected pools: ${poolNames}. " +
106-
"Remove 'lowPriority: true' from your pool configuration or set 'lowPriority: false'.")
103+
throw new AbortOperationException(
104+
"Low Priority VMs are not supported with Batch Managed pool allocation mode. " +
105+
"Update your configuration to use standard VMs or switch to User Subscription mode. " +
106+
"Pools: ${poolNames}."
107+
)
107108
} else if( poolAllocationMode == 'USER_SUBSCRIPTION' || poolAllocationMode == 'UserSubscription' ) {
108109
// Low Priority VMs are still supported in User Subscription mode, proceed without warning
109110
log.debug "[AZURE BATCH] User Subscription mode detected, allowing low priority VMs in pools: ${poolNames}"
110111
} else {
111112
// If we can't determine the pool allocation mode, show a warning but allow execution
112-
log.warn "[AZURE BATCH] Unable to determine pool allocation mode (got: ${poolAllocationMode}). " +
113-
"Low Priority VMs are configured in pools: ${poolNames}. " +
114-
"Please note that Low Priority VMs are deprecated in Batch Managed accounts. " +
115-
"If you're using a Batch Managed account, please update your configuration to use standard VMs. " +
116-
"To enable automatic detection, set azure.batch.subscriptionId in your config or AZURE_SUBSCRIPTION_ID environment variable."
113+
log.warn "[AZURE BATCH] Unable to determine pool allocation mode. Low Priority VMs are configured in pools: ${poolNames}. " +
114+
"Low Priority VMs may not be supported. Set 'azure.batch.subscriptionId' in your config or 'AZURE_SUBSCRIPTION_ID' environment variable for automatic detection."
117115
}
118116
}
119117
}

plugins/nf-azure/src/main/nextflow/cloud/azure/batch/AzBatchService.groovy

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,9 +453,10 @@ class AzBatchService implements Closeable {
453453
* Create and configure BatchManager
454454
*/
455455
private com.azure.resourcemanager.batch.BatchManager createBatchManager(TokenCredential credential, String subscriptionId) {
456-
// AzureProfile constructor: (tenantId, subscriptionId, environment)
456+
// AzureProfile requires: (tenantId, subscriptionId, environment)
457+
// We pass null for tenantId to use the default from the credential
457458
final profile = new com.azure.core.management.profile.AzureProfile(
458-
null, // tenantId - null to use default
459+
null,
459460
subscriptionId,
460461
com.azure.core.management.AzureEnvironment.AZURE
461462
)

plugins/nf-azure/src/test/nextflow/cloud/azure/batch/AzBatchExecutorTest.groovy

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class AzBatchExecutorTest extends Specification {
2727
and:
2828
def config = new AzConfig(CONFIG)
2929
def batchService = Mock(AzBatchService) {
30-
getPoolAllocationMode() >> 'BATCH_SERVICE'
30+
getPoolAllocationMode() >> 'BatchService'
3131
}
3232

3333
and:
@@ -40,7 +40,8 @@ class AzBatchExecutorTest extends Specification {
4040

4141
then:
4242
def e = thrown(AbortOperationException)
43-
e.message.contains('Azure Low Priority VMs are deprecated and no longer supported for Batch Managed pool allocation mode')
43+
e.message.contains('Low Priority VMs are not supported with Batch Managed pool allocation mode')
44+
e.message.contains('Update your configuration to use standard VMs or switch to User Subscription mode')
4445
e.message.contains('pool1')
4546
}
4647

@@ -58,7 +59,7 @@ class AzBatchExecutorTest extends Specification {
5859
and:
5960
def config = new AzConfig(CONFIG)
6061
def batchService = Mock(AzBatchService) {
61-
getPoolAllocationMode() >> 'USER_SUBSCRIPTION'
62+
getPoolAllocationMode() >> 'UserSubscription'
6263
}
6364

6465
and:
@@ -117,7 +118,7 @@ class AzBatchExecutorTest extends Specification {
117118
and:
118119
def config = new AzConfig(CONFIG)
119120
def batchService = Mock(AzBatchService) {
120-
getPoolAllocationMode() >> 'BATCH_SERVICE'
121+
getPoolAllocationMode() >> 'BatchService'
121122
}
122123

123124
and:

0 commit comments

Comments
 (0)