Пример #1
0
 def is_completed(run: Run) -> bool:
     status = run.get_status()
     if run.status == RunStatus.COMPLETED:
         return True
     logging.info(
         f"Run {run.id} in experiment {run.experiment.name} finished with status {status}."
     )
     return False
def run_pipeline(ws, published_pipeline, aad_token):
    # specify the param when running the pipeline
    response = requests.post(published_pipeline.endpoint,
                             headers=aad_token,
                             json={
                                 "ExperimentName": published_pipeline.name,
                                 "RunSource": "SDK"
                             })

    try:
        run_id = response.json()["Id"]
    except:
        print(response)
        exit(1)

    experiment = Experiment(ws, pipeline_name)

    run = Run(experiment, run_id)

    while run.get_status() != 'Completed':
        print("Run status: %s" % run.get_status())
        time.sleep(5)

    print("Run status: %s" % run.get_status())