Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Cancel queued AzureML jobs when starting a PR build #640

Merged
merged 26 commits into from
Jan 25, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
adding cancelling
  • Loading branch information
ant0nsc committed Jan 24, 2022
commit 007a69c79e65c11695ea46d57688818d7f6c73a0
2 changes: 2 additions & 0 deletions azure-pipelines/cancel_aml_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ def cancel_running_and_queued_jobs() -> None:
RunStatus.CANCEL_REQUESTED)
operation = "Cancelling" if do_cancel else "Skipping"
print(f"{operation} '{run.status}' run {run.id}: ({run.display_name})")
ant0nsc marked this conversation as resolved.
Show resolved Hide resolved
ant0nsc marked this conversation as resolved.
Show resolved Hide resolved
if do_cancel:
run.cancel()


if __name__ == "__main__":
Expand Down
4 changes: 2 additions & 2 deletions azure-pipelines/cancel_aml_jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ steps:
displayName: Use cached Conda environment AzureML_SDK
inputs:
# Beware of changing the cache key or path independently, safest to change in sync
key: 'usr_share_miniconda_azureml_conda | "$(Agent.OS)" | azure-pipelines/azureml-conda.yml'
key: 'usr_share_miniconda_azureml_conda | "$(Agent.OS)" | azure-pipelines/azureml-conda-environment.yml'
path: /usr/share/miniconda/envs
cacheHitVar: CONDA_CACHE_RESTORED

- script: conda env create --file azure-pipelines/azureml-conda.yml
- script: conda env create --file azure-pipelines/azureml-conda-environment.yml
displayName: Create Conda environment AzureML_SDK
condition: eq(variables.CONDA_CACHE_RESTORED, 'false')

Expand Down