From 728d5bd632bce888a1d16c6afc487539a65fa78e Mon Sep 17 00:00:00 2001 From: ewezy Date: Fri, 20 Sep 2024 12:58:42 +0800 Subject: [PATCH] Fix config validator tags and remove redundant config values --- api/config-dev.yaml | 1 - api/turing/config/config.go | 6 +++--- api/turing/config/example.yaml | 1 - infra/charts/turing/values.yaml | 3 +++ 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/api/config-dev.yaml b/api/config-dev.yaml index c430f6900..d4ef246c5 100644 --- a/api/config-dev.yaml +++ b/api/config-dev.yaml @@ -99,5 +99,4 @@ OpenapiConfig: ServingPath: /api-docs/ MlflowConfig: - TrackingURL: https://caraml.dev/mlflow ArtifactServiceType: "nop" diff --git a/api/turing/config/config.go b/api/turing/config/config.go index daa51d088..21b7170aa 100644 --- a/api/turing/config/config.go +++ b/api/turing/config/config.go @@ -208,7 +208,7 @@ type KanikoConfig struct { // ResourceRequestsLimits is the resources required by Kaniko executor. ResourceRequestsLimits ResourceRequestsLimits `validate:"required"` // Kaniko push registry type - PushRegistryType string `validate:"required"` + PushRegistryType string `validate:"required,oneof=docker gcr"` // Kaniko docker credential secret name for pushing to docker registries DockerCredentialSecretName string } @@ -430,8 +430,8 @@ type MLPConfig struct { } type MlflowConfig struct { - TrackingURL string `validate:"required"` - ArtifactServiceType string `validate:"required"` + TrackingURL string `validate:"required_if=ArtifactServiceType gcs ArtifactServiceType s3"` + ArtifactServiceType string `validate:"required,oneof=nop gcs s3"` } // OpenapiConfig contains the settings for the OpenAPI specs used for validation and Swagger UI diff --git a/api/turing/config/example.yaml b/api/turing/config/example.yaml index 6b8bdfa80..c6a94e3df 100644 --- a/api/turing/config/example.yaml +++ b/api/turing/config/example.yaml @@ -221,7 +221,6 @@ MLPConfig: MLPEncryptionKey: secret MlflowConfig: - TrackingURL: https://caraml.dev/mlflow ArtifactServiceType: "nop" # Turing UI configuration to set how the UI assets will be served diff --git a/infra/charts/turing/values.yaml b/infra/charts/turing/values.yaml index 9156d34d5..aa687935c 100644 --- a/infra/charts/turing/values.yaml +++ b/infra/charts/turing/values.yaml @@ -157,6 +157,7 @@ turing: Limits: CPU: "1" Memory: 1Gi + PushRegistryType: docker SparkAppConfig: CorePerCPURequest: 1.5 CPURequestToCPULimit: 1.25 @@ -180,6 +181,8 @@ turing: MaxOpenConns: 0 KubernetesLabelConfigs: {} MLPConfig: {} + MlflowConfig: + ArtifactServiceType: "nop" Sentry: Enabled: false RouterDefaults: