Skip to content
This repository was archived by the owner on Oct 12, 2023. It is now read-only.

Commit 92dedd5

Browse files
authored
Merge pull request #41 from davidkydd/master
AAD and Batch Container Image support, prep for v0.23.0 release
2 parents 4d5c84b + b6c5642 commit 92dedd5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+5236
-727
lines changed

AzureBatchMaya.pyproj

Lines changed: 67 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010
<OutputPath>.</OutputPath>
1111
<Name>Maya.Client</Name>
1212
<RootNamespace>Maya.Client</RootNamespace>
13-
<InterpreterId>{a76b797f-9426-4cd7-a078-9af9c9e4b437}</InterpreterId>
14-
<InterpreterVersion>2.7</InterpreterVersion>
13+
<InterpreterId>
14+
</InterpreterId>
15+
<InterpreterVersion>
16+
</InterpreterVersion>
1517
<SearchPath>azure_batch_maya\scripts\;azure_batch_maya\scripts\ui\;tests\data\;tests\data\modules\</SearchPath>
1618
</PropertyGroup>
1719
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
@@ -34,9 +36,18 @@
3436
<Compile Include="azure_batch_maya\scripts\assets.py">
3537
<SubType>Code</SubType>
3638
</Compile>
39+
<Compile Include="azure_batch_maya\scripts\aadEnvironmentProvider.py">
40+
<SubType>Code</SubType>
41+
</Compile>
42+
<Compile Include="azure_batch_maya\scripts\poolImageProvider.py">
43+
<SubType>Code</SubType>
44+
</Compile>
3745
<Compile Include="azure_batch_maya\scripts\config.py">
3846
<SubType>Code</SubType>
3947
</Compile>
48+
<Compile Include="azure_batch_maya\scripts\poolImageFilter.py">
49+
<SubType>Code</SubType>
50+
</Compile>
4051
<Compile Include="azure_batch_maya\scripts\environment.py">
4152
<SubType>Code</SubType>
4253
</Compile>
@@ -59,9 +70,15 @@
5970
</Compile>
6071
<Compile Include="azure_batch_maya\scripts\tools\getpip.py" />
6172
<Compile Include="azure_batch_maya\scripts\tools\job_watcher.py" />
73+
<Compile Include="azure_batch_maya\scripts\tools\refreshsession.py">
74+
<SubType>Code</SubType>
75+
</Compile>
6276
<Compile Include="azure_batch_maya\scripts\ui\ui_assets.py">
6377
<SubType>Code</SubType>
6478
</Compile>
79+
<Compile Include="azure_batch_maya\scripts\ui\ui_containerImage.py">
80+
<SubType>Code</SubType>
81+
</Compile>
6582
<Compile Include="azure_batch_maya\scripts\ui\ui_config.py">
6683
<SubType>Code</SubType>
6784
</Compile>
@@ -84,6 +101,10 @@
84101
<SubType>Code</SubType>
85102
</Compile>
86103
<Compile Include="package.py" />
104+
<Compile Include="tests\data\modules\default.py" />
105+
<Compile Include="tests\data\modules\render_module_a.py" />
106+
<Compile Include="tests\data\modules\render_module_b.py" />
107+
<Compile Include="tests\data\modules\render_module_c.py" />
87108
<Compile Include="tests\test_assets.py">
88109
<SubType>Code</SubType>
89110
</Compile>
@@ -96,6 +117,9 @@
96117
<Compile Include="tests\test_jobwatcher.py">
97118
<SubType>Code</SubType>
98119
</Compile>
120+
<Compile Include="tests\test_poolImages.py">
121+
<SubType>Code</SubType>
122+
</Compile>
99123
<Compile Include="tests\test_pools.py">
100124
<SubType>Code</SubType>
101125
</Compile>
@@ -113,10 +137,16 @@
113137
<Folder Include="azure_batch_maya\scripts\tools\" />
114138
<Folder Include="azure_batch_maya\scripts\ui\" />
115139
<Folder Include="azure_batch_maya\templates\" />
140+
<Folder Include="azure_batch_maya\templates\containers\" />
116141
<Folder Include="docs\" />
117142
<Folder Include="docs\images\" />
118143
<Folder Include="tests\" />
119-
<Folder Include="tests\test_scene\" />
144+
<Folder Include="tests\basic_test_scene\" />
145+
<Folder Include="tests\data\modules\" />
146+
<Folder Include="tests\json_data\" />
147+
<Folder Include="tests\json_data\file_tests\" />
148+
<Folder Include="tests\json_data\file_tests\sample_data\" />
149+
<Folder Include="tests\data\" />
120150
</ItemGroup>
121151
<ItemGroup>
122152
<Content Include="azure_batch_maya\icons\btn_background.png" />
@@ -143,6 +173,18 @@
143173
<Content Include="azure_batch_maya\templates\arnold-2017-windows.json" />
144174
<Content Include="azure_batch_maya\templates\arnold-2018-linux.json" />
145175
<Content Include="azure_batch_maya\templates\arnold-2018-windows.json" />
176+
<Content Include="azure_batch_maya\templates\containers\arnold-2017-linux.json" />
177+
<Content Include="azure_batch_maya\templates\containers\arnold-2017-windows.json" />
178+
<Content Include="azure_batch_maya\templates\containers\arnold-2018-linux.json" />
179+
<Content Include="azure_batch_maya\templates\containers\arnold-2018-windows.json" />
180+
<Content Include="azure_batch_maya\templates\containers\mayaSoftware-2017-linux.json" />
181+
<Content Include="azure_batch_maya\templates\containers\mayaSoftware-2017-windows.json" />
182+
<Content Include="azure_batch_maya\templates\containers\mayaSoftware-2018-linux.json" />
183+
<Content Include="azure_batch_maya\templates\containers\mayaSoftware-2018-windows.json" />
184+
<Content Include="azure_batch_maya\templates\containers\vray-2017-linux.json" />
185+
<Content Include="azure_batch_maya\templates\containers\vray-2017-windows.json" />
186+
<Content Include="azure_batch_maya\templates\containers\vray-2018-linux.json" />
187+
<Content Include="azure_batch_maya\templates\containers\vray-2018-windows.json" />
146188
<Content Include="azure_batch_maya\templates\mayaSoftware-2017-linux.json" />
147189
<Content Include="azure_batch_maya\templates\mayaSoftware-2017-windows.json" />
148190
<Content Include="azure_batch_maya\templates\mayaSoftware-2018-linux.json" />
@@ -162,19 +204,28 @@
162204
<Content Include="requirements.txt">
163205
<SubType>Code</SubType>
164206
</Content>
165-
</ItemGroup>
166-
<ItemGroup>
167-
<Interpreter Include="env\">
168-
<Id>{a76b797f-9426-4cd7-a078-9af9c9e4b437}</Id>
169-
<BaseInterpreter>{9a7a9026-48c1-4688-9d5d-e5699d47d074}</BaseInterpreter>
170-
<Version>2.7</Version>
171-
<Description>env (Python 64-bit 2.7)</Description>
172-
<InterpreterPath>Scripts\python.exe</InterpreterPath>
173-
<WindowsInterpreterPath>Scripts\pythonw.exe</WindowsInterpreterPath>
174-
<LibraryPath>Lib\</LibraryPath>
175-
<PathEnvironmentVariable>PYTHONPATH</PathEnvironmentVariable>
176-
<Architecture>Amd64</Architecture>
177-
</Interpreter>
207+
<Content Include="tests\basic_test_scene\asset_map.mel" />
208+
<Content Include="tests\basic_test_scene\test_scene.mb" />
209+
<Content Include="tests\basic_test_scene\workspace.mel" />
210+
<Content Include="tests\data\azure_batch_test.ini" />
211+
<Content Include="tests\data\empty.mb" />
212+
<Content Include="tests\data\star.png" />
213+
<Content Include="tests\json_data\batch-applicationTemplate-parameters.json" />
214+
<Content Include="tests\json_data\batch-applicationTemplate-prohibitedApplicationTemplateInfo.json" />
215+
<Content Include="tests\json_data\batch-applicationTemplate-prohibitedId.json" />
216+
<Content Include="tests\json_data\batch-applicationTemplate-prohibitedPoolInfo.json" />
217+
<Content Include="tests\json_data\batch-applicationTemplate-prohibitedPriority.json" />
218+
<Content Include="tests\json_data\batch-applicationTemplate-static.json" />
219+
<Content Include="tests\json_data\batch-applicationTemplate-unsupportedProperty.json" />
220+
<Content Include="tests\json_data\batch-applicationTemplate-untypedParameter.json" />
221+
<Content Include="tests\json_data\batch.job.parameters.json" />
222+
<Content Include="tests\json_data\batch.job.parametricsweep.json" />
223+
<Content Include="tests\json_data\batch.job.simple.json" />
224+
<Content Include="tests\json_data\batch.pool.parameters.json" />
225+
<Content Include="tests\json_data\batch.pool.simple.json" />
226+
<Content Include="tests\json_data\file_tests\bar.bmp" />
227+
<Content Include="tests\json_data\file_tests\foo.txt" />
228+
<Content Include="tests\json_data\file_tests\sample_data\test.txt" />
178229
</ItemGroup>
179230
<PropertyGroup>
180231
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>

