зеркало из https://github.com/Azure/aml-run.git
added artifact download
This commit is contained in:
Родитель
c06ec79813
Коммит
3b6e330848
|
@ -9,5 +9,6 @@
|
|||
"pipeline_publish": false,
|
||||
"pipeline_name": "<your-pipeline-name>",
|
||||
"pipeline_version": "<your-pipeline-version>",
|
||||
"pipeline_continue_on_step_failure": false
|
||||
"pipeline_continue_on_step_failure": false,
|
||||
"download_artifacts": false
|
||||
}
|
||||
|
|
|
@ -114,7 +114,8 @@ A sample file can be found in this repository in the folder `.cloud/.azure`. The
|
|||
| pipeline_publish | | bool | false | Indicates whether the action will publish the pipeline after submitting it to Azure Machine Learning. This only works if you submitted a pipeline. |
|
||||
| pipeline_name | | str | <REPOSITORY_NAME>-<BRANCH_NAME> | The name of the published pipeline. |
|
||||
| pipeline_version | | str | null | The version of the published pipeline. |
|
||||
| pipeline_continue_on_step_failure | | bool | false | Indicates whether the published pipeline will continue execution of other steps in the PipelineRun if a step fails. |
|
||||
| pipeline_continue_on_step_failure | | bool | false | Indicates whether the published pipeline will continue execution of other steps in the PipelineRun if a step fails. |
|
||||
| download_artifacts | | bool | false | Indicates whether the created artifacts and logs from runs, pipelines and steps will be downloaded to your GitHub workspace. This only works if `wait_for_completion` is set to true. |
|
||||
|
||||
### Outputs
|
||||
|
||||
|
@ -128,6 +129,7 @@ A sample file can be found in this repository in the folder `.cloud/.azure`. The
|
|||
| published_pipeline_id | Id of the published pipeline (will only be provided if you submitted a pipeline and pipeline_publish is set to True) |
|
||||
| published_pipeline_status | Status of the published pipeline (will only be provided if you submitted a pipeline and pipeline_publish is set to True) |
|
||||
| published_pipeline_endpoint | Endpoint of the published pipeline (will only be provided if you submitted a pipeline and pipeline_publish is set to True) |
|
||||
| artifact_path | Path of downloaded artifacts and logs from Azure Machine Learning (pipeline) run (will only be provided if wait_for_completion and download_artifacts is set to True) |
|
||||
|
||||
### Other Azure Machine Learning Actions
|
||||
|
||||
|
|
|
@ -26,6 +26,8 @@ outputs:
|
|||
description: "Status of the publised pipeline (will only be provided if you submitted a pipeline and pipeline_publish is set to True)"
|
||||
published_pipeline_endpoint:
|
||||
description: "Endpoint of the publised pipeline (will only be provided if you submitted a pipeline and pipeline_publish is set to True)"
|
||||
artifact_path:
|
||||
description: "Path of downloaded artifacts and logs from Azure Machine Learning (pipeline) run (will only be provided if wait_for_completion and download_artifacts is set to True)"
|
||||
branding:
|
||||
icon: "chevron-up"
|
||||
color: "blue"
|
||||
|
|
18
code/main.py
18
code/main.py
|
@ -173,6 +173,24 @@ def main():
|
|||
print(f"::set-output name=run_metrics::{run_metrics}")
|
||||
print(f"::set-output name=run_metrics_markdown::{run_metrics_markdown}")
|
||||
|
||||
# Download artifacts if enabled
|
||||
if parameters.get("download_artifacts", False):
|
||||
# Defining artifacts folder
|
||||
print("::debug::Defining artifacts folder")
|
||||
root_path = os.environ.get("GITHUB_WORKSPACE", default=None)
|
||||
folder_name = f"aml_artifacts_{run.id}"
|
||||
artifact_path = os.path.join(root_path, folder_name)
|
||||
|
||||
# Downloading artifacts
|
||||
print("::debug::Downloading artifacts")
|
||||
run.download_files(output_directory=os.path.join(artifact_path, f"parent_{run.id}"))
|
||||
children = run.get_children(recursive=True)
|
||||
for child in children:
|
||||
child.download_files(output_directory=os.path.join(artifact_path, f"child_{child.id}"))
|
||||
|
||||
# Creating additional outputs
|
||||
print(f"::set-output name=artifact_path::{artifact_path}")
|
||||
|
||||
# Publishing pipeline
|
||||
print("::debug::Publishing pipeline")
|
||||
if type(run) is PipelineRun and parameters.get("publish_pipeline", False):
|
||||
|
|
|
@ -77,6 +77,10 @@ parameters_schema = {
|
|||
"pipeline_continue_on_step_failure": {
|
||||
"type": "boolean",
|
||||
"description": "Indicates whether the published pipeline will continue execution of other steps in the PipelineRun if a step fails."
|
||||
},
|
||||
"download_artifacts": {
|
||||
"type": "boolean",
|
||||
"description": "Indicates whether the created artifacts and logs from runs, pipelines and steps will be downloaded to your GitHub workspace."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче