

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 任務套件的資產參考元素
<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 的輸入或輸出檔案時，截止日期雲端會將檔案路徑與儲存設定檔中列出的路徑進行比較。儲存描述檔中的每個 `SHARED`類型檔案系統位置都會摘要掛載在工作站和工作者主機上的網路檔案共用。截止日期 雲端只會上傳不在其中一個檔案共享上的檔案。

如需建立和使用儲存設定檔的詳細資訊，請參閱[《 截止日期雲端使用者指南》中的在截止日期雲端中共用儲存](https://docs.aws.amazon.com/deadline-cloud/latest/userguide/storage-shared.html)。 *AWS *

**Example - 截止日期雲端 GUI 建立的資產參考檔案**  
使用以下命令，使用 [blender\_render 範例](https://github.com/aws-deadline/deadline-cloud-samples/tree/mainline/job_bundles/blender_render)提交任務。  

```
deadline bundle gui-submit blender_render/
```
將一些額外的檔案新增至任務**附件索引標籤上的任務**：  

![截止日期雲端任務提交 GUI 的任務連接窗格。新增輸入檔案 /private/tmp/bundle_demo/a_texture.png 和輸入目錄 /private/tmp/bundle_demo/assets。](http://docs.aws.amazon.com/zh_tw/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: []
```