...
This article contains the detailed instruction on using our new Workstation Scheduler functionality. The information contained here will help you set up “automation” for various scripts that you might want to run from your SDC workstation at periodical times. Ideally, the automated scripts should be scheduled to run sometime when you are not using the system so there is little overlap which will minimize the possibility of interrupting your workflow. There are 2 main components that are needed from the researcher’s side to set up this automation.
Window’s
Task Scheduler
.yaml schedule
...
.yaml
scheduleWindows'
Task Scheduler
.yaml
schedule
The purpose of the .yaml
schedule is so that we have the timing of when to turn your workstation on/off so that we can manage resources effectively while still allowing you to schedule tasks. There are a couple things to make sure to include in the .yaml
schedule. The YAML file can be named anything as long as it is located in the prefix Workstation-Schedules
, for example s3://prod.sdc.dot.gov.team.acme-research-team/Workstation-Schedules
.
Workstation
Your workstation’s name. It should look something like
ECSPWXXX01
Timezone
Make sure the time zone you name here is the same one your workstation’s
Task Scheduler
is set to.
Schedules
For each schedule you need to include:Day
Daily: When the value of
Day
isDaily
the schedule will run every day at theTime
specifiedOn a date: When the value of
Day
is an ISO formatted date the schedule will run on that date at theTime
specifiedDay of the week: When the value of
Day
isSunday
throughSaturday
the schedule will run on that day of the week at theTime
specifiedDay of the month: When the value of
Day
is an integer-1
through31
the schedule will run on that day of the month at theTime
specified (-1
will run on the last day of the month)
Time
The time of day that the schedule will start your workstation
Time should follow an
HH:MM
format in a 24 hour clock
Duration
To fill out the duration of your task you need to run it a few times manually to understand approximately how long it takes to complete. We recommend adding anywhere from 5 - 45 minutes to the longest runtime of 3 manually run trials depending on the runtime of your script (a few minutes to many hours) to get an upper bound that minimizes the risk of shutting down your workstation early. Use your judgement on how much time to add for extra padding on your script. If your task takes 5 minutes to complete at its longest, then a 5 minute buffer would likely be enough (so you would set the duration to 10 minutes). If your task takes 5+ hours to run at its longest, it would make sense to add.
Duration should follow an
HH:MM
format
Example of .yaml
schedule
Code Block | ||
---|---|---|
| ||
Workstation: ECSPWABC01
Timezone: US/Eastern
Schedules:
- Day: Daily # Daily, ISO Date, Sunday-Saturday or Day of month (-1 for last day of the month)
Time: "10:00" # 24 hour clock
Duration: "3:00" # 0-24 hours
- Day: "2022-09-01"
Time: "09:00"
Duration: "12:00"
- Day: Monday
Time: "03:00"
Duration: "1:00"
- Day: -1
Time: "07:00"
Duration: "12:00" |
Once you have created the .yaml
schedule, please save it in your team's s3 bucket.
Windows' Task Scheduler
The Task Scheduler
is a program on Windows machines that allows for the scheduling of tasks to be run at a specific time. For this to work, the workstation needs to be on and running, which is what our Workstation Scheduler does. Below are some detailed instructions on how to set up the Task Scheduler
on your workstation.
...
To delete a task you just need to re-open the task scheduler and find it in the task scheduler library, right click on the task, and click delete. You can also do things like run the task manually, end, and disable the task temporarily.
...
.yaml
schedule
The purpose of the .yaml
schedule is so that we have the timing of when to turn your workstation on/off so that we can manage resources effectively while still allowing you to schedule tasks. There are a couple things to make sure to include in the .yaml
schedule. The YAML file can be named anything as long as it is located in the prefix Workstation-Schedules
, for example s3://prod.sdc.dot.gov.team.acme-research-team/Workstation-Schedules
.
Workstation
Your workstation’s name. It should look something like
ECSPWXXX01
Timezone
Make sure the time zone you name here is the same one your workstation’s
Task Scheduler
is set to.
Schedules
For each schedule you need to include:Day
Daily: When the value of
Day
isDaily
the schedule will run every day at theTime
specifiedOn a date: When the value of
Day
is an ISO formatted date the schedule will run on that date at theTime
specifiedDay of the week: When the value of
Day
isSunday
throughSaturday
the schedule will run on that day of the week at theTime
specifiedDay of the month: When the value of
Day
is an integer-1
through31
the schedule will run on that day of the month at theTime
specified (-1
will run on the last day of the month)
Time
The time of day that the schedule will start your workstation
Time should follow an
HH:MM
format in a 24 hour clock
Duration
To fill out the duration of your task you need to run it a few times manually to understand approximately how long it takes to complete. We recommend adding anywhere from 5 - 45 minutes to the longest runtime of 3 manually run trials depending on the runtime of your script (a few minutes to many hours) to get an upper bound that minimizes the risk of shutting down your workstation early. Use your judgement on how much time to add for extra padding on your script. If your task takes 5 minutes to complete at its longest, then a 5 minute buffer would likely be enough (so you would set the duration to 10 minutes). If your task takes 5+ hours to run at its longest, it would make sense to add.
Duration should follow an
HH:MM
format
Example of .yaml
schedule
Code Block |
---|
Workstation: ECSPWABC01
Timezone: US/Eastern
Schedules:
- Day: Daily # Daily, ISO Date, Sunday-Saturday or Day of month (-1 for last day of the month)
Time: "10:00" # 24 hour clock
Duration: "3:00" # 0-24 hours
- Day: "2022-09-01"
Time: "09:00"
Duration: "12:00"
- Day: Monday
Time: "03:00"
Duration: "1:00"
- Day: -1
Time: "07:00"
Duration: "12:00" |
...