共用方式為


CommandJob 類別

命令作業。

繼承
azure.ai.ml.entities._job.job.Job
CommandJob
azure.ai.ml.entities._job.parameterized_command.ParameterizedCommand
CommandJob
azure.ai.ml.entities._job.job_io_mixin.JobIOMixin
CommandJob

建構函式

CommandJob(*, inputs: Dict[str, int | str | float | bool | Input] | None = None, outputs: Dict[str, Output] | None = None, limits: CommandJobLimits | None = None, identity: ManagedIdentityConfiguration | AmlTokenConfiguration | UserIdentityConfiguration | None = None, services: Dict[str, JobService | JupyterLabJobService | SshJobService | TensorBoardJobService | VsCodeJobService] | None = None, **kwargs)

參數

services
Optional[dict[str, JobService]]

與作業相關聯之服務的唯讀資訊。

inputs
Optional[dict[str, Union[Input, str, bool, int, float]]]

對應命令中使用的輸出資料系結。

outputs
Optional[dict[str, Output]]

對應作業中使用的輸出資料系結。

identity
Optional[Union[ManagedIdentityConfiguration, AmlTokenConfiguration, UserIdentityConfiguration]]

在計算上執行時,作業將使用的身分識別。

limits
Optional[CommandJobLimits]

作業的限制。

kwargs
dict

其他組態參數的字典。

範例

設定 CommandJob。


   command_job = CommandJob(
       code="./src",
       command="python train.py --ss {search_space.ss}",
       inputs={"input1": Input(path="trial.csv")},
       outputs={"default": Output(path="./foo")},
       compute="trial",
       environment="AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33",
       limits=CommandJobLimits(timeout=120),
   )

方法

dump

以 YAML 格式將作業內容傾印到檔案中。

dump

以 YAML 格式將作業內容傾印到檔案中。

dump(dest: str | PathLike | IO, **kwargs) -> None

參數

dest
Union[<xref:PathLike>, str, IO[AnyStr]]
必要

要寫入 YAML 內容的本機路徑或檔案資料流程。 如果 dest 是檔案路徑,則會建立新的檔案。 如果 dest 是開啟的檔案,則會直接寫入檔案。

kwargs
dict

要傳遞至 YAML 序列化程式的其他引數。

例外狀況

如果 dest 是檔案路徑且檔案已經存在,則引發。

如果 dest 是開啟的檔案,而且無法寫入檔案,則引發。

屬性

base_path

資源的基底路徑。

傳回

資源的基底路徑。

傳回類型

str

creation_context

資源的建立內容。

傳回

資源的建立中繼資料。

傳回類型

distribution

分散式命令元件或作業的組態。

傳回

散發組態。

傳回類型

id

資源識別碼。

傳回

資源的全域識別碼,Azure Resource Manager (ARM) 識別碼。

傳回類型

inputs

log_files

作業輸出檔案。

傳回

記錄名稱和 URL 的字典。

傳回類型

outputs

parameters

MLFlow 參數。

傳回

MLFlow 參數已登入作業。

傳回類型

resources

命令元件或作業的計算資源組態。

傳回

命令元件或作業的計算資源組態。

傳回類型

status

工作的狀態。

傳回的常見值包括 「Running」、「Completed」 和 「Failed」。 所有可能的值為:

  • NotStarted - 這是用戶端 Run 物件在雲端提交之前所在的暫時狀態。

  • 啟動 - 執行已在雲端中開始處理。 呼叫端此時有執行識別碼。

  • 布建 - 針對指定的作業提交建立隨選計算。

  • 準備 - 正在準備執行環境,且處於兩個階段之一:

    • Docker 映射組建

    • conda 環境設定

  • 已排入佇列 - 作業會排入計算目標上的佇列。 例如,在 BatchAI 中,作業處於佇列狀態

    等候所有要求的節點準備就緒時。

  • 執行 - 作業已開始在計算目標上執行。

  • 完成 - 使用者程式碼執行已完成,且執行處於後續處理階段。

  • CancelRequested - 已要求取消作業。

  • 已完成 - 執行已順利完成。 這包括使用者程式碼執行和執行

    後續處理階段。

  • 失敗 - 執行失敗。 執行上的 Error 屬性通常會提供原因的詳細資料。

  • 已取消 - 遵循取消要求,並指出現在已成功取消執行。

  • NotResponding - 針對已啟用活動訊號的執行,最近不會傳送活動訊號。

傳回

作業的狀態。

傳回類型

studio_url

Azure ML Studio 端點。

傳回

作業詳細資料頁面的 URL。

傳回類型

type

作業的類型。

傳回

作業的類型。

傳回類型