Differential D5748 Diff 28836 python_modules/automation/automation/helm/schema/subschema/compute_log_manager.py
Changeset View
Changeset View
Standalone View
Standalone View
python_modules/automation/automation/helm/schema/subschema/compute_log_manager.py
- This file was added.
from enum import Enum | |||||
from typing import Any, Dict, Optional, Type | |||||
from pydantic import Extra # pylint: disable=E0611 | |||||
from .utils import BaseModel, create_json_schema_conditionals | |||||
class ComputeLogManagerType(str, Enum): | |||||
AZURE = "AzureBlobComputeLogManager" | |||||
GCS = "GCSComputeLogManager" | |||||
S3 = "S3ComputeLogManager" | |||||
CUSTOM = "CustomComputeLogManager" | |||||
class AzureBlobComputeLogManager(BaseModel): | |||||
storageAccount: str | |||||
container: str | |||||
secretKey: str | |||||
alangenfeld: these are `StringSource` in dagster config space right? so should allow
```
secretKey:
env… | |||||
rexledesmaAuthorUnsubmitted Done Inline ActionsHm, I've changed the ones that are string source to the correct schema. However for this azure compute log manager, it's typed as string which looks like a bug. https://sourcegraph.com/github.com/dagster-io/dagster/-/blob/python_modules/libraries/dagster-azure/dagster_azure/blob/compute_log_manager.py#L88-96 rexledesma: Hm, I've changed the ones that are string source to the correct schema. However for this azure… | |||||
localDir: Optional[str] | |||||
prefix: Optional[str] | |||||
class Config: | |||||
extra = Extra.forbid | |||||
class GCSComputeLogManager(BaseModel): | |||||
bucket: str | |||||
localDir: Optional[str] | |||||
prefix: Optional[str] | |||||
class Config: | |||||
extra = Extra.forbid | |||||
class S3ComputeLogManager(BaseModel): | |||||
bucket: str | |||||
localDir: Optional[str] | |||||
prefix: Optional[str] | |||||
useSsl: Optional[bool] | |||||
verify: Optional[bool] | |||||
verifyCertPath: Optional[str] | |||||
endpointUrl: Optional[str] | |||||
class Config: | |||||
extra = Extra.forbid | |||||
class CustomComputeLogManager(BaseModel): | |||||
module: str | |||||
class_: str | |||||
config: dict | |||||
class Config: | |||||
fields = {"class_": "class"} | |||||
extra = Extra.forbid | |||||
class ComputeLogManagerConfig(BaseModel): | |||||
azureBlobComputeLogManager: Optional[AzureBlobComputeLogManager] | |||||
gcsComputeLogManager: Optional[GCSComputeLogManager] | |||||
s3ComputeLogManager: Optional[S3ComputeLogManager] | |||||
customComputeLogManager: Optional[CustomComputeLogManager] | |||||
class Config: | |||||
extra = Extra.forbid | |||||
class ComputeLogManager(BaseModel): | |||||
type: Optional[ComputeLogManagerType] | |||||
config: ComputeLogManagerConfig | |||||
class Config: | |||||
extra = Extra.forbid | |||||
@staticmethod | |||||
def schema_extra(schema: Dict[str, Any], model: Type["ComputeLogManager"]): | |||||
BaseModel.Config.schema_extra(schema, model) | |||||
schema["allOf"] = create_json_schema_conditionals( | |||||
{ | |||||
ComputeLogManagerType.AZURE: "azureBlobComputeLogManager", | |||||
ComputeLogManagerType.GCS: "gcsComputeLogManager", | |||||
ComputeLogManagerType.S3: "s3ComputeLogManager", | |||||
ComputeLogManagerType.CUSTOM: "customComputeLogManager", | |||||
} | |||||
) |
these are StringSource in dagster config space right? so should allow
which i am guessing this won't do