CHANGES.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2018.11.07 v0.23.0
2+
------------------
3+
- Change authentication mode to AAD, including support for private cloud
4+
- Support for Batch Container Images + initial set of images for Maya2017 and 2018
5+
- Updated VM SKU list to match what is available for Maya in BatchExplorer
6+
7+
18
2018.09.24 v0.22.0
29
------------------
310
- Revert template change which broke thumbnailing of outputs in arnold maya 2018 jobs

README.md

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
# Azure Batch for Maya
22

3-
This project demonstrates cloud rendering using the Azure Batch service with integrated licensing for Maya, VRay and Arnold.
3+
This project demonstrates cloud rendering using the Azure Batch service with integrated licensing for Maya, VRay and Arnold. It is supported for Windows and Mac.
44

5-
Please note that the Azure Batch licensing service for Maya is currently in preview.
6-
For more information and to register your interest, please see [rendering.azure.com](rendering.azure.com).
5+
For more information, please see [rendering.azure.com](https://rendering.azure.com).
76

8-
In order to run this sample, you will need to [create an Azure Batch account](https://docs.microsoft.com/azure/batch/batch-account-create-portal).
9-
You will also need a storage account. You will have the option to create a storage account as part of the Batch account setup for use as `Auto Storage`.
10-
You can use this, or you can [set up a storage account independently](https://docs.microsoft.com/azure/storage/storage-create-storage-account).
7+
In order to run this plugin, you will need to [create an Azure Batch account](https://docs.microsoft.com/azure/batch/batch-account-create-portal).
8+
You will also need an `Auto Storage` account configured, which you will have the option to create as part of the Batch account setup.
119

1210

1311
## Loading the plug-in in Maya and installing dependencies
@@ -27,28 +25,30 @@ The first time the plug-in is loaded, you will be prompted to agree to some term
2725
The downloading and installing of the Python dependencies may take a few minutes, after which you will need to close and reopen Maya to
2826
ensure the updated dependencies are loaded correctly.
2927

30-
Any errors in the dependency install will be logged to the file "AzureBatchInstall.log" in the "azure-batch-libs" folder, which is created for holding dependencies. In windows this is located at: Users\<username>\Documents\maya\<version>\scripts\azure-batch-libs
28+
Any errors in the dependency install will be logged to the file "AzureBatchInstall.log" in the "azure-batch-libs" folder, which is created for holding dependencies.
29+
On Windows this is located at: Users\<username>\Documents\maya\<version>\scripts\azure-batch-libs
30+
On Mac this is located at: /Users/<username>/Library/Preferences/Autodesk/maya/<version>/scripts/azure-batch-libs
3131

3232

3333
![](./docs/images/install_dependencies.png)
3434

3535

3636
## Authentication
3737

38-
Before using the plug-in, it will need to be authenticated using your Azure Batch and Azure Storage account keys.
39-
In order to retrieve this information:
38+
Before using the plug-in, it will need to be authenticated using your Azure Active Directory (AAD) credentials.
39+
In order to retrieve your AAD tenant:
4040

41-
1. Open the Azure management portal (portal.azure.com).
42-
2. Select Azure Batch Accounts in the left-hand menu. This can be found under `More Services` in the `Compute` category.
43-
3. Select your account in the list. Copy and paste the account URL into `Service` field of the plug-in UI. Paste the account name into the `Batch Account` field.
44-
4. In the portal, select `Keys` on the left-hand menu. Copy and paste one of the access keys into the `Batch Key` field in the plug-in.
45-
5. Return to the management portal home, and select Storage Accounts from the left-hand menu. This can be found under `More Services` in the `Storage` category.
46-
6. Select your account from the list. Copy and paste the account name into the `Storage Account` field.
47-
7. In the portal, select `Access Keys` on the left-hand menu. Copy and paste one of the access keys into the `Storage Key` field.
48-
8. Click `Authenticate`.
41+
1. Open the Azure management portal (for public cloud this is [portal.azure.com](https://portal.azure.com) ).
42+
2. Hover over your account name on the upper right-hand side, your AAD Domain will be the bottom value shown, e.g. `contoso.onmicrosoft.com`
43+
3. Open the plugin, select Cloud Environment using the dropdown and copy your AAD domain into the appropriate field
44+
4. Follow the instructions to sign-in by entering the device code provided at [aka.ms/devicelogin](https://aka.ms/devicelogin)
4945

5046
![](./docs/images/authentication.png)
5147

48+
5. Select a Subscription and Batch Account from the dropdown menus in order to complete Batch Account configuration
49+
50+
![](./docs/images/accountConfiguration.png)
51+
5252
## Using the Azure Batch plug-in
5353

5454
- [Job configuration](./docs/submitting_jobs.md#job-configuration)
@@ -69,8 +69,9 @@ To uninstall the plug-in:
6969
5. Confirm the removal of the shelf
7070
6. Confirm to remove the dependencies if you wish a clean uninstall
7171

72-
To remove config which is retained for a reinstall, delete the config file "azure_batch.ini". For Windows this is located in:
73-
Users\<username>\Documents\maya\2017\prefs\AzureBatchData
72+
To remove config which is retained for a reinstall, delete the config file "azure_batch.ini".
73+
On Windows this is located in: Users\<username>\Documents\maya\2017\prefs\AzureBatchData
74+
On Mac this is located at: /Users/<username>/Library/Preferences/Autodesk/maya/<version>/prefs/AzureBatchData
7475

7576
## Upgrading or reinstalling
7677

azure_batch_maya/mel/create_shelf.mel

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
python("from shared import AzureBatchSettings");
1+
python("import refreshsession");
22

33
$batch_path = `getenv "AZUREBATCH_ICONS"`;
44

55
global proc run_guiStarter()
66
{
7+
python("refreshsession.refreshSessionModules()");
8+
python("from shared import AzureBatchSettings");
79
python("AzureBatchSettings.starter()");
810
}
911

azure_batch_maya/plug-in/AzureBatch.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,23 @@
3838
REQUIREMENTS = {
3939
"pathlib==1.0.1": "pathlib",
4040
"futures==3.1.1": "concurrent.futures",
41+
"keyring==5.6": "keyring",
42+
"msrestazure==0.4.16": "msrestazure",
43+
"azure-common==1.1.8": "azure.common",
4144
"configparser==3.5.0": "backports.configparser",
42-
"msrestazure==0.4.14": "msrestazure",
43-
"azure-common==1.1.8": "azure.common"
45+
"python-dateutil==2.6.1": "dateutil",
4446
}
4547

4648
NAMESPACE_PACKAGES = {
4749
"azure-mgmt-batch==4.0.0": "azure.mgmt.batch",
4850
"azure-mgmt-storage==1.0.0": "azure.mgmt.storage",
51+
"azure-mgmt-resource==1.2.2": "azure.mgmt.resource",
4952
"azure-batch==4.0.0": "azure.batch",
5053
"azure-storage==0.32.0": "azure.storage",
5154
"azure-batch-extensions==1.0.1": "azure.batch_extensions"
5255
}
5356

54-
VERSION = "0.22.0"
57+
VERSION = "0.23.0"
5558
EULA_PREF = "AzureBatch_EULA"
5659
SHELF_FILE = "shelf_AzureBatch.mel"
5760
cmd_name = "AzureBatch"
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# --------------------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
# --------------------------------------------------------------------------------------------
5+
6+
import json
7+
import sys
8+
import traceback
9+
from collections import OrderedDict
10+
11+
from msrestazure.azure_cloud import AZURE_CHINA_CLOUD, AZURE_PUBLIC_CLOUD, AZURE_GERMAN_CLOUD, AZURE_US_GOV_CLOUD
12+
13+
AAD_ENVIRONMENTS = OrderedDict()
14+
AAD_ENVIRONMENTS[AZURE_PUBLIC_CLOUD.name] = AZURE_PUBLIC_CLOUD
15+
AAD_ENVIRONMENTS[AZURE_CHINA_CLOUD.name] = AZURE_CHINA_CLOUD
16+
AAD_ENVIRONMENTS[AZURE_GERMAN_CLOUD.name] = AZURE_GERMAN_CLOUD
17+
AAD_ENVIRONMENTS[AZURE_US_GOV_CLOUD.name] = AZURE_US_GOV_CLOUD
18+
19+
class AADEnvironmentProvider(object):
20+
21+
def __init__(self, aad_environments = AAD_ENVIRONMENTS):
22+
self.aadEnvironments = aad_environments
23+
24+
def getAADEnvironments(self):
25+
return self.aadEnvironments
26+
27+
def getEnvironmentForId(self, id):
28+
return AAD_ENVIRONMENTS[id]
29+
30+
def getAadAuthorityHostUrl(self, id):
31+
return AAD_ENVIRONMENTS[id].endpoints.active_directory
32+
33+
def getAadManagementUrl(self, id):
34+
return AAD_ENVIRONMENTS[id].endpoints.active_directory_resource_id
35+
36+
def getBatchResourceUrl(self, id):
37+
return AAD_ENVIRONMENTS[id].endpoints.batch_resource_id
38+
39+
def getResourceManager(self, id):
40+
return AAD_ENVIRONMENTS[id].endpoints.resource_manager

0 commit comments

Comments
 (0)