You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sdk/batch/Microsoft.Azure.Batch/README.md
+12-6Lines changed: 12 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,13 @@
1
1
# License notes
2
+
2
3
The Azure Batch C# client is now under the MIT license. Prior to March 10 2017 it was under the Apache 2.0 license.
3
4
4
-
# Azure Batch SDK developer guide
5
+
## Azure Batch SDK developer guide
6
+
5
7
`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).
6
8
7
9
## Changing the Azure Batch client
10
+
8
11
Depending on the type of change you want to make, the work required varies. If you follow this process you shouldn't miss anything:
9
12
10
13
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
23
26
* The `src\IProtocolLayer.cs` interface.
24
27
* The `src\ProtocolLayer.cs` class.
25
28
* 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`.
27
30
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.
29
32
*`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.
30
33
***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.
31
34
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.
32
35
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>
34
37
35
38
### Generate the `src\GeneratedProtocol` folder using AutoRest
39
+
36
40
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"`
37
41
38
42
### Generate the `src\Generated` folder
43
+
39
44
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.
40
45
41
46
1. New entities defined in the Swagger specification have to be added here as well. See an existing entity for an example.
42
47
2. If the type or name of a property has changed in the underlying Swagger specification, it should be updated here as well.
43
48
44
49
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:
45
50
46
-
1. For properties: `Tools\ObjectModelCodeGeneration\CodeGenerationLibrary\PropertyData.cs`
51
+
1. For properties: `Tools\ObjectModelCodeGeneration\CodeGenerationLibrary\PropertyData.cs`
47
52
2. For types: `Tools\ObjectModelCodeGeneration\CodeGenerationLibrary\ObjectModelTypeData.cs`
48
-
53
+
49
54
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.
50
55
51
56
## Running the end to end tests
57
+
52
58
A full end to end test pass takes 20-40 minutes.
53
59
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:
"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}'.",
Copy file name to clipboardExpand all lines: sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/CloudJob.json
+11Lines changed: 11 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -289,6 +289,17 @@
289
289
"UnboundAccess": "read,write"
290
290
},
291
291
"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.",
Copy file name to clipboardExpand all lines: sdk/batch/Microsoft.Azure.Batch/Tools/ObjectModelCodeGenerator/Spec/CloudPool.json
+11Lines changed: 11 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -429,6 +429,17 @@
429
429
"Type": "IList<Models.MountConfiguration>",
430
430
"Name": "MountConfiguration"
431
431
}
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}'.",
0 commit comments