

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 作业捆绑包的资产参考元素
<a name="build-job-bundle-assets"></a>

你可以使用 Deadline Cloud [作业附件](https://docs.aws.amazon.com/deadline-cloud/latest/userguide/storage-job-attachments.html)在工作站和 Deadline Cloud 之间来回传输文件。资产参考文件列出了输入文件和目录，以及附件的输出目录。如果您没有列出此文件中的所有文件和目录，则可以在使用`deadline bundle gui-submit`命令提交作业时选择它们。

如果您不使用作业附件，则此文件无效。

您可以用 YAML 格式 (`asset_references.yaml`) 或 JSON 格式 (`asset_references.json`) 定义作业模板。本节中的示例以 YAML 格式显示。

在 YAML 中，文件的格式为：

```
assetReferences:
    inputs:
        # Filenames on the submitting workstation whose file contents are needed as 
        # inputs to run the job.
        filenames:
        - {{list of file paths}}
        # Directories on the submitting workstation whose contents are needed as inputs
        # to run the job.
        directories:
        - {{list of directory paths}}

    outputs:
        # Directories on the submitting workstation where the job writes output files
        # if running locally.
        directories:
        - {{list of directory paths}}

    # Paths referenced by the job, but not necessarily input or output.
    # Use this if your job uses the name of a path in some way, but does not explicitly need
    # the contents of that path.
    referencedPaths:
    - {{list of directory paths}}
```

在选择要上传到 Amazon S3 的输入或输出文件时，Deadline Cloud 会将文件路径与您的存储配置文件中列出的路径进行比较。存储配置`SHARED`文件中的每个文件系统位置都抽象出安装在工作站和工作主机上的网络文件共享。Deadline Cloud 仅上传不在其中一个文件共享中的文件。

有关创建和使用存储配置文件的更多信息，请参阅 Dead [line Cloud *用户指南中的 Deadline Cloud* 中的共享存储](https://docs.aws.amazon.com/deadline-cloud/latest/userguide/storage-shared.html)。AWS 

**Example -由 Deadline Cloud GUI 创建的资产参考文件**  
使用以下命令通过 [blender\_rend](https://github.com/aws-deadline/deadline-cloud-samples/tree/mainline/job_bundles/blender_render) er 示例提交作业。  

```
deadline bundle gui-submit blender_render/
```
在 Job **附件选项卡上向作业**添加一些其他文件：  

![Deadline Cloud 作业提交 GUI 的作业附件窗格。添加输入文件/private/tmp/bundle_demo/a_texture.png and the input directory /private/tmp/bundle_demo/assets。](http://docs.aws.amazon.com/zh_cn/deadline-cloud/latest/developerguide/images/blender_submit_add_job_attachments.png)

提交作业后，您可以查看作业历史目录中任务捆绑包中的`asset_references.yaml`文件，以查看 YAML 文件中的资产：  

```
% cat ~/.deadline/job_history/\(default\)/2024-06/2024-06-20-01-JobBundle-Demo/asset_references.yaml 
assetReferences:
  inputs:
    filenames:
    - /private/tmp/bundle_demo/a_texture.png
    directories:
    - /private/tmp/bundle_demo/assets
  outputs:
    directories: []
  referencedPaths: []
```