Skip to content

Instantly share code, notes, and snippets.

@csiebler
Created May 15, 2020 11:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save csiebler/d40bd020dc989a10d0613897b6365d76 to your computer and use it in GitHub Desktop.
Save csiebler/d40bd020dc989a10d0613897b6365d76 to your computer and use it in GitHub Desktop.
Get run_id of training run in Azure Machine Learning Pipeline Step

In train.py:

run.tag('run_type', value='training')

In later step:

#Retrieve associated run, workspace and experiment
run = Run.get_context()
ws = run.experiment.workspace
exp = run.experiment
parent_run = run.parent

# Retrieve training run via parent run of pipeline
training_run = list(parent_run.get_children(tags={'run_type': 'training'}))[0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment