From 4460f2a4f98cbae9b4e18de00d561af4fff83c94 Mon Sep 17 00:00:00 2001 From: Nicholas Blaskey Date: Wed, 25 Oct 2023 13:59:45 -0400 Subject: [PATCH] remove items type --- .../pkg/schemas/expconf/log_pattern_config.go | 2 - .../expconf/zgen_log_policies_config_v0.go | 21 ---------- master/pkg/schemas/zgen_schemas.go | 38 ++----------------- schemas/expconf/v0/experiment.json | 4 +- schemas/expconf/v0/log-policies.json | 9 ----- 5 files changed, 6 insertions(+), 68 deletions(-) delete mode 100644 master/pkg/schemas/expconf/zgen_log_policies_config_v0.go delete mode 100644 schemas/expconf/v0/log-policies.json diff --git a/master/pkg/schemas/expconf/log_pattern_config.go b/master/pkg/schemas/expconf/log_pattern_config.go index c12355ee3f19..7692db460a14 100644 --- a/master/pkg/schemas/expconf/log_pattern_config.go +++ b/master/pkg/schemas/expconf/log_pattern_config.go @@ -11,8 +11,6 @@ import ( ) // LogPoliciesConfigV0 is a list of log policies. -// -//go:generate ../gen.sh type LogPoliciesConfigV0 []LogPolicyV0 // Merge implemenets the mergable interface. diff --git a/master/pkg/schemas/expconf/zgen_log_policies_config_v0.go b/master/pkg/schemas/expconf/zgen_log_policies_config_v0.go deleted file mode 100644 index 49b45b654d53..000000000000 --- a/master/pkg/schemas/expconf/zgen_log_policies_config_v0.go +++ /dev/null @@ -1,21 +0,0 @@ -// Code generated by gen.py. DO NOT EDIT. - -package expconf - -import ( - "github.com/santhosh-tekuri/jsonschema/v2" - - "github.com/determined-ai/determined/master/pkg/schemas" -) - -func (l LogPoliciesConfigV0) ParsedSchema() interface{} { - return schemas.ParsedLogPoliciesConfigV0() -} - -func (l LogPoliciesConfigV0) SanityValidator() *jsonschema.Schema { - return schemas.GetSanityValidator("http://determined.ai/schemas/expconf/v0/log-policies.json") -} - -func (l LogPoliciesConfigV0) CompletenessValidator() *jsonschema.Schema { - return schemas.GetCompletenessValidator("http://determined.ai/schemas/expconf/v0/log-policies.json") -} diff --git a/master/pkg/schemas/zgen_schemas.go b/master/pkg/schemas/zgen_schemas.go index 0a12b3563023..dd6ecf1c01f0 100644 --- a/master/pkg/schemas/zgen_schemas.go +++ b/master/pkg/schemas/zgen_schemas.go @@ -777,7 +777,9 @@ var ( "null" ], "default": [], - "optionalRef": "http://determined.ai/schemas/expconf/v0/log-policies.json" + "items": { + "$ref": "http://determined.ai/schemas/expconf/v0/log-policy.json" + } }, "max_restarts": { "type": [ @@ -1448,16 +1450,6 @@ var ( "type": true } } -`) - textLogPoliciesConfigV0 = []byte(`{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://determined.ai/schemas/expconf/v0/log-policies.json", - "title": "LogPoliciesConfig", - "type": "array", - "items": { - "$ref": "http://determined.ai/schemas/expconf/v0/log-policy.json" - } -} `) textLogPolicyV0 = []byte(`{ "$schema": "http://json-schema.org/draft-07/schema#", @@ -3154,8 +3146,6 @@ var ( schemaLogActionV0 interface{} - schemaLogPoliciesConfigV0 interface{} - schemaLogPolicyV0 interface{} schemaOptimizationsConfigV0 interface{} @@ -3799,26 +3789,6 @@ func ParsedLogActionV0() interface{} { return schemaLogActionV0 } -func ParsedLogPoliciesConfigV0() interface{} { - cacheLock.RLock() - if schemaLogPoliciesConfigV0 != nil { - cacheLock.RUnlock() - return schemaLogPoliciesConfigV0 - } - cacheLock.RUnlock() - - cacheLock.Lock() - defer cacheLock.Unlock() - if schemaLogPoliciesConfigV0 != nil { - return schemaLogPoliciesConfigV0 - } - err := json.Unmarshal(textLogPoliciesConfigV0, &schemaLogPoliciesConfigV0) - if err != nil { - panic("invalid embedded json for LogPoliciesConfigV0") - } - return schemaLogPoliciesConfigV0 -} - func ParsedLogPolicyV0() interface{} { cacheLock.RLock() if schemaLogPolicyV0 != nil { @@ -4452,8 +4422,6 @@ func schemaBytesMap() map[string][]byte { cachedSchemaBytesMap[url] = textLogActionExcludeNodeV0 url = "http://determined.ai/schemas/expconf/v0/log-action.json" cachedSchemaBytesMap[url] = textLogActionV0 - url = "http://determined.ai/schemas/expconf/v0/log-policies.json" - cachedSchemaBytesMap[url] = textLogPoliciesConfigV0 url = "http://determined.ai/schemas/expconf/v0/log-policy.json" cachedSchemaBytesMap[url] = textLogPolicyV0 url = "http://determined.ai/schemas/expconf/v0/optimizations.json" diff --git a/schemas/expconf/v0/experiment.json b/schemas/expconf/v0/experiment.json index 5885e1119d95..e11abacff7d8 100644 --- a/schemas/expconf/v0/experiment.json +++ b/schemas/expconf/v0/experiment.json @@ -114,7 +114,9 @@ "null" ], "default": [], - "optionalRef": "http://determined.ai/schemas/expconf/v0/log-policies.json" + "items": { + "$ref": "http://determined.ai/schemas/expconf/v0/log-policy.json" + } }, "max_restarts": { "type": [ diff --git a/schemas/expconf/v0/log-policies.json b/schemas/expconf/v0/log-policies.json deleted file mode 100644 index 475594526e4f..000000000000 --- a/schemas/expconf/v0/log-policies.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://determined.ai/schemas/expconf/v0/log-policies.json", - "title": "LogPoliciesConfig", - "type": "array", - "items": { - "$ref": "http://determined.ai/schemas/expconf/v0/log-policy.json" - } -}