Skip to content
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

Azure.Compute.Batch inital checkin #44524

Merged
merged 50 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
451fe5d
inital checkin of azure.compute.batch
wiboris Jun 12, 2024
b68657b
update based on feedback
wiboris Jun 12, 2024
d28d065
Update sdk/batch/Azure.Compute.Batch/README.md
wiboris Jun 14, 2024
ace4d9e
feedback
wiboris Jun 14, 2024
ccee584
Update sdk/batch/Azure.Compute.Batch/README.md
wiboris Jun 18, 2024
98742d8
Update sdk/batch/Azure.Compute.Batch/README.md
wiboris Jun 18, 2024
0ac3e44
spliting track1 build pipeline
wiboris Jun 18, 2024
5c5bf72
Merge branch 'wiboris/BatchTrack2' of https://github.com/Azure/azure-…
wiboris Jun 18, 2024
52d758d
Update sdk/batch/Azure.Compute.Batch/tests/Infrastructure/BatchLiveTe…
wiboris Jun 19, 2024
46b8e2f
Update sdk/batch/Azure.Compute.Batch/tests/Infrastructure/BatchLiveTe…
wiboris Jun 19, 2024
b99d9be
Update sdk/batch/Azure.Compute.Batch/tests/Infrastructure/WindowsPool…
wiboris Jun 19, 2024
2103e3f
updating samples with snippets
wiboris Jun 19, 2024
a85e554
test fix
wiboris Jun 19, 2024
e7564dc
test fix
wiboris Jun 19, 2024
94e7e60
build fix
wiboris Jun 19, 2024
f37d15d
Update sdk/batch/Azure.Compute.Batch/README.md
wiboris Jun 20, 2024
800b042
Update sdk/batch/Azure.Compute.Batch/samples/Sample1_CreatePool_Job_T…
wiboris Jun 20, 2024
8cf97f3
update snippets
wiboris Jun 20, 2024
03ed03f
Merge branch 'wiboris/BatchTrack2' of https://github.com/Azure/azure-…
wiboris Jun 20, 2024
8d1bf94
Update sdk/batch/Azure.Compute.Batch/samples/Sample1_CreatePool_Job_T…
wiboris Jun 20, 2024
bdea3dd
Update sdk/batch/Azure.Compute.Batch/samples/Sample1_CreatePool_Job_T…
wiboris Jun 20, 2024
8abc883
Update sdk/batch/Azure.Compute.Batch/samples/Sample1_CreatePool_Job_T…
wiboris Jun 20, 2024
f919d3f
Update sdk/batch/Azure.Compute.Batch/samples/Sample1_CreatePool_Job_T…
wiboris Jun 20, 2024
6806f59
Update sdk/batch/Azure.Compute.Batch/src/Azure.Compute.Batch.csproj
wiboris Jun 20, 2024
7b64c47
Update sdk/batch/Azure.Compute.Batch/src/Azure.Compute.Batch.csproj
wiboris Jun 20, 2024
7e04987
update readme
wiboris Jun 20, 2024
603f8c9
Merge branch 'wiboris/BatchTrack2' of https://github.com/Azure/azure-…
wiboris Jun 20, 2024
7e4177d
updates to sample
wiboris Jun 20, 2024
caccfdd
Update sdk/batch/Azure.Compute.Batch/samples/Sample1_CreatePool_Job_T…
wiboris Jun 22, 2024
205944a
Update sdk/batch/Azure.Compute.Batch/samples/Sample1_CreatePool_Job_T…
wiboris Jun 22, 2024
4dd92e2
Update sdk/batch/Azure.Compute.Batch/samples/Sample1_CreatePool_Job_T…
wiboris Jun 22, 2024
4210dc0
Update sdk/batch/Azure.Compute.Batch/samples/Sample1_CreatePool_Job_T…
wiboris Jun 22, 2024
e998243
Update sdk/batch/Azure.Compute.Batch/samples/Sample1_CreatePool_Job_T…
wiboris Jun 22, 2024
905c4d8
Update sdk/batch/Azure.Compute.Batch/samples/Sample1_CreatePool_Job_T…
wiboris Jun 22, 2024
a5b441b
Update sdk/batch/Azure.Compute.Batch/README.md
wiboris Jun 22, 2024
e937aa1
cleanup
wiboris Jun 22, 2024
10f37e3
updates
wiboris Jun 22, 2024
a251505
Update sdk/batch/Azure.Compute.Batch/samples/Sample1_CreatePool_Job_T…
wiboris Jun 22, 2024
f075aa4
Update sdk/batch/Azure.Compute.Batch/samples/Sample1_CreatePool_Job_T…
wiboris Jun 22, 2024
40f6a04
Update sdk/batch/Azure.Compute.Batch/samples/Sample1_CreatePool_Job_T…
wiboris Jun 22, 2024
26b3591
Update sdk/batch/Azure.Compute.Batch/README.md
wiboris Jul 1, 2024
96d0f90
Update sdk/batch/Azure.Compute.Batch/README.md
wiboris Jul 1, 2024
2e8140b
Update sdk/batch/Azure.Compute.Batch/README.md
wiboris Jul 1, 2024
6341e56
Update sdk/batch/Azure.Compute.Batch/README.md
wiboris Jul 1, 2024
08fe82a
Update sdk/batch/Azure.Compute.Batch/README.md
wiboris Jul 1, 2024
4f90004
Update sdk/batch/Azure.Compute.Batch/README.md
wiboris Jul 1, 2024
b258063
feedback
wiboris Jul 1, 2024
a4fe1e2
updating code owners
wiboris Jul 1, 2024
c085e2f
new generation
wiboris Jul 1, 2024
7498cd8
update api's
wiboris Jul 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
# ServiceOwners: @rpsqrd @edyoung

# PRLabel: %Batch
/sdk/batch/ @wiboris @dpwatrous
/sdk/batch/ @wiboris @dpwatrous @wanghoppe @skapur12
wiboris marked this conversation as resolved.
Show resolved Hide resolved

# ServiceLabel: %Batch
# ServiceOwners: @wiboris @dpwatrous
Expand Down
7 changes: 6 additions & 1 deletion .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,12 @@
{
"filename": "**/sdk/batch/**/*.cs",
"words": [
"cifs"
"cifs",
"ocpdate",
"Reimage",
"Reimaging",
"reimaging",
"SSDLRS"
]
},
{
Expand Down
56 changes: 56 additions & 0 deletions sdk/batch/Azure.Compute.Batch/Azure.Compute.Batch.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29709.97
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework", "..\..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{ECC730C1-4AEA-420C-916A-66B19B79E4DC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Compute.Batch", "src\Azure.Compute.Batch.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Compute.Batch.Tests", "tests\Azure.Compute.Batch.Tests.csproj", "{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU
{8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU
{ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.Build.0 = Release|Any CPU
{A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU
{FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU
{85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU
{28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU
{28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU
{28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU
{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE}
EndGlobalSection
EndGlobal
13 changes: 13 additions & 0 deletions sdk/batch/Azure.Compute.Batch/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Release History

## 1.0.0-beta.1 (2024-06-01)

### Features Added

New design of track 2 initial commit. This package, `Azure.Compute.Batch`, replaces `Microsoft.Azure.Batch`.

This package follows the [new Azure SDK guidelines](https://azure.github.io/azure-sdk/general_introduction.html), and provides many core capabilities.

This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues).

> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet).
6 changes: 6 additions & 0 deletions sdk/batch/Azure.Compute.Batch/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--
Add any shared properties you want for the projects under this package directory that need to be set before the auto imported Directory.Build.props
-->
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., Directory.Build.props))\Directory.Build.props" />
</Project>
99 changes: 99 additions & 0 deletions sdk/batch/Azure.Compute.Batch/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# Azure Batch client library for .NET

Azure Batch allows users to run large-scale parallel and high-performance computing (HPC) batch jobs efficiently in Azure.

Use the client library for to:

* Create and manage Batch jobs and tasks
* View and perform operations on nodes in a Batch pool

[Source code](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/batch/Azure.Compute.Batch/src) | [Package (NuGet)](https://www.nuget.org/packages) | [API reference documentation](https://learn.microsoft.com/dotnet/api/overview/azure/batch?view=azure-dotnet) | [Product documentation](https://learn.microsoft.com/azure/batch/)

## Getting started

### Install the package

Install the client library for .NET with [NuGet](https://www.nuget.org/ ):

```dotnetcli
dotnet add package Azure.Compute.Batch --prerelease
```

### Prerequisites
wiboris marked this conversation as resolved.
Show resolved Hide resolved

- An Azure account with an active subscription. If you don't have one, [create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).

- A Batch account with a linked Azure Storage account. You can create the accounts by using any of the following methods: [Azure CLI](https://learn.microsoft.com/azure/batch/quick-create-cli) | [Azure portal](https://learn.microsoft.com/azure/batch/quick-create-portal) | [Bicep](https://learn.microsoft.com/azure/batch/quick-create-bicep) | [ARM template](https://learn.microsoft.com/azure/batch/quick-create-template) | [Terraform](https://learn.microsoft.com/azure/batch/quick-create-terraform).

- [Visual Studio 2019](https://www.visualstudio.com/vs) or later, or [.NET 6.0](https://dotnet.microsoft.com/download/dotnet) or later, for Linux or Windows.
wiboris marked this conversation as resolved.
Show resolved Hide resolved
### Authenticate the client
wiboris marked this conversation as resolved.
Show resolved Hide resolved

Batch account access supports two methods of authentication: Shared Key and Microsoft Entra ID.

We strongly recommend using Microsoft Entra ID for Batch account authentication. Some Batch capabilities require this method of authentication, including many of the security-related features discussed here. The service API authentication mechanism for a Batch account can be restricted to only Microsoft Entra ID using the [allowedAuthenticationModes](https://learn.microsoft.com/rest/api/batchmanagement/batch-account/create?view=rest-batchmanagement-2024-02-01&tabs=HTTP) property. When this property is set, API calls using Shared Key authentication will be rejected.

#### Authenticate using Microsoft Entra ID

Azure Batch provides integration with Microsoft Entra ID for identity-based authentication of requests. With Azure AD, you can use role-based access control (RBAC) to grant access to your Azure Batch resources to users, groups, or applications. The [Azure Identity library](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity/README.md) provides easy Microsoft Entra ID support for authentication.


```C#
wiboris marked this conversation as resolved.
Show resolved Hide resolved
BatchClient client = new BatchClient(
new Uri("https://examplebatchaccount.eastus.batch.azure.com"),
new DefaultAzureCredential());
```

#### Authenticate using Shared Key

You can also use Shared Key authentication to sign into your Batch account. This method uses your Batch account access keys to authenticate Azure commands for the Batch service. You can find your batch account shared keys in the portal under the "keys" section or you can run the following [CLI command](https://learn.microsoft.com/cli/azure/batch/account/keys?view=azure-cli-latest)

```bash
az batch account keys list --name <your-batch-account> --resource-group <your-resource-group-name>
```

```C#
var credential = new AzureNamedKeyCredential("examplebatchaccount", "BatchAccountKey");
wiboris marked this conversation as resolved.
Show resolved Hide resolved
BatchClient client = new BatchClient(
new Uri("https://examplebatchaccount.eastus.batch.azure.com"),
new credential());
```

## Key concepts

[Azure Batch Overview](https://learn.microsoft.com/azure/batch/batch-technical-overview)

### Thread safety

We guarantee that all client instance methods are thread-safe and independent of each other ([guideline](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-service-methods-thread-safety)). This ensures that the recommendation of reusing client instances is always safe, even across threads.

### Additional concepts
<!-- CLIENT COMMON BAR -->
[Client options](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#configuring-service-clients-using-clientoptions) |
[Accessing the response](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#accessing-http-response-details-using-responset) |
[Long-running operations](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#consuming-long-running-operations-using-operationt) |
[Handling failures](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#reporting-errors-requestfailedexception) |
[Diagnostics](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md) |
[Mocking](https://learn.microsoft.com/dotnet/azure/sdk/unit-testing-mocking?tabs=csharp) |
[Client lifetime](https://devblogs.microsoft.com/azure-sdk/lifetime-management-and-thread-safety-guarantees-of-azure-sdk-net-clients/)
<!-- CLIENT COMMON BAR -->

## Examples
wiboris marked this conversation as resolved.
Show resolved Hide resolved
wiboris marked this conversation as resolved.
Show resolved Hide resolved

You can familiarize yourself with different APIs using [Samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/batch/Azure.Compute.Batch/samples/README.md).
## Troubleshooting
wiboris marked this conversation as resolved.
Show resolved Hide resolved
## Next steps

View more https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/batch/Azure.Compute.Batch/samples here for common usages of the Batch client library: [Batch Samples](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/batch/Azure.Compute.Batch/samples).

## Contributing

This project welcomes contributions and suggestions.
Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution.
For details, visit [Contributor License Agreements](https://opensource.microsoft.com/cla/).

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment).
Simply follow the instructions provided by the bot.
You will only need to do this once across all repos using our CLA.

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
Loading