Skip to content

Commit 706e485

Browse files
authored
Batch Data Plane 2021-06-01 update (#22909)
* Generated code. Updated generation Generated comments. Spec changes Missing comma. Spec fixe Spec updates Spec updates Fixed VirtualMachineConfiguration Spec changes Spec changes Spec changes Updated ContainerRegistry Updated ProtocolLayer Fix object comparison Fixed generator System.Object issue, NodeVMExtension.VmExtension casing * Fixed AllocationTimedOut casing to match service response. * Linting and formatting Readme formatting * Changelog and version Updated version * ImageReference fix * Updated dependency version * PR Comments
1 parent cd1bae9 commit 706e485

File tree

116 files changed

+6033
-309
lines changed

Some content is hidden

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

116 files changed

+6033
-309
lines changed

eng/Packages.Data.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
-->
1313
<ItemGroup Condition="'$(IsClientLibrary)' != 'true'">
1414
<PackageReference Update="Microsoft.Azure.Amqp" Version="2.4.11" />
15-
<PackageReference Update="Microsoft.Azure.Batch" Version="11.0.0" />
15+
<PackageReference Update="Microsoft.Azure.Batch" Version="14.0.0" />
1616
<PackageReference Update="Microsoft.Azure.Devices.Client" Version="1.23.2" />
1717
<PackageReference Update="Microsoft.Azure.Devices" Version="1.19.0" />
1818
<PackageReference Update="Microsoft.Azure.KeyVault.Core" Version="3.0.3" />
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"MD013": false,
3+
"MD024": { "siblings_only": true }
4+
}

sdk/batch/Microsoft.Azure.Batch/CHANGELOG.md

Lines changed: 182 additions & 77 deletions
Large diffs are not rendered by default.

sdk/batch/Microsoft.Azure.Batch/README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
# License notes
2+
23
The Azure Batch C# client is now under the MIT license. Prior to March 10 2017 it was under the Apache 2.0 license.
34

4-
# Azure Batch SDK developer guide
5+
## Azure Batch SDK developer guide
6+
57
`Microsoft.Azure.Batch.sln` is your one stop shop for all things related to the Azure Batch C# client library. This solution file contains all of the projects affiliated with the Azure Batch client (including testing and tooling).
68

79
## Changing the Azure Batch client
10+
811
Depending on the type of change you want to make, the work required varies. If you follow this process you shouldn't miss anything:
912

1013
1. Update the Azure Batch Swagger specification, which resides in the [Azure/azure-rest-api-specs](https://github.com/Azure/azure-rest-api-specs) GitHub repository (specifically [here](https://github.com/Azure/azure-rest-api-specs/tree/master/specification/batch/data-plane))
@@ -23,32 +26,35 @@ Depending on the type of change you want to make, the work required varies. If y
2326
* The `src\IProtocolLayer.cs` interface.
2427
* The `src\ProtocolLayer.cs` class.
2528
* The corresponding operations class, for example `PoolOperations.cs`.
26-
* The corresponding entity which the operation is performed on, for example `CloudPool.cs`.
29+
* The corresponding entity which the operation is performed on, for example `CloudPool.cs`.
2730
7. Add tests for your new models and APIs into the correct test projects.
28-
* `Azure.Batch.Unit.Tests` for unit tests. These tests do not have any external dependencies (they run entirely in-memory) and are used in the continuous integration job to validate checkins.
31+
* `Azure.Batch.Unit.Tests` for unit tests. These tests do not have any external dependencies (they run entirely in-memory) and are used in the continuous integration job to validate checkins.
2932
* `BatchClientIntegrationTests` for integration tests. These tests run against a live Azure Batch endpoint and do not run during CI. See [running the end to end tests](#running-the-end-to-end-tests) for more details about how to run these tests.
3033
* **Note:** You should prefer to add unit tests over integration tests where possible -- integration tests should be reserved for ensuring that the Batch Service accepts the Swagger requests. Testing service behavior should occur in a service test, not the client.
3134
8. Update the `CHANGELOG.md` file and the `Version` tag in `src/Microsoft.Azure.Batch.csproj`. Ensure that if you are making a breaking change, you update the major version of the version number.
3235
9. Run the tests and ensure that they pass.
33-
10. Open a PR to https://github.com/Azure/azure-sdk-for-net
36+
10. Open a PR to <https://github.com/Azure/azure-sdk-for-net>
3437

3538
### Generate the `src\GeneratedProtocol` folder using AutoRest
39+
3640
The GeneratedProtocol folder holds the code generated by the [AutoRest](https://github.com/Azure/autorest) tool from a Swagger specification. The AutoRest tool has a command line interface of its own which you can use directly, or you can run `powershell Start-AutoRestCodeGeneration -ResourceProvider "batch/data-plane" -SdkRepoRootPath "<path to root of this repo>" -AutoRestVersion "latest" -SdkGenerationDirectory "<path to root of this repo>\sdk\batch\Microsoft.Azure.Batch\src\GeneratedProtocol" -ConfigFileTag "package-2020-03.11.0"`
3741

3842
### Generate the `src\Generated` folder
43+
3944
This folder contains the convenience layer models for Azure Batch. It is generated from a custom tool. The custom tool reads all of the specification files located in `Tools\ObjectModelCodeGenerator\Spec`. The convenience layer models require more metadata than the Swagger specification provides, so this file is an extra mapping layer on top of Swagger which provides more detail. **Note:** These specification files are all about the models, they have nothing to do with the actual APIs.
4045

4146
1. New entities defined in the Swagger specification have to be added here as well. See an existing entity for an example.
4247
2. If the type or name of a property has changed in the underlying Swagger specification, it should be updated here as well.
4348

4449
There are a number of special flags which have meaning in the specification files. The easiest way to see a list of what flags are supported and at what level is to look at the backing code generation code:
4550

46-
1. For properties: `Tools\ObjectModelCodeGeneration\CodeGenerationLibrary\PropertyData.cs`
51+
1. For properties: `Tools\ObjectModelCodeGeneration\CodeGenerationLibrary\PropertyData.cs`
4752
2. For types: `Tools\ObjectModelCodeGeneration\CodeGenerationLibrary\ObjectModelTypeData.cs`
48-
53+
4954
Once you have added and updated the required files in `Tools\ObjectModelCodeGenerator\Spec` mark the `ObjectModelCodeGenerator` as your startup project in Visual Studio and run it -- it will regenerate the contents of the `src\Generated` folder.
5055

5156
## Running the end to end tests
57+
5258
A full end to end test pass takes 20-40 minutes.
5359
The following environment variables must be set for the the end to end tests to work - it is recommended to set up a script which sets these all so that it can easily be reused later:
5460

sdk/batch/Microsoft.Azure.Batch/Tools/CodeGenerationLibrary/CodeGenerationUtilities.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ public static bool IsTypeComplex(string typeString)
138138
typeString.Equals("TimeSpan") ||
139139
typeString.Equals("TimeSpan?") ||
140140
typeString.Equals("DateTime") ||
141-
typeString.Equals("DateTime?"));
141+
typeString.Equals("DateTime?") ||
142+
typeString.Equals("object"));
142143

143144
return result;
144145
}

sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/AzureBlobFileSystemConfiguration.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,17 @@
7979
"HideSetter": true
8080
},
8181
"Value": null
82+
},
83+
{
84+
"Key": {
85+
"Type": "ComputeNodeIdentityReference",
86+
"Name": "IdentityReference",
87+
"SummaryComment": "The reference to the user assigned identity to use to access containerName",
88+
"RemarksComment": "This property is mutually exclusive with both accountKey and sasKey; exactly one must be specified.",
89+
"BoundAccess": "read",
90+
"UnboundAccess": "read,write"
91+
},
92+
"Value": null
8293
}
8394
]
8495
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"Name": "BatchPoolIdentity",
3+
"ProtocolName": "Models.BatchPoolIdentity",
4+
"SummaryComment": "The identity of the Batch pool, if configured.",
5+
"IsConstructorPublic": false,
6+
"Properties": [
7+
{
8+
"Key": {
9+
"Type": "Common.PoolIdentityType",
10+
"Name": "Type",
11+
"SummaryComment": "The identity of the Batch pool, if configured.",
12+
"RemarksComment": "The list of user identities associated with the Batch pool. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.",
13+
"BoundAccess": "read",
14+
"UnboundAccess": "read,write",
15+
"ConstructorArgumentType": "Required"
16+
},
17+
"Value": {
18+
"Type": "Models.PoolIdentityType",
19+
"Name": "Type"
20+
}
21+
},
22+
{
23+
"Key": {
24+
"Type": "IList<UserAssignedIdentity>",
25+
"Name": "UserAssignedIdentities",
26+
"SummaryComment": "The list of user identities associated with the Batch account.",
27+
"RemarksComment": "The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.",
28+
"BoundAccess": "read",
29+
"UnboundAccess": "read,write"
30+
},
31+
"Value": null
32+
}
33+
]
34+
}

sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/CloudJob.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,17 @@
289289
"UnboundAccess": "read,write"
290290
},
291291
"Value": null
292+
},
293+
{
294+
"Key": {
295+
"Type": "int?",
296+
"Name": "MaxParallelTasks",
297+
"SummaryComment": "The maximum number of tasks that can be executed in parallel for the job.",
298+
"RemarksComment": "The value of maxParallelTasks must be -1 or greater than 0 if specified. If not specified, the default value is -1, which means there's no limit to the number of tasks that can be run at once. You can update a job's maxParallelTasks after it has been created using the update job API.",
299+
"BoundAccess": "read,write",
300+
"UnboundAccess": "read,write"
301+
},
302+
"Value": null
292303
}
293304
]
294305
}

sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/CloudPool.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,17 @@
429429
"Type": "IList<Models.MountConfiguration>",
430430
"Name": "MountConfiguration"
431431
}
432+
},
433+
{
434+
"Key": {
435+
"Type": "BatchPoolIdentity",
436+
"Name": "Identity",
437+
"SummaryComment": "The identity of the Batch pool, if configured.",
438+
"RemarksComment": "The list of user identities associated with the Batch pool. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.",
439+
"BoundAccess": "read,write",
440+
"UnboundAccess": "read,write"
441+
},
442+
"Value": null
432443
}
433444
]
434445
}

sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/ComputeNode.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,17 @@
269269
"Type": "int?",
270270
"Name": "RunningTaskSlotsCount"
271271
}
272+
},
273+
{
274+
"Key": {
275+
"Type": "VirtualMachineInfo",
276+
"Name": "VirtualMachineInfo",
277+
"SummaryComment": "Info about the current state of the virtual machine.",
278+
"RemarksComment": null,
279+
"BoundAccess": "read",
280+
"UnboundAccess": "none"
281+
},
282+
"Value": null
272283
}
273284
]
274285
}

0 commit comments

Comments
 (0)