Path5.Mod1.d - Run Pipelines - Schedules and Triggers Flashcards

1
Q

RT CT

Two Trigger classes used for scheduling jobs and their respective parameters

A
  • The RecurrenceTrigger:
    frequency: Time units - minute,hour,day,week,month
    interval: integer indicating how often the schedule fires
  • The CronTrigger:
    expression: this needs to be in Cron Syntax
    start_time: the time to start the trigger
    time_zone: “Eastern Standard Time” or similar
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Explain Crontab Syntax

A

Cron syntax uses 5 space-delimited fields, where a wildcard * specifies all possible values.

expression="* * * * *" in this order:
Minutes: 0-59
Hours: 0-23 MILITARY TIME
Days: NOT SUPPORTED. this value is ignored for *
MONTHS: NOT SUPPORTED. this value is ignored for *
Days-Of-Week: 0-6, 0=Sunday. Or you can use “Sunday”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

JS, n t c_j

Class type to schedule a pipeline job and its respective parameters

A

The JobSchedule class
- name: display name of the scheduled job, used as part of a format
- trigger: an instance of a Trigger class
- create_job: an instance of the job to run

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

JS, n t c_j

  • Display name format for JobSchedule scheduled jobs
A

Display names look like:

<name><datetime the job started>:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Explain what this code does:

from azure.ai.ml.entities import RecurrenceTrigger, JobSchedule

schedule_name = "run_every_minute"

// 1. What is this doing?
one_min_recurrence_trigger = RecurrenceTrigger(
    frequency="minute",
    interval=1,
)

// 2. What is this doing?
job_schedule = JobSchedule(
    name=schedule_name,
    trigger=one_min_recurrence_trigger,
    create_job=pipeline_job
)

// 3. What this code doing?
job_schedule = ml_client.schedules.begin_create_or_update(
    schedule=job_schedule
).result()

// 4. What this code doing?
ml_client.schedules.begin_disable(name=schedule_name).result()
ml_client.schedules.begin_delete(name=schedule_name).result()
A
  1. Creates a RecurrenceTrigger that kicks off once a minute
  2. Creates JobSchedule job with the name "run_every_minute", using the RecurrentTrigger we just created and the pipeline_job we created earlier in the deck
  3. Schedules the job and gets and instance of that job
  4. Disables then deletes the scheduled job via looking up the schedule_name
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Explain what this code does:

schedule_name = "simple_sdk_create_schedule_cron"

schedule_start_time = datetime.utcnow()

// 1. What this code doing?
cron_trigger = CronTrigger(
    expression="15 15 * * 1",
    start_time="2022-07-10T10:00:00", # start time
    time_zone="Eastern Standard Time", # time zone of expression
)

// 2. What this code doing?
job_schedule = JobSchedule(
    name=schedule_name, 
		trigger=cron_trigger, 
		create_job=pipeline_job
)

// 3. What this code doing?
job_schedule = ml_client.schedules.begin_create_or_update(
    schedule=job_schedule
).result()
A
  1. Creates a CronTrigger with an expression indicating to run the job every day Monday at 3:15pm. Keep in mind the expression is in military time: 15 mins, 15th hour of the day
  2. Create a new schedule with the trigger
  3. Adds the new Schedule to the schedules
How well did you know this?
1
Not at all
2
3
4
5
Perfectly