|
| 1 | +--- |
| 2 | +# The JSONSchema for the 'JobDefinition' (JD) YAML files. |
| 3 | +# |
| 4 | +# See https://json-schema.org/understanding-json-schema/index.html |
| 5 | + |
| 6 | +$schema: http://json-schema.org/draft-07/schema# |
| 7 | + |
| 8 | +title: Data Manager Job Definition |
| 9 | +description: >- |
| 10 | + Defines one or more jobs that can be executed |
| 11 | + by the Data manager Job Operator |
| 12 | +
|
| 13 | +type: object |
| 14 | +properties: |
| 15 | + kind: |
| 16 | + const: DataManagerJobDefinition |
| 17 | + kind-version: |
| 18 | + enum: |
| 19 | + - '2021.1' |
| 20 | + name: |
| 21 | + type: string |
| 22 | + maxLength: 80 |
| 23 | + description: |
| 24 | + tyep: string |
| 25 | + collection: |
| 26 | + type: string |
| 27 | + minLength: 1 |
| 28 | + maxLength: 80 |
| 29 | + pattern: '^[a-z]{1}[a-z0-9-]*$' |
| 30 | + repository-url: |
| 31 | + type: string |
| 32 | + maxlength: 2048 |
| 33 | + format: uri |
| 34 | + repository-tag: |
| 35 | + type: string |
| 36 | + minLength: 1 |
| 37 | + maxLength: 24 |
| 38 | + jobs: |
| 39 | + $ref: '#/definitions/job-identity' |
| 40 | +required: |
| 41 | +- kind |
| 42 | +- kind-version |
| 43 | +- collection |
| 44 | +- repository-url |
| 45 | +- repository-tag |
| 46 | +- jobs |
| 47 | + |
| 48 | +# Sub-object definitions ------------------------------------------------------ |
| 49 | +# Things like the Job structure, Image structure etc. |
| 50 | + |
| 51 | +definitions: |
| 52 | + |
| 53 | + # A Job. |
| 54 | + # Consists of an identity (i.e. 'filter-molecules') |
| 55 | + # followed by a Job object. |
| 56 | + job-identity: |
| 57 | + type: object |
| 58 | + patternProperties: |
| 59 | + '^[a-z]{1}[a-z0-9-]{0,79}$': |
| 60 | + $ref: '#/definitions/job' |
| 61 | + additionalProperties: false |
| 62 | + minProperties: 1 |
| 63 | + |
| 64 | + # An individual Job |
| 65 | + job: |
| 66 | + type: object |
| 67 | + properties: |
| 68 | + name: |
| 69 | + type: string |
| 70 | + minLength: 1 |
| 71 | + maxLength: 80 |
| 72 | + description: |
| 73 | + type: string |
| 74 | + version: |
| 75 | + type: string |
| 76 | + minLength: 1 |
| 77 | + maxLength: 24 |
| 78 | + category: |
| 79 | + type: string |
| 80 | + doc-url: |
| 81 | + type: string |
| 82 | + keywords: |
| 83 | + type: array |
| 84 | + items: |
| 85 | + type: string |
| 86 | + image: |
| 87 | + $ref: '#/definitions/image' |
| 88 | + command-encoding: |
| 89 | + const: JINJA2_3_0 |
| 90 | + command: |
| 91 | + type: string |
| 92 | + minLength: 1 |
| 93 | + maxLength: 4096 |
| 94 | + required: |
| 95 | + - version |
| 96 | + - image |
| 97 | + - command |
| 98 | + - name |
| 99 | + |
| 100 | + # A Job container image |
| 101 | + # The 'type' is optional and is used to indicate |
| 102 | + # a single job _image_ (the default) or a workflow image like _nextflow_ |
| 103 | + image: |
| 104 | + type: object |
| 105 | + additionalProperties: false |
| 106 | + properties: |
| 107 | + name: |
| 108 | + type: string |
| 109 | + minLength: 1 |
| 110 | + maxLenght: 120 |
| 111 | + tag: |
| 112 | + type: string |
| 113 | + minLength: 1 |
| 114 | + maxLength: 24 |
| 115 | + project-directory: |
| 116 | + type: string |
| 117 | + minLength: 1 |
| 118 | + maxLength: 255 |
| 119 | + pattern: '^(/[a-zA-Z0-9_-]+)+$' |
| 120 | + working-directory: |
| 121 | + type: string |
| 122 | + minLength: 1 |
| 123 | + maxLength: 255 |
| 124 | + pattern: '^(/[a-zA-Z0-9_-]+)+$' |
| 125 | + type: |
| 126 | + type: string |
| 127 | + enum: |
| 128 | + - simple |
| 129 | + - nextflow |
| 130 | + default: simple |
| 131 | + pull-secret: |
| 132 | + $ref: '#/definitions/rfc-1035-name' |
| 133 | + environment: |
| 134 | + $ref: '#/definitions/env-var-name' |
| 135 | + required: |
| 136 | + - name |
| 137 | + - tag |
| 138 | + - project-directory |
| 139 | + |
| 140 | + # Image environment definitions. |
| 141 | + environment: |
| 142 | + type: array |
| 143 | + items: |
| 144 | + anyOf: |
| 145 | + - $ref: '#/definitions/environment-value-from-api-token' |
| 146 | + |
| 147 | + # An Image environment from an 'api-token'. |
| 148 | + # Roles is an optional list of API token realm roles where, for now, |
| 149 | + # we limit the number in the list to a maximum 1. |
| 150 | + environment-value-from-api-token: |
| 151 | + type: object |
| 152 | + additionalProperties: false |
| 153 | + properties: |
| 154 | + name: |
| 155 | + $ref: '#/definitions/environment-name' |
| 156 | + value-from: |
| 157 | + type: object |
| 158 | + properties: |
| 159 | + api-token: |
| 160 | + type: object |
| 161 | + properties: |
| 162 | + roles: |
| 163 | + type: array |
| 164 | + items: |
| 165 | + type: string |
| 166 | + pattern: '^[a-z]{1,}[a-z-_]{0,}$' |
| 167 | + minItems: 0 |
| 168 | + maxItems: 1 |
| 169 | + uniqueItems: true |
| 170 | + required: |
| 171 | + - api-token |
| 172 | + required: |
| 173 | + - name |
| 174 | + - value-from |
| 175 | + |
| 176 | + # The pattern for Image environment names. |
| 177 | + # Classic linux/shell, |
| 178 | + # i.e. letters, digits and '_' and must begin letter or '_' |
| 179 | + env-var-name: |
| 180 | + type: string |
| 181 | + minLength: 1 |
| 182 | + pattern: '^[a-zA-Z_]{1,}[a-zA-Z0-9_]{0,}$' |
| 183 | + |
| 184 | + # The pattern for RFC 1035 label names. |
| 185 | + rfc-1035-name: |
| 186 | + type: string |
| 187 | + minLength: 1 |
| 188 | + maxLength: 63 |
| 189 | + pattern: '^[a-z]([a-z0-9-]*[a-z0-9])?$' |
0 commit comments