diff --git a/schemas/vector/retiler/v2.schema.json b/schemas/vector/retiler/v2.schema.json new file mode 100644 index 00000000..bf47c784 --- /dev/null +++ b/schemas/vector/retiler/v2.schema.json @@ -0,0 +1,374 @@ +{ + "$id": "https://mapcolonies.com/vector/retiler/v2", + "type": "object", + "title": "vectorRetilerSchemaV2", + "description": "Vector's Retiler schema", + "allOf": [ + { + "$ref": "https://mapcolonies.com/common/boilerplate/v2" + }, + { + "type": "object", + "required": ["app"], + "properties": { + "app": { + "type": "object", + "description": "Application configuration", + "required": ["queueName", "map", "project", "tilesStorage", "jobQueue", "parallelism"], + "properties": { + "project": { + "$ref": "#/definitions/project" + }, + "forceProcess": { + "type": "boolean", + "description": "Force process all tiles", + "default": false, + "x-env-value": "APP_FORCE_PROCESS" + }, + "queueName": { + "type": "string", + "description": "Job queue name", + "default": "retiler-queue", + "x-env-value": "QUEUE_NAME" + }, + "parallelism": { + "type": "integer", + "description": "Number of parallel jobs", + "default": 1, + "x-env-value": "APP_PARALLELISM" + }, + "jobQueue": { + "$ref": "#/definitions/jobQueue" + }, + "map": { + "$ref": "#/definitions/map" + }, + "tilesStorage": { + "type": "object", + "description": "Tiles storage configuration", + "required": ["providers", "layout"], + "unevaluatedProperties": false, + "properties": { + "providers": { + "$ref": "#/definitions/tilesStorageProviders" + }, + "layout": { + "$ref": "#/definitions/tilesStorageLayout" + }, + "shouldFilterBlankTiles": { + "type": "boolean", + "description": "Should filter blank tiles", + "default": false, + "x-env-value": "TILES_STORAGE_SHOULD_FILTER_BLANK_TILES" + } + } + } + } + } + } + }, + { + "type": "object", + "required": ["detiler"], + "properties": { + "detiler": { + "type": "object", + "description": "Detiler configuration", + "required": ["enabled"], + "properties": { + "enabled": { + "type": "boolean", + "description": "Enable Detiler", + "default": false, + "x-env-value": "DETILER_ENABLED" + }, + "proceedOnFailure": { + "type": "boolean", + "default": false, + "x-env-value": "DETILER_PROCEED_ON_FAILURE" + }, + "client": { + "$ref": "#/definitions/detilerClient" + } + }, + "if": { + "properties": { + "enabled": { + "const": true + } + } + }, + "then": { + "required": ["client"] + }, + "else": { + "properties": { + "enabled": { + "const": false + } + } + } + } + } + } + ], + "definitions": { + "project": { + "type": "object", + "description": "Project configuration", + "required": ["name", "stateUrl"], + "properties": { + "name": { + "type": "string", + "description": "Project name", + "x-env-value": "APP_PROJECT_NAME" + }, + "stateUrl": { + "type": "string", + "description": "Project rendered state URL", + "x-env-value": "APP_PROJECT_STATE_URL" + } + } + }, + "jobQueue": { + "type": "object", + "required": ["waitTimeout", "pgBoss"], + "properties": { + "waitTimeout": { + "type": "integer", + "description": "Job queue wait timeout in milliseconds", + "x-env-value": "QUEUE_WAIT_TIMEOUT" + }, + "pgBoss": { + "allOf": [ + { + "$ref": "https://mapcolonies.com/common/db/full/v2" + }, + { + "type": "object", + "required": ["healthCheckTimeoutMs"], + "properties": { + "noSupervisor": { + "type": "boolean", + "default": true, + "description": "Disable pgBoss supervisor" + }, + "healthCheckTimeoutMs": { + "type": "integer", + "description": "PgBoss health check timeout in milliseconds", + "x-env-value": "PGBOSS_HEALTH_CHECK_TIMEOUT_MS" + } + } + } + ] + } + } + }, + "map": { + "type": "object", + "description": "DigitalMap provider configuration", + "required": ["provider", "url", "format", "wms", "client"], + "properties": { + "provider": { + "enum": ["wms", "arcgis"], + "description": "DigitalMap provider kind", + "x-env-value": "MAP_PROVIDER" + }, + "url": { + "type": "string", + "description": "DigitalMap provider URL", + "x-env-value": "MAP_URL" + }, + "format": { + "enum": ["jpg", "jpeg", "image/jpeg", "image/png", "image/webp"], + "description": "DigitalMap provider output format", + "default": "image/png", + "x-env-value": "MAP_FORMAT" + }, + "client": { + "type": "object", + "required": ["timeoutMs"], + "properties": { + "timeoutMs": { + "type": "integer", + "description": "DigitalMap provider client timeout in milliseconds", + "x-env-value": "MAP_CLIENT_TIMEOUT_MS" + } + } + }, + "wms": { + "type": "object", + "required": ["version", "layers", "styles"], + "properties": { + "version": { + "$comment": "Should I use enum instead of string?", + "type": "string", + "description": "WMS version", + "default": "1.3.0", + "x-env-value": "MAP_WMS_VERSION" + }, + "layers": { + "type": "string", + "description": "WMS layers", + "x-env-value": "MAP_WMS_LAYERS" + }, + "styles": { + "type": "string", + "description": "WMS styles", + "x-env-value": "MAP_WMS_STYLES" + }, + "isZoomLayers": { + "type": "boolean", + "description": "Is zoom layers project", + "default": false, + "x-env-value": "MAP_WMS_ZOOM_LAYERS", + "$comment": "This will be deleted in the future with new QGIS versions" + } + } + } + } + }, + "s3TilesStorageProvider": { + "type": "object", + "required": ["kind", "endpoint", "bucketName", "region", "credentials"], + "unevaluatedProperties": false, + "properties": { + "kind": { + "type": "string", + "const": "s3" + }, + "endpoint": { + "type": "string", + "description": "S3 endpoint" + }, + "bucketName": { + "type": "string", + "description": "S3 bucket name" + }, + "region": { + "type": "string", + "description": "S3 region" + }, + "forcePathStyle": { + "type": "boolean", + "description": "Force path style" + }, + "credentials": { + "type": "object", + "required": ["accessKeyId", "secretAccessKey"], + "unevaluatedProperties": false, + "properties": { + "accessKeyId": { + "type": "string" + }, + "secretAccessKey": { + "type": "string" + } + } + } + } + }, + "fsTilesStorageProvider": { + "type": "object", + "required": ["kind", "basePath"], + "unevaluatedProperties": false, + "description": "File system tiles storage provider", + "properties": { + "kind": { + "type": "string", + "const": "fs" + }, + "basePath": { + "type": "string", + "description": "File system path" + } + } + }, + "tilesStorageProviders": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/definitions/s3TilesStorageProvider" + }, + { + "$ref": "#/definitions/fsTilesStorageProvider" + } + ] + }, + "x-env-value": "TILES_STORAGE_PROVIDERS", + "x-env-format": "json" + }, + "tilesStorageLayout": { + "type": "object", + "required": ["format"], + "unevaluatedProperties": false, + "properties": { + "format": { + "type": "string", + "description": "Tiles storage layout format", + "x-env-value": "TILES_STORAGE_LAYOUT_FORMAT" + }, + "shouldFlipY": { + "type": "boolean", + "description": "Should flip Y", + "default": true, + "x-env-value": "TILES_STORAGE_LAYOUT_SHOULD_FLIP_Y" + } + } + }, + "detilerClientRetryStrategy": { + "type": "object", + "required": ["retries", "shouldResetTimeout", "isExponential", "delay"], + "properties": { + "retries": { + "type": "integer", + "description": "Number of retries", + "default": 3, + "x-env-value": "DETILER_CLIENT_RETRY_STRATEGY_RETRIES" + }, + "shouldResetTimeout": { + "type": "boolean", + "description": "Should reset timeout", + "default": true, + "x-env-value": "DETILER_CLIENT_RETRY_STRATEGY_SHOULD_RESET_TIMEOUT" + }, + "isExponential": { + "type": "boolean", + "x-env-value": "DETILER_CLIENT_RETRY_STRATEGY_IS_EXPONENTIAL" + }, + "delay": { + "type": "integer", + "description": "Delay in milliseconds", + "x-env-value": "DETILER_CLIENT_RETRY_STRATEGY_DELAY" + } + } + }, + "detilerClient": { + "type": "object", + "required": ["url"], + "properties": { + "url": { + "type": "string", + "description": "Detiler client URL", + "x-env-value": "DETILER_CLIENT_URL" + }, + "timeout": { + "type": "integer", + "description": "Detiler client timeout in milliseconds", + "default": 60000, + "x-env-value": "DETILER_CLIENT_TIMEOUT" + }, + "enableRetryStrategy": { + "type": "boolean", + "default": false, + "description": "Enable retry strategy", + "x-env-value": "DETILER_CLIENT_ENABLE_RETRY_STRATEGY" + }, + "retryStrategy": { + "$ref": "#/definitions/detilerClientRetryStrategy" + } + } + } + } +}