-
Notifications
You must be signed in to change notification settings - Fork 700
Azure Batch worker pool supports managed identity #5670
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
Closed
adamrtalbot
wants to merge
16
commits into
nextflow-io:master
from
adamrtalbot:pass_managed_identity_client_id_to_azure_pool
Closed
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
6720dd8
feat: Azure Batch worker pool supports managed identity
adamrtalbot e3653df
Merge branch 'master' into pass_managed_identity_client_id_to_azure_pool
adamrtalbot cb57238
docs
adamrtalbot 7110d6d
Support for using azcopy with managed identity
adamrtalbot 8d28def
Use native AZ_BATCH_TASK_DIR instead of $PWD for azcopy files and bin/
adamrtalbot ae76265
Merge branch 'master' into pass_managed_identity_client_id_to_azure_pool
adamrtalbot 8d3a663
Merge branch 'master' into pass_managed_identity_client_id_to_azure_pool
adamrtalbot 327d2a9
Merge branch 'master' into pass_managed_identity_client_id_to_azure_pool
adamrtalbot f7719ca
Pass MSI ID to Fusion
adamrtalbot c93dc78
Add some Fusion debugging
adamrtalbot 41917b9
Only create SAS token when not using managed identity in the poolOpts
adamrtalbot 5547cd3
Add tests for AzureBatchFusionAdapter and AzFusionEnv
adamrtalbot 2acf857
Rename classes to be more explicit about their Azure specificity
adamrtalbot 4f43aa5
Compare scripts directly ignoring indentation, should make tests quic…
adamrtalbot da73b70
code tidy
adamrtalbot 29524a4
Merge branch 'master' into pass_managed_identity_client_id_to_azure_pool
adamrtalbot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
plugins/nf-azure/src/main/nextflow/cloud/azure/batch/AzFusionTaskWrapper.groovy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* | ||
* Copyright 2021, Microsoft Corp | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package nextflow.cloud.azure.batch | ||
|
||
import groovy.transform.CompileStatic | ||
import groovy.util.logging.Slf4j | ||
import nextflow.executor.Executor | ||
import nextflow.fusion.FusionAwareTask | ||
import nextflow.fusion.FusionConfig | ||
import nextflow.fusion.FusionScriptLauncher | ||
import nextflow.processor.TaskRun | ||
|
||
/** | ||
* Adapter class that wraps a TaskRun to implement the FusionAwareTask interface | ||
* | ||
* @author Paolo Di Tommaso <paolo.ditommaso@gmail.com> | ||
*/ | ||
@Slf4j | ||
@CompileStatic | ||
class AzFusionTaskWrapper implements FusionAwareTask { | ||
|
||
private TaskRun task | ||
private FusionScriptLauncher fusionLauncher | ||
private Boolean fusionEnabled | ||
|
||
AzFusionTaskWrapper(TaskRun task) { | ||
this.task = task | ||
} | ||
|
||
@Override | ||
TaskRun getTask() { | ||
return task | ||
} | ||
|
||
@Override | ||
boolean fusionEnabled() { | ||
return true // Always true since we only create this wrapper when fusion is enabled | ||
} | ||
|
||
@Override | ||
FusionConfig fusionConfig() { | ||
return FusionConfig.getConfig() | ||
} | ||
|
||
@Override | ||
FusionScriptLauncher fusionLauncher() { | ||
if (fusionLauncher == null) { | ||
fusionLauncher = FusionScriptLauncher.create(task.toTaskBean(), task.workDir.scheme) | ||
} | ||
return fusionLauncher | ||
} | ||
|
||
@Override | ||
List<String> fusionSubmitCli() { | ||
return fusionLauncher().fusionSubmitCli(task) | ||
} | ||
} |
65 changes: 65 additions & 0 deletions
65
plugins/nf-azure/src/main/nextflow/cloud/azure/batch/AzTaskBean.groovy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* Copyright 2021, Microsoft Corp | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package nextflow.cloud.azure.batch | ||
|
||
import groovy.transform.CompileStatic | ||
import nextflow.cloud.azure.config.AzPoolOpts | ||
import nextflow.processor.TaskBean | ||
import nextflow.processor.TaskRun | ||
|
||
/** | ||
* Azure extension of the TaskBean that includes Azure Batch pool options | ||
* | ||
* @author Paolo Di Tommaso <paolo.ditommaso@gmail.com> | ||
*/ | ||
@CompileStatic | ||
class AzTaskBean extends TaskBean { | ||
|
||
/** | ||
* The Azure pool options that apply to this task | ||
*/ | ||
final AzPoolOpts poolOpts | ||
|
||
/** | ||
* Create a new Azure TaskBean from a TaskRun with pool options | ||
* | ||
* @param task The TaskRun to get base configuration from | ||
* @param poolOpts The Azure pool options | ||
*/ | ||
AzTaskBean(TaskRun task, AzPoolOpts poolOpts) { | ||
super(task) | ||
this.poolOpts = poolOpts | ||
} | ||
|
||
/** | ||
* Get the Azure pool options | ||
* | ||
* @return The Azure pool options | ||
*/ | ||
AzPoolOpts getPoolOpts() { | ||
return poolOpts | ||
} | ||
|
||
/** | ||
* Get the managed identity client ID if configured | ||
* | ||
* @return The managed identity client ID or null if not configured | ||
*/ | ||
String getManagedIdentityId() { | ||
return poolOpts?.managedIdentityId | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These looks unrelated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what makes azcopy work.
The first iteration of this PR did not include Fusion.