Azure / azureml-sdk-for-r

Azure Machine Learning SDK for R
https://azure.github.io/azureml-sdk-for-r/
Other
104 stars 40 forks source link

Schedule.create() on a pipeline immediately runs the pipeline #429

Open danieltorzalaonsemi opened 2 years ago

danieltorzalaonsemi commented 2 years ago

Describe the bug When I run Schedule.create() on a pipeline it immediately runs the pipeline.

To Reproduce Create a Schedule using Schedule.create() with all the parameters of a currently existing pipeline and the pipeline will start running an experiment for that pipeline immediately.

Expected behavior The schedule should be created but not run until the day found in week_days param and the time found in time_of_day param.

Here is the code I am using to create the bug:

from azureml.pipeline.core import TimeZone, PipelineEndpoint from azureml.pipeline.core.schedule import ScheduleRecurrence, Schedule from azureml.core import Workspace TIMEZONE = TimeZone.PacificStandardTime ws = Workspace.from_config() frequency="Week" interval=1 week_days=["Monday"] time_of_day="4:50" name="my_project_name_schedule" s="my_project_name" description = 'Run '+s+' every '+",".join(week_days)+' at '+time_of_day pipeline_endpoint = PipelineEndpoint.get(workspace=ws, name=s).get_pipeline()

recurrence = ScheduleRecurrence( frequency=frequency, week_days=week_days, interval=interval, time_of_day=time_of_day, time_zone=TIMEZONE) recurring_schedule = Schedule.create(ws, name=name, description=description, pipeline_id=pipeline_endpoint._published_pipeline_id, experiment_name=s, recurrence=recurrence)