Closed omartin2010 closed 6 years ago
Hi @omartin2010, doAzureParallel currently doesn't support Virtual Machines within a VNET because we do not have support for AAD Authentication yet. Batch VNET access requires AAD Auth, and doAzureParallel uses SharedKey auth.
Did you simply set up your cluster using Batch API's and are trying to point doAzureParallel at it? Unless you followed pretty specific steps it may not work as expected since this is not a supported workflow.
@paselem : Is there a path forward for supporting the capability of running azure batch jobs with a VNet pool from R with user subscription mode. It is not clear if there is a way to register an App and use App API keys for authentication https://docs.microsoft.com/en-us/azure/batch/batch-aad-auth
@nkaul we are currently working in the plumbing to get doAzureParallel to support AAD Auth which will enable putting the clusters inside a VNET. We have never tested using UserSubscription mode, and it will not be officially supported for the time being, but it should work once we have AAD working. Is there any reason you're using UserSubscription mode instead of BatchService mode?
@paselem : I tried to use UserSubscription with hope of using AAD. Is there a timeline for AAD Auth support?
@nkaul As mentioned before we are actively developing the feature now. It is a major rewrite of some base packages though so it will take some more time. We are planning on having an initial branch "beta" release of this in about 2 weeks, and a proper supported release about 2 weeks after that.
Are you interested in testing out the "beta" release once it's available?
Also, just to reiterate my previous statement, we will not support UserSubscription Batch accounts, only BatchManaged accounts. Today, both account types support VNETs so that should hopefully not be a blocker for your workloads.
@paselem : I am definitely interested in testing out the beta release. Please inform me when it is available. UserSubscription Batch accounts should not be a blocker at this point in time.
@paselem : Do you have the beta version available to test?
@brnleehng - is the AAD branch stable enough for @nkaul to start testing on?
Hi @nkaul
The AAD branch is stable enough for usage. To install these branches, here's the command below.
devtools::install_github("Azure/rAzureBatch", ref = "feature/aad")
devtools::install_github("Azure/doAzureParallel", ref = "feature/aad")
Credentials File: There are multiple different changes in the credentials file for AAD. Provide a tenantId, clientId, and credentials of your AAD You will also need to supply both arm resource ids for the batch account and storage account.
{
"servicePrincipal": {
"tenantId": "Your tenant id",
"clientId": "Your client id",
"credential": "credential for AAD",
"batchAccountResourceId": "/subscriptions/SUBSCRIPTION_ID/resourceGroups/RESOURCE_GROUP_ID/providers/Microsoft.Batch/batchAccounts/BATCH_ACCOUNT_NAME",
"storageAccountResourceId": "/subscriptions/SUBSCRIPTION_ID/resourceGroups/RESOURCE_GROUP_ID/providers/Microsoft.Storage/storageAccounts/STORAGE_ACCOUNT_NAME"
},
"githubAuthenticationToken": "",
"dockerAuthentication": {
"username": "",
"password": "",
"registry": ""
}
}
Cluster Configuration File:
To enable virtual networks on the batch pool, provide a resource id to the subnetId
property in the cluster configuration file.
{
"name": "vnet",
"vmSize": "Standard_D2_v2",
"maxTasksPerNode": 1,
"poolSize": {
"dedicatedNodes": {
"min": 2,
"max": 2
},
"lowPriorityNodes": {
"min": 0,
"max": 0
},
"autoscaleFormula": "QUEUE"
},
"containerImage": "rocker/tidyverse:latest",
"rPackages": {
"cran": [],
"github": [],
"bioconductor": []
},
"commandLine": [],
"subnetId": "/subscriptions/****************/resourceGroups/*****/providers/Microsoft.Network/virtualNetworks/dazp/subnets/*********"
}
Let me know if you are running into any issues
Thanks! Brian
Hi @nkaul,
I was wondering if you are running into any issues. We are planning on merging this branch as soon as we are done testing.
Thanks! Brian
Closing issue: VNet and AAD branch has been merged #252
Before submitting a bug please check the following:
sessionInfo()
Description Hi, When I run a doAzureParallel job against a batch cluster that is defined as part of a VNet (see here : https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network), it turns out that the <- makeCluster step fails. I've turned on setVerbose(TRUE) before executing but don't get more useful output.
Instruction to repro the problem if applicable Steps to repro : create a batch account Manually create the job pool in the portal or otherwise so you can extract the keys using this : az batch account keys list -g RG_NAME -n _BATCH_ACCNT_NAME and put that value in credentials.json.
Execute the code
This is where it fails.
Adding sessionInfo() output :