← Back to Dashboard

Design 39: High Performance Computing (Batch)

Summary

This design implements Azure Batch for parallel processing (e.g., rendering, risk analysis).

Topology: Batch Nodes (VMs) run in a Spoke VNet. They peer to the Hub to mount Storage or access Licenses.

1. Key Design Decisions (ADR)

ADR-01: Allocation Mode

  • Decision: User Subscription.
  • Rationale: Deploys VMs into *your* VNet (Spoke). Default mode manages VMs in Microsoft's subscription (no VNet control).

ADR-02: Spot Instances

  • Decision: Use Spot VMs.
  • Rationale: HPC is often fault-tolerant. Spot VMs are 90% cheaper.

2. High-Level Design (HLD)

+--------------+           +--------------------------+           +--------------+
|  Job         |           |        HUB VNet          |           |  SPOKE VNet  |
|  Scheduler   |           |      (License Svr)       |           |  (Compute)   |
+------+-------+           +------------+-------------+           +------+-------+
       |                                |                                |
       v                                | (Peering)                      |
+------+-------+                        v                                v
|  Batch       |           +------------+-------------+           +------+-------+
|  Service     |---------->| Storage Account          |<--------->|  Batch Pool  |
|  (Orch)      |           | (Input/Output)           |           |  (100 VMs)   |
+--------------+           +--------------------------+           +------+-------+

3. Low-Level Design (LLD)

                               PRIMARY REGION (East US)
+-----------------------------------------------------------------------+
| HUB VNet: vnet-hub (10.0.0.0/16)                                      |
|   +-----------------------+                                           |
|   | License Server VM     |                                           |
|   +-----------|-----------+                                           |
|               |                                                       |
|               v (Peering)                                             |
+---------------|-------------------------------------------------------+
                |
+---------------|-------------------------------------------------------+
| SPOKE VNet: vnet-hpc-spoke (10.1.0.0/16)                              |
|   +-----------------------+                                           |
|   | Subnet: Batch         |                                           |
|   | [VM Node 1]           |                                           |
|   | [VM Node 2]           |                                           |
|   | ...                   |                                           |
|   | [VM Node 100]         |                                           |
|   +-----------------------+                                           |
+-----------------------------------------------------------------------+

                               SECONDARY REGION (West US)
+-----------------------------------------------------------------------+
| DR SPOKE VNet                                                         |
|   +-----------------------+                                           |
|   | Batch Account (DR)    |                                           |
|   | (Empty Pool)          |                                           |
|   +-----------------------+                                           |
+-----------------------------------------------------------------------+

4. Component Rationale

  • Batch Account: The controller.
  • Pool: The collection of VMs.

5. Strategy: High Availability (HA)

  • Job: If a Node fails, Batch requeues the task to another Node.

6. Strategy: Disaster Recovery (DR)

  • Implementation: Active-Passive.
  • Process:

* Create Batch Account in West US.

* If East US fails, submit new jobs to West US Account.

7. Strategy: Backup

  • Data: Input/Output data is in Storage (GRS).
  • Compute: Ephemeral. No backup needed.

8. Strategy: Security

  • Identity: Managed Identity on Nodes to access Storage.
  • Network: No Public IPs on Nodes (use NAT Gateway or Hub Firewall).

9. Well-Architected Framework Analysis

  • Reliability: High.
  • Security: High.
  • Cost Optimization: Excellent. Autoscaling + Spot VMs.
  • Operational Excellence: High.
  • Performance Efficiency: Excellent. Massive parallelism.

10. Detailed Traffic Flow

1. Upload: User uploads input.dat to Storage.

2. Submit: User submits Job to Batch Service.

3. Scale: Batch sees work, scales Pool to 50 VMs.

4. Execute: VMs pull input.dat, process it.

5. Output: VMs write output.dat to Storage.

6. Scale Down: Batch deletes VMs.

11. Runbook: Deployment Guide (Azure Portal)

11. Runbook: Deployment Guide (Azure Portal)

Phase 1: Create Spoke VNet

1. Search: "Virtual networks" -> + Create.

2. Resource Group: rg-hpc-spoke.

3. Name: vnet-hpc-spoke.

4. Region: East US.

5. Subnet: snet-batch (Range 10.1.0.0/24).

6. Create.

7. Peer to vnet-hub.

Phase 2: Create Batch Account

1. Search: "Batch accounts" -> + Create.

2. Resource Group: rg-hpc-spoke.

3. Name: batchcorp[uniqueid].

4. Region: East US.

5. Storage account: Select existing or create new stbatch[uniqueid].

6. Advanced:

* Pool allocation mode: User subscription. (This is Critical for VNet injection).

* *Note: You might need to grant "Contributor" to the Microsoft Azure Batch API on your subscription if prompted.*

7. Create.

Phase 3: Create Pool

1. Go to the Batch Account -> Pools -> + Add.

2. Pool ID: pool-render.

3. Image Type: Marketplace.

4. Publisher/Offer/Sku: Canonical / UbuntuServer / 20.04-LTS.

5. Node Size: Standard_F2s_v2 (Compute Optimized).

6. Scale:

* Mode: Fixed.

* Target dedicated nodes: 0.

* Target Spot/Low-priority nodes: 2 (Cheaper for testing).

7. Virtual Network:

* Virtual network: vnet-hpc-spoke.

* Subnet: snet-batch.

8. Create.

Phase 4: Verify Nodes

1. Click on pool-render.

2. Go to Nodes (Left Menu).

3. Wait for the Status to change:

* Creating -> Starting -> Idle.

4. Once Idle, they are ready to accept jobs.

5. Check IP: Click a node. It should have a Private IP from 10.1.0.x.

Phase 5: Submit Job (Optional)

1. Jobs -> + Add.

2. Job ID: job-01.

3. Pool: pool-render.

4. OK.

5. Tasks -> + Add.

6. Command line: /bin/bash -c "printenv; sleep 30".

7. Submit.

8. Watch the Task state go to Completed.