From b0e412ae69ef0d54f94c186d6fe5134de93cfbcb Mon Sep 17 00:00:00 2001 From: Mark Feit Date: Fri, 8 Mar 2024 19:30:02 +0000 Subject: [PATCH] Switch schedules to manual. #1410 --- testbed/schedules/.gitignore | 1 - testbed/schedules/Makefile | 18 +---- testbed/schedules/README.md | 23 ++++++ testbed/schedules/build-schedules | 46 ----------- testbed/schedules/intervals.json | 13 --- testbed/schedules/output.json | 127 ++++++++++++++++++++++++++++++ 6 files changed, 154 insertions(+), 74 deletions(-) delete mode 100644 testbed/schedules/.gitignore create mode 100644 testbed/schedules/README.md delete mode 100755 testbed/schedules/build-schedules delete mode 100644 testbed/schedules/intervals.json create mode 100644 testbed/schedules/output.json diff --git a/testbed/schedules/.gitignore b/testbed/schedules/.gitignore deleted file mode 100644 index e102ff534..000000000 --- a/testbed/schedules/.gitignore +++ /dev/null @@ -1 +0,0 @@ -output.json diff --git a/testbed/schedules/Makefile b/testbed/schedules/Makefile index 349cadebe..f69026b21 100644 --- a/testbed/schedules/Makefile +++ b/testbed/schedules/Makefile @@ -1,23 +1,13 @@ # -# Makefile for Testbed Schedules +# Makefile for Testbed Skeleton # -PRODUCT := output.json - -INTERVALS := intervals.json - - default: build -BUILDER := ./build-schedules -$(PRODUCT): Makefile $(BUILDER) $(INTERVALS) - $(BUILDER) $(BUILDER_ARGS) < $(INTERVALS) > "$@" -TO_CLEAN += $(PRODUCT) - - -build: $(PRODUCT) - +build: + ../bin/validate-json output.json + @true clean: rm -rf $(TO_CLEAN) *~ diff --git a/testbed/schedules/README.md b/testbed/schedules/README.md new file mode 100644 index 000000000..b16128536 --- /dev/null +++ b/testbed/schedules/README.md @@ -0,0 +1,23 @@ +# Testbed Schedules + +When adding new repeat intervals: + +Add one named for the time: + +``` +"PT30M": { Named for the ISO interval + "repeat": "PT30M", Same as the name + "slip": "PT15M", Half the interval + "sliprand": true Allow random slip +} +``` + +Add a "strict" version: + +``` +"PT30S-strict": { Named for the ISO interval + "-strict" + "repeat": "PT30S", Same as the name + "slip": "PT30S", Shorter of interval or PT3M + "sliprand": false No random slip +} +``` diff --git a/testbed/schedules/build-schedules b/testbed/schedules/build-schedules deleted file mode 100755 index a5c86f2ca..000000000 --- a/testbed/schedules/build-schedules +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env python3 - -# Generate pSConfig schedules for all ISO 8601 durations listed on stdin - -import datetime -import isodate -import json -import re -import sys - -schedules = {} - -input_data = json.load(sys.stdin) - -assert isinstance(input_data, list) - -for interval in input_data: - - howlong = isodate.parse_duration(interval) - - # The default is to allow random slip of up to half the interval - - schedules[interval] = { - 'repeat': interval, - 'slip': isodate.duration_isoformat(howlong / 2), - 'sliprand': True - } - - # The strict version allows at most a minute of slip and doesn't - # randomize it. - - MAX_STRICT_SLIP = datetime.timedelta(minutes=3) - if howlong > MAX_STRICT_SLIP: - howlong = MAX_STRICT_SLIP - - schedules[f'{interval}-strict'] = { - 'repeat': interval, - 'slip': isodate.duration_isoformat(howlong), - 'sliprand': False - } - -print(json.dumps( - { 'schedules': schedules }, - sort_keys=True, - indent=4, - separators=(', ', ': '))) diff --git a/testbed/schedules/intervals.json b/testbed/schedules/intervals.json deleted file mode 100644 index c8bd1c88d..000000000 --- a/testbed/schedules/intervals.json +++ /dev/null @@ -1,13 +0,0 @@ -[ - "PT30S", - "PT1M", - "PT5M", - "PT10M", - "PT15M", - "PT30M", - "PT1H", - "PT4H", - "PT6H", - "PT12H", - "P1D" -] diff --git a/testbed/schedules/output.json b/testbed/schedules/output.json new file mode 100644 index 000000000..4c8f3dcff --- /dev/null +++ b/testbed/schedules/output.json @@ -0,0 +1,127 @@ +{ + "schedules": { + + "PT30S": { + "repeat": "PT30S", + "slip": "PT15S", + "sliprand": true + }, + "PT30S-strict": { + "repeat": "PT30S", + "slip": "PT30S", + "sliprand": false + }, + + "PT1M": { + "repeat": "PT1M", + "slip": "PT30S", + "sliprand": true + }, + "PT1M-strict": { + "repeat": "PT1M", + "slip": "PT1M", + "sliprand": false + }, + + "PT5M": { + "repeat": "PT5M", + "slip": "PT2M30S", + "sliprand": true + }, + "PT5M-strict": { + "repeat": "PT5M", + "slip": "PT3M", + "sliprand": false + }, + + "PT10M": { + "repeat": "PT10M", + "slip": "PT5M", + "sliprand": true + }, + "PT10M-strict": { + "repeat": "PT10M", + "slip": "PT3M", + "sliprand": false + }, + + "PT15M": { + "repeat": "PT15M", + "slip": "PT7M30S", + "sliprand": true + }, + "PT15M-strict": { + "repeat": "PT15M", + "slip": "PT3M", + "sliprand": false + }, + + + "PT1H": { + "repeat": "PT1H", + "slip": "PT30M", + "sliprand": true + }, + "PT1H-strict": { + "repeat": "PT1H", + "slip": "PT3M", + "sliprand": false + }, + + "PT30M": { + "repeat": "PT30M", + "slip": "PT15M", + "sliprand": true + }, + "PT30M-strict": { + "repeat": "PT30M", + "slip": "PT3M", + "sliprand": false + }, + + "PT4H": { + "repeat": "PT4H", + "slip": "PT2H", + "sliprand": true + }, + "PT4H-strict": { + "repeat": "PT4H", + "slip": "PT3M", + "sliprand": false + }, + + "PT6H": { + "repeat": "PT6H", + "slip": "PT3H", + "sliprand": true + }, + "PT6H-strict": { + "repeat": "PT6H", + "slip": "PT3M", + "sliprand": false + }, + + "PT12H": { + "repeat": "PT12H", + "slip": "PT6H", + "sliprand": true + }, + "PT12H-strict": { + "repeat": "PT12H", + "slip": "PT3M", + "sliprand": false + }, + + "P1D": { + "repeat": "P1D", + "slip": "PT12H", + "sliprand": true + }, + "P1D-strict": { + "repeat": "P1D", + "slip": "PT3M", + "sliprand": false + } + + } +}