Skip to content

jianghaolu/azure-batch-sdk-for-java-1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

#Azure Batch Libraries for Java

This README is based on the latest released preview version Azure Batch SDK (1.0.0-beta2). If you are looking for other releases, see More Information

The Azure Batch Libraries for Java is a higher-level, object-oriented API for interacting with the Azure Batch service.

1.0.0-beta2 is a developer preview that supports major parts of Azure Batch. The next preview version of the Azure Batch Libraries for Java is a work in-progress. We will be adding support for more new featuresand tweaking the API over the next few months.

Azure Batch Authentication

You need to create a Batch account through the Azure portal or Azure cli. Use the account name, key, and URL to create a BatchSharedKeyCredentials instance for authentication with the Azure Batch service. The BatchClient class is the simplest entry point for creating and interacting with Azure Batch objects.

BatchSharedKeyCredentials cred = new BatchSharedKeyCredentials(batchUri, batchAccount, batchKey);
BatchClient client = BatchClient.Open(cred);

Create a pool using an Azure Marketplace image

You can create a pool of Azure virtual machines which can be used to execute tasks.

System.out.println("Created a pool using an Azure Marketplace image.");

VirtualMachineConfiguration configuration = new VirtualMachineConfiguration();
configuration.setNodeAgentSKUId(skuId).setImageReference(imageRef);
client.getPoolOperations().createPool(poolId, poolVMSize, configuration, poolVMCount);

System.out.println("Created a Pool: " + poolId);

Create a Job

You can create a job by using the recently created pool.

PoolInformation poolInfo = new PoolInformation();
poolInfo.setPoolId(poolId);
client.getJobOperations().createJob(jobId, poolInfo);

#Sample Code

You can find sample code that illustrates Batch usage scenarios in https://github.com/azure/azure-batch-samples

Download

1.0.0-beta2

If you are using released builds from 1.0.0-beta2, add the following to your POM file:

<dependency>
    <groupId>com.microsoft.azure</groupId>
    <artifactId>azure-batch</artifactId>
    <version>1.0.0-beta2</version>
</dependency>
<dependency>
    <groupId>com.microsoft.rest</groupId>
    <artifactId>client-runtime</artifactId>
    <version>1.0.0-beta2</version>
</dependency>
<dependency>
    <groupId>com.microsoft.azure</groupId>
    <artifactId>azure-client-runtime</artifactId>
    <version>1.0.0-beta2</version>
</dependency>

#Pre-requisites

Help

If you encounter any bugs with these libraries, please file issues via Issues or checkout StackOverflow for Azure Java SDK.

#Contribute Code

If you would like to become an active contributor to this project please follow the instructions provided in Microsoft Azure Projects Contribution Guidelines.

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

#More Information

Previous Releases and Corresponding Repo Branches

Version SHA1 Remarks
1.0.0-beta2 1.0.0-beta2 Tagged release for 1.0.0-beta2 version of Azure management libraries
1.0.0-beta1 1.0.0-beta1 Maintenance branch for AutoRest generated raw clients
1.0.0-beta1+fixes v1.0.0-beta1+fixes Stable build for AutoRest generated raw clients
0.9.x-SNAPSHOTS 0.9 Maintenance branch for service management libraries
0.9.3 v0.9.3 Latest release for service management libraries

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

About

Azure Batch Libraries for Java http://azure.com/java

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published