Batch 服务工作流和资源Batch service workflow and resources

这篇 Azure Batch 服务核心组件的概述,将介绍 Batch 开发人员可用来构建大规模并发计算解决方案的高级工作流,以及使用的主要服务资源。In this overview of the core components of the Azure Batch service, we discuss the high-level workflow that Batch developers can use to build large-scale parallel compute solutions, along with the primary service resources that are used.

不管是在开发可发出直接 REST API 调用的分布式计算应用程序或服务,还是使用某个 Batch SDK,都可以使用此处介绍的多种资源和功能。Whether you're developing a distributed computational application or service that issues direct REST API calls or you're using another one of the Batch SDKs, you'll use many of the resources and features discussed here.

提示

有关 Batch 服务的更全面介绍,请参阅 Basics of Azure Batch(Azure Batch 基础知识)。For a higher-level introduction to the Batch service, see Basics of Azure Batch. 另请参阅最新的 Batch 服务更新Also see the latest Batch service updates.

基本工作流Basic workflow

几乎所有使用 Batch 服务处理并行工作负荷的应用程序和服务都使用以下典型高级工作流:The following high-level workflow is typical of nearly all applications and services that use the Batch service for processing parallel workloads:

  1. 将要处理的数据文件上传到 Azure 存储帐户。Upload the data files that you want to process to an Azure Storage account. Batch 包含访问 Azure Blob 存储的内置支持,在运行任务时,任务可以将这些文件下载到计算节点Batch includes built-in support for accessing Azure Blob storage, and your tasks can download these files to compute nodes when the tasks are run.
  2. 上传任务所要运行的 应用程序文件Upload the application files that your tasks will run. 这些文件可能是二进制文件或脚本及其依赖项,并由作业中的任务执行。These files can be binaries or scripts and their dependencies, and are executed by the tasks in your jobs. 任务可以从存储帐户下载这些文件,也可使用 Batch 的 应用程序包 功能来管理和部署应用程序。Your tasks can download these files from your Storage account, or you can use the application packages feature of Batch for application management and deployment.
  3. 创建计算节点的 Create a pool of compute nodes. 创建池时,可以指定池的计算节点数目、其大小和操作系统。When you create a pool, you specify the number of compute nodes for the pool, their size, and the operating system. 运行作业中的每个任务时,会将任务分配到池中的某个节点以执行。When each task in your job runs, it's assigned to execute on one of the nodes in your pool.
  4. 创建 作业Create a job. 作业管理任务的集合。A job manages a collection of tasks. 可将每个作业关联到要运行该作业的任务的特定池。You associate each job to a specific pool where that job's tasks will run.
  5. 任务添加到作业。Add tasks to the job. 每个任务将运行上传的应用程序或脚本,以处理它从存储帐户下载的数据文件。Each task runs the application or script that you uploaded to process the data files it downloads from your Storage account. 当每个任务完成时,可将其输出上传到 Azure 存储。As each task completes, it can upload its output to Azure Storage.
  6. 监视作业进度并从 Azure 存储检索任务输出。Monitor job progress and retrieve the task output from Azure Storage.

备注

需要有批处理帐户才能使用批处理服务。You need a Batch account to use the Batch service. 此外,大多数 Batch 解决方案都可以使用关联的 Azure 存储帐户存储和检索文件。Most Batch solutions also use an associated Azure Storage account for file storage and retrieval.

Batch 服务资源Batch service resources

以下主题介绍可启用分布式计算方案的 Batch 资源。The following topics discuss the resources of Batch that enable your distributed computational scenarios.

后续步骤Next steps

  • 了解适用于生成批处理解决方案的批处理 API 和工具Learn about the Batch APIs and tools available for building Batch solutions.
  • 了解使用 Batch .NET 客户端库开发支持 Batch 的应用程序的基本概念。Learn the basics of developing a Batch-enabled application using the Batch .NET client library. 这些快速入门介绍了使用 Batch 服务在多个计算节点上执行工作负荷的示例应用程序,并说明了如何使用 Azure 存储进行工作负荷文件暂存和检索。These quickstarts guide you through a sample application that uses the Batch service to execute a workload on multiple compute nodes, and includes using Azure Storage for workload file staging and retrieval.
  • 下载并安装 Batch Explorer,供开发 Batch 解决方案时使用。Download and install Batch Explorer for use while you develop your Batch solutions. 借助 Batch Explorer 来创建、调试和监视 Azure Batch 应用程序。Use Batch Explorer to help create, debug, and monitor Azure Batch applications.
  • 请参阅社区资源,包括 Stack OverflowBatch 社区存储库Azure Batch 论坛See community resources including Stack Overflow, the Batch Community repo, and the Azure Batch forum.