From 79a8abd69945aed29217c162dc6d4668cb96e52e Mon Sep 17 00:00:00 2001 From: Socorro DominguezVidana Date: Tue, 18 Aug 2026 21:37:11 -0700 Subject: [PATCH] NCC-28 setting up running 3x a week for minting --- README.md | 35 +++++++++++++++++++++++++++++++--- infrastructure/doi-minter.yaml | 28 +++++++++------------------ 2 files changed, 41 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index c0901e7..dfe9723 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,9 @@ sequenceDiagram * [Simon Goring](http://goring.org): University of Wisconsin - Madison [![orcid](https://img.shields.io/badge/orcid-0000--0002--2700--4605-brightgreen.svg)](https://orcid.org/0000-0002-2700-4605) +* [Socorro Dominguez Vidana](https://ht-data.com/)[![orcid](https://img.shields.io/badge/orcid-0000--0002--7926--4935-brightgreen.svg)](https://orcid.org/0000-0002-7926-4935) + + ## Contribution We welcome user contributions to this project. All contributors are expected to follow the [code of conduct](code_of_conduct.md). Contribution guidelines can be found in the [Contributing](CONTRIBUTING.md) document. Contributors should fork this project and make a pull request indicating the nature of the changes and the intended utility. Further information for this workflow can be found on the GitHub [Pull Request Tutorial webpage](https://help.github.com/articles/about-pull-requests/). @@ -385,10 +388,36 @@ submitted less than two days ago should stay a manual act from a workstation. ### Changing the schedule -`ScheduleExpression` defaults to `cron(0 0 ? * MON,WED,FRI *)`, read in the -`ScheduleTimezone` parameter which defaults to `Los Angeles`; ie midnight Pacific on Mondays, Wednesdays and Fridays. +The schedule is set literally in `infrastructure/doi-minter.yaml`, on the +`Schedule` resource: + +```yaml +ScheduleExpression: cron(0 0 ? * MON,WED,FRI *) +ScheduleExpressionTimezone: America/Los_Angeles +``` + +Midnight Pacific on Mondays, Wednesdays and Fridays. Changing it means editing +the template and redeploying, which is deliberate — the schedule is reviewed +like any other change. -Running three times a week shortens how long a new dataset waits for its DOI, keeping the 48 hours window for datasets to settle. +It is **not** a stack parameter, and that is worth understanding. +`aws cloudformation deploy` reuses the previous value of any parameter it is not +explicitly given, so a parameter's `Default` is only ever read when the stack is +first created. Editing a `Default` would appear to change the schedule while +leaving every existing stack untouched. Inlining the value removes that trap. + +Running three times a week shortens how long a new dataset waits for its DOI, +while keeping the 48-hour window for records to settle. It does not mint +anything sooner than two days after creation — that floor comes from +`ds_timeslice.sql`, not the schedule. Runs with nothing to do report +`0 to process` and exit in a couple of seconds. + +To stop a schedule without redeploying: + +```bash +aws scheduler update-schedule --name neotoma-doi-minting-prod \ + --region us-east-2 --state DISABLED +``` ## Neotoma DOI Metadata diff --git a/infrastructure/doi-minter.yaml b/infrastructure/doi-minter.yaml index cf22cfb..ca45a82 100644 --- a/infrastructure/doi-minter.yaml +++ b/infrastructure/doi-minter.yaml @@ -45,23 +45,6 @@ Parameters: Type: String Description: Address notified when a minting run fails. - ScheduleExpression: - Type: String - Default: cron(0 0 ? * MON,WED,FRI *) - Description: > - When to run, interpreted in ScheduleTimezone. The default is midnight on - Mondays, Wednesdays and Fridays. Note the selection query only picks up - datasets more than two days old, so running more often shortens the wait - before a new dataset is minted rather than minting anything sooner. - - ScheduleTimezone: - Type: String - Default: America/Los_Angeles - Description: > - IANA timezone the schedule is read in. Using a named zone rather than UTC - keeps the local run time fixed across daylight saving changes, instead of - drifting by an hour twice a year. - ScheduleEnabled: Type: String Default: "DISABLED" @@ -257,8 +240,15 @@ Resources: Name: !Sub "neotoma-doi-minting-${Environment}" Description: Neotoma DOI minting run (midnight, Mondays/Wednesdays/Fridays). State: !Ref ScheduleEnabled - ScheduleExpression: !Ref ScheduleExpression - ScheduleExpressionTimezone: !Ref ScheduleTimezone + # Literal rather than a stack parameter on purpose. `aws cloudformation + # deploy` reuses the previous value of any parameter it is not given, so a + # parameter's Default is only ever read when a stack is first created — + # editing the Default would silently leave existing stacks on their old + # schedule. Inlining means a change here always takes effect on deploy. + # Midnight Mondays/Wednesdays/Fridays, Pacific. A named IANA zone keeps + # the local time fixed rather than drifting an hour at each DST change. + ScheduleExpression: cron(0 0 ? * MON,WED,FRI *) + ScheduleExpressionTimezone: America/Los_Angeles FlexibleTimeWindow: Mode: "OFF" Target: