Azureのpool、job、task、およびcompute nodeを使用して、大規模な並列処理およびハイパフォーマンスコンピューティングのバッチジョブを実行します。
- GitHubスター
- 3,194
- ファイル
- 2
- 最終コミット
- 2026年11月11日
- ライセンス
- MIT
- 許可されたツール
- —
azure-compute-batch-java skillは何をしますか
azure-compute-batch-javaはAgent Skillsです。 Azureのpool、job、task、およびcompute nodeを使用して、大規模な並列処理およびハイパフォーマンスコンピューティングのバッチジョブを実行します。.
skillのSKILL.mdから生成された要約。
azure-compute-batch-java skill について
ハイパフォーマンスコンピューティングのワークロードを管理する開発者は、このJava SDKを使用して、Azure内で大規模な並列バッチジョブをオーケストレーションできます。このSKILLは、仮想マシンノードのpool作成から定期的なjobのスケジューリングまで、コンピューティングリソースのライフサイクル全体を管理するために必要なツールを提供します。複雑な計算タスクを論理的なjobにグループ化し、taskと呼ばれる個別の作業単位として実行することで、タスクの自動化を必要とするエンジニア向けに設計されています。
ユーザーがコンピューティングインフラストラクチャのプロビジョニング、既存のpoolのスケーリング、または分散ワークロードの進捗監視を行う必要がある場合に、エージェントはこのSKILLをロードする必要があります。このライブラリは同期および非同期の両方のクライアントをサポートしており、さまざまなアプリケーションアーキテクチャへの柔軟な統合が可能です。ユーザーは、pool、job、task、nodeなどの特定のコンポーネントを操作しながら、オートスケーリング数式やjob scheduleなどの機能を利用して、リソース使用量とコストを最適化できます。認証は、AZURE_BATCH_ENDPOINTなどの必要な環境変数が設定されている場合、Microsoft Entra IDまたは共有キー認証を通じて行うことができます。
エージェントができること
- 1コンピューティングインフラストラクチャのプロビジョニング特定のUbuntuイメージと専用ノード数を使用して、新しいcompute nodeのpoolを作成します。
- 2リソースの動的なスケーリング需要に合わせて、既存のpool内の専用ノードおよび低優先度ノードの数を調整します。
- 3並列ワークロードの実行大量の個別の計算taskを、実行のために特定のjobに送信します。
- 4定期的な計算の自動化特定のjobを一定の間隔でトリガーするjob scheduleを設定します。
- 5ジョブの進捗監視特定のjob内にある、アクティブ、実行中、および完了したtaskの数を取得します。
skill の SKILL.md から作成されています。すべてのユースケースは、その引用と照合されています。
azure-compute-batch-java skillのインストール方法
各コマンドはskillフォルダをクライアントのskillsディレクトリにコピーします。読み込むには、クライアントを再起動するか新しいセッションを開始してください。Claude Codeにazure-compute-batch-java skillをインストールする
~/.claude/skills/azure-compute-batch-java/SKILL.md
$ npx degit microsoft/skills/.github/plugins/azure-sdk-java/skills/azure-compute-batch-java ~/.claude/skills/azure-compute-batch-javaClaude Code (project)にazure-compute-batch-java skillをインストールする
.claude/skills/azure-compute-batch-java/SKILL.md
$ npx degit microsoft/skills/.github/plugins/azure-sdk-java/skills/azure-compute-batch-java .claude/skills/azure-compute-batch-javaCodexにazure-compute-batch-java skillをインストールする
~/.agents/skills/azure-compute-batch-java/SKILL.md
$ npx degit microsoft/skills/.github/plugins/azure-sdk-java/skills/azure-compute-batch-java ~/.agents/skills/azure-compute-batch-javaGemini CLIにazure-compute-batch-java skillをインストールする
~/.gemini/skills/azure-compute-batch-java/SKILL.md
$ npx degit microsoft/skills/.github/plugins/azure-sdk-java/skills/azure-compute-batch-java ~/.gemini/skills/azure-compute-batch-javaClaude.aiにazure-compute-batch-java skillをインストールする
npx degit microsoft/skills/.github/plugins/azure-sdk-java/skills/azure-compute-batch-java azure-compute-batch-java && zip -r azure-compute-batch-java.zip azure-compute-batch-java # claude.ai → Customize → Skills → + → Create skill → Upload a skill → azure-compute-batch-java.zip
自動チェック
実行日 2026年11月14日詳細レポート →自動チェックに合格しました。これはセキュリティ監査ではありません。エージェントに実行させる前にスクリプトを読んでください。 チェックの仕組み
- ソースリポジトリがリンクされており、アクセス可能microsoft/skills/.github/plugins/azure-sdk-java/skills/azure-compute-batch-java is public and reachablegithub.com/microsoft/skills/tree/HEAD/.github/plugins/azure- ↗合格
- オープンソースライセンス (OSI)MITspdx.org/licenses/MIT.html ↗合格
- 過去1年以内にコミットまたはリリースありLast commit 2026-11-11github.com/microsoft/skills/commits ↗合格
- スクリプトにダウンロード実行や認証情報の窃取がないNo scripts in the skill folder合格
- SKILL.md に隠れた指示がないNo override phrases, safeguard switches, credential requests or hidden charactersgithub.com/microsoft/skills/blob/HEAD/.github/plugins/azure- ↗合格
- 事前許可ツールが限定されているNo pre-approved tools; the agent asks before using onegithub.com/microsoft/skills/blob/HEAD/.github/plugins/azure- ↗合格
SKILL.md
GitHubで表示Azure Batch SDK for Java
Client library for running large-scale parallel and high-performance computing (HPC) batch jobs in Azure.
Installation
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-compute-batch</artifactId>
<version>1.0.0-beta.5</version>
</dependency>
Prerequisites
- Azure Batch account
- Pool configured with compute nodes
- Azure subscription
Environment Variables
AZURE_BATCH_ENDPOINT=https://<account>.<region>.batch.azure.com # Required for all auth methods
AZURE_BATCH_ACCOUNT=<account-name> # Only required for shared key auth
AZURE_BATCH_ACCESS_KEY=<account-key> # Only required for shared key auth
AZURE_TOKEN_CREDENTIALS=prod # Required only if DefaultAzureCredential is used in production
Client Creation
With Microsoft Entra ID (Recommended)
import com.azure.compute.batch.BatchClient;
import com.azure.compute.batch.BatchClientBuilder;
import com.azure.core.credential.TokenCredential;
import com.azure.identity.AzureIdentityEnvVars;
import com.azure.identity.DefaultAzureCredentialBuilder;
import com.azure.identity.ManagedIdentityCredentialBuilder;
// Local dev: DefaultAzureCredential. Production: set AZURE_TOKEN_CREDENTIALS=prod or AZURE_TOKEN_CREDENTIALS=<specific_credential>
TokenCredential credential = new DefaultAzureCredentialBuilder()
.requireEnvVars(AzureIdentityEnvVars.AZURE_TOKEN_CREDENTIALS)
.build();
// Or use a specific credential directly in production:
// See https://learn.microsoft.com/java/api/overview/azure/identity-readme?view=azure-java-stable#credential-classes
// TokenCredential credential = new ManagedIdentityCredentialBuilder().build();
BatchClient batchClient = new BatchClientBuilder()
.credential(credential)
.endpoint(System.getenv("AZURE_BATCH_ENDPOINT"))
.buildClient();
Async Client
import com.azure.compute.batch.BatchAsyncClient;
BatchAsyncClient batchAsyncClient = new BatchClientBuilder()
.credential(credential)
.endpoint(System.getenv("AZURE_BATCH_ENDPOINT"))
.buildAsyncClient();
With Shared Key Credentials
import com.azure.core.credential.AzureNamedKeyCredential;
String accountName = System.getenv("AZURE_BATCH_ACCOUNT");
String accountKey = System.getenv("AZURE_BATCH_ACCESS_KEY");
AzureNamedKeyCredential sharedKeyCreds = new AzureNamedKeyCredential(accountName, accountKey);
BatchClient batchClient = new BatchClientBuilder()
.credential(sharedKeyCreds)
.endpoint(System.getenv("AZURE_BATCH_ENDPOINT"))
.buildClient();
Key Concepts
| Concept | Description |
|---|---|
| Pool | Collection of compute nodes that run tasks |
| Job | Logical grouping of tasks |
| Task | Unit of computation (command/script) |
| Node | VM that executes tasks |
| Job Schedule | Recurring job creation |
Pool Operations
Create Pool
import com.azure.compute.batch.models.*;
batchClient.createPool(new BatchPoolCreateParameters("myPoolId", "STANDARD_DC2s_V2")
.setVirtualMachineConfiguration(
new VirtualMachineConfiguration(
new BatchVmImageReference()
.setPublisher("Canonical")
.setOffer("UbuntuServer")
.setSku("22_04-lts")
.setVersion("latest"),
"batch.node.ubuntu 22.04"))
.setTargetDedicatedNodes(2)
.setTargetLowPriorityNodes(0), null);
Get Pool
BatchPool pool = batchClient.getPool("myPoolId");
System.out.println("Pool state: " + pool.getState());
System.out.println("Current dedicated nodes: " + pool.getCurrentDedicatedNodes());
List Pools
import com.azure.core.http.rest.PagedIterable;
PagedIterable<BatchPool> pools = batchClient.listPools();
for (BatchPool pool : pools) {
System.out.println("Pool: " + pool.getId() + ", State: " + pool.getState());
}
Resize Pool
import com.azure.core.util.polling.SyncPoller;
BatchPoolResizeParameters resizeParams = new BatchPoolResizeParameters()
.setTargetDedicatedNodes(4)
.setTargetLowPriorityNodes(2);
SyncPoller<BatchPool, BatchPool> poller = batchClient.beginResizePool("myPoolId", resizeParams);
poller.waitForCompletion();
BatchPool resizedPool = poller.getFinalResult();
Enable AutoScale
BatchPoolEnableAutoScaleParameters autoScaleParams = new BatchPoolEnableAutoScaleParameters()
.setAutoScaleEvaluationInterval(Duration.ofMinutes(5))
.setAutoScaleFormula("$TargetDedicatedNodes = min(10, $PendingTasks.GetSample(TimeInterval_Minute * 5));");
batchClient.enablePoolAutoScale("myPoolId", autoScaleParams);
Delete Pool
SyncPoller<BatchPool, Void> deletePoller = batchClient.beginDeletePool("myPoolId");
deletePoller.waitForCompletion();
Job Operations
Create Job
batchClient.createJob(
new BatchJobCreateParameters("myJobId", new BatchPoolInfo().setPoolId("myPoolId"))
.setPriority(100)
.setConstraints(new BatchJobConstraints()
.setMaxWallClockTime(Duration.ofHours(24))
.setMaxTaskRetryCount(3)),
null);
Get Job
BatchJob job = batchClient.getJob("myJobId", null, null);
System.out.println("Job state: " + job.getState());
List Jobs
PagedIterable<BatchJob> jobs = batchClient.listJobs(new BatchJobsListOptions());
for (BatchJob job : jobs) {
System.out.println("Job: " + job.getId() + ", State: " + job.getState());
}
Get Task Counts
BatchTaskCountsResult counts = batchClient.getJobTaskCounts("myJobId");
System.out.println("Active: " + counts.getTaskCounts().getActive());
System.out.println("Running: " + counts.getTaskCounts().getRunning());
System.out.println("Completed: " + counts.getTaskCounts().getCompleted());
Terminate Job
BatchJobTerminateParameters terminateParams = new BatchJobTerminateParameters()
.setTerminationReason("Manual termination");
BatchJobTerminateOptions options = new BatchJobTerminateOptions().setParameters(terminateParams);
SyncPoller<BatchJob, BatchJob> poller = batchClient.beginTerminateJob("myJobId", options, null);
poller.waitForCompletion();
Delete Job
SyncPoller<BatchJob, Void> deletePoller = batchClient.beginDeleteJob("myJobId");
deletePoller.waitForCompletion();
Task Operations
Create Single Task
BatchTaskCreateParameters task = new BatchTaskCreateParameters("task1", "echo 'Hello World'");
batchClient.createTask("myJobId", task);
Create Task with Exit Conditions
batchClient.createTask("myJobId", new BatchTaskCreateParameters("task2", "cmd /c exit 3")
.setExitConditions(new ExitConditions()
.setExitCodeRanges(Arrays.asList(
new ExitCodeRangeMapping(2, 4,
new ExitOptions().setJobAction(BatchJobActionKind.TERMINATE)))))
.setUserIdentity(new UserIdentity()
.setAutoUser(new AutoUserSpecification()
.setScope(AutoUserScope.TASK)
.setElevationLevel(ElevationLevel.NON_ADMIN))),
null);
Create Task Collection (up to 100)
List<BatchTaskCreateParameters> taskList = Arrays.asList(
new BatchTaskCreateParameters("task1", "echo Task 1"),
new BatchTaskCreateParameters("task2", "echo Task 2"),
new BatchTaskCreateParameters("task3", "echo Task 3")
);
BatchTaskGroup taskGroup = new BatchTaskGroup(taskList);
BatchCreateTaskCollectionResult result = batchClient.createTaskCollection("myJobId", taskGroup);
Create Many Tasks (no limit)
List<BatchTaskCreateParameters> tasks = new ArrayList<>();
for (int i = 0; i < 1000; i++) {
tasks.add(new BatchTaskCreateParameters("task" + i, "echo Task " + i));
}
batchClient.createTasks("myJobId", tasks);
Get Task
BatchTask task = batchClient.getTask("myJobId", "task1");
System.out.println("Task state: " + task.getState());
System.out.println("Exit code: " + task.getExecutionInfo().getExitCode());
List Tasks
PagedIterable<BatchTask> tasks = batchClient.listTasks("myJobId");
for (BatchTask task : tasks) {
System.out.println("Task: " + task.getId() + ", State: " + task.getState());
}
Get Task Output
import com.azure.core.util.BinaryData;
import java.nio.charset.StandardCharsets;
BinaryData stdout = batchClient.getTaskFile("myJobId", "task1", "stdout.txt");
System.out.println(new String(stdout.toBytes(), StandardCharsets.UTF_8));
Terminate Task
batchClient.terminateTask("myJobId", "task1", null, null);
Node Operations
List Nodes
PagedIterable<BatchNode> nodes = batchClient.listNodes("myPoolId", new BatchNodesListOptions());
for (BatchNode node : nodes) {
System.out.println("Node: " + node.getId() + ", State: " + node.getState());
}
Reboot Node
SyncPoller<BatchNode, BatchNode> rebootPoller = batchClient.beginRebootNode("myPoolId", "nodeId");
rebootPoller.waitForCompletion();
Get Remote Login Settings
BatchNodeRemoteLoginSettings settings = batchClient.getNodeRemoteLoginSettings("myPoolId", "nodeId");
System.out.println("IP: " + settings.getRemoteLoginIpAddress());
System.out.println("Port: " + settings.getRemoteLoginPort());
Job Schedule Operations
Create Job Schedule
batchClient.createJobSchedule(new BatchJobScheduleCreateParameters("myScheduleId",
new BatchJobScheduleConfiguration()
.setRecurrenceInterval(Duration.ofHours(6))
.setDoNotRunUntil(OffsetDateTime.now().plusDays(1)),
new BatchJobSpecification(new BatchPoolInfo().setPoolId("myPoolId"))
.setPriority(50)),
null);
Get Job Schedule
BatchJobSchedule schedule = batchClient.getJobSchedule("myScheduleId");
System.out.println("Schedule state: " + schedule.getState());
Error Handling
import com.azure.compute.batch.models.BatchErrorException;
import com.azure.compute.batch.models.BatchError;
try {
batchClient.getPool("nonexistent-pool");
} catch (BatchErrorException e) {
BatchError error = e.getValue();
System.err.println("Error code: " + error.getCode());
System.err.println("Message: " + error.getMessage().getValue());
if ("PoolNotFound".equals(error.getCode())) {
System.err.println("The specified pool does not exist.");
}
}
Best Practices
- Use Entra ID — Preferred over shared key for authentication
- Use management SDK for pools —
azure-resourcemanager-batchsupports managed identities - Batch task creation — Use
createTaskCollectionorcreateTasksfor multiple tasks - Handle LRO properly — Pool resize, delete operations are long-running
- Monitor task counts — Use
getJobTaskCountsto track progress - Set constraints — Configure
maxWallClockTimeandmaxTaskRetryCount - Use low-priority nodes — Cost savings for fault-tolerant workloads
- Enable autoscale — Dynamically adjust pool size based on workload
Reference Links
| Resource | URL |
|---|---|
| Maven Package | https://central.sonatype.com/artifact/com.azure/azure-compute-batch |
| GitHub | https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/batch/azure-compute-batch |
| API Documentation | https://learn.microsoft.com/java/api/com.azure.compute.batch |
| Product Docs | https://learn.microsoft.com/azure/batch/ |
| REST API | https://learn.microsoft.com/rest/api/batchservice/ |
| Samples | https://github.com/azure/azure-batch-samples |
このスキルのファイル
2azure-compute-batch-java skillに関する質問
Claude Codeにazure-compute-batch-java skillをインストールするには
npx degit microsoft/skills/.github/plugins/azure-sdk-java/skills/azure-compute-batch-java ~/.claude/skills/azure-compute-batch-javaを実行してください。Claude Codeは~/.claude/skills(すべてのプロジェクト)または.claude/skills(単一プロジェクト)からskillsを読み込み、説明がタスクに一致する場合にskillを使用します。
azure-compute-batch-java skillはどのクライアントで使用できますか
Agent Skills形式を読み込むすべてのクライアントで使用できます: Claude Code、Codex、Gemini CLI、claude.ai(ZIPとしてアップロード)。skill内のスクリプトは、クライアントがコード実行を許可した場合にのみ実行されます。
Azure Batchの主要なコンポーネントは何ですか?
主な概念には、Pool(compute nodeの集合)、Job(taskの論理的なグループ)、Task(計算単位)、Node(taskを実行するVM)、およびJob Scheduleが含まれます。