-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.yaml
More file actions
223 lines (220 loc) · 7.78 KB
/
template.yaml
File metadata and controls
223 lines (220 loc) · 7.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
apiVersion: scaffolder.backstage.io/v1beta3
kind: Template
metadata:
name: google-workload-composer-template.1
title: Google Composer Workload
description: Create a Google Composer workload
tags:
- cloud
- google
- composer
- workload
mesh:
icon: https://www.svgrepo.com/show/375350/cloud-composer.svg
annotations:
backstage.io/techdocs-ref: dir:.
spec:
generates: componenttype:default/workload
owner: agilelab
type: workload
parameters:
- title: Google Composer Workload Template
description: |-
This template allows you to create a Google Composer Workload in your System.
After creation you can use the Editor Wizard to customize the component and add more details to the Google Composer Workload.
- title: Basic component information
description: Basic information for this component.
required:
- name
- description
- dataproduct
- identifier
- owner
properties:
name:
title: Name
type: string
description: A human readable name used for display purposes.
ui:field: EntityNamePicker
default: Google Composer Workload
ui:options:
allowArbitraryValues: true
description:
title: Description
type: string
description: Detailed explanation about the function and the meaning of the
Google Composer workload.
default: The Google Composer workload used by this System.
dataproduct:
title: Data Product
type: string
description: Data Product this Google Composer workload is used for.
ui:field: EntitySearchPicker
ui:options:
multiSelection: false
entities:
- type: System
displayField: '{{spec.mesh.name}}'
returnField: ref
filter:
practiceShaper:
kind: instanceOf
instanceOf:
- systemtype:default/dataproduct
userFilters:
- search
- domain
- type
columns:
- name: name
path: '{{spec.mesh.name}}'
- name: owner
path: '{{spec.owner}}'
domain:
title: Domain
type: string
description: Data Product domain
ui:field: EntitySelectionPicker
ui:fieldName: dataproduct
ui:property: spec.domain
ui:widget: hidden
identifier:
title: Identifier
type: string
description: |
Autogenerated from the information above. A unique identifier for the component. It will not be editable after creation and is a string composed of [a-zA-Z] separated by any of [-_].
ui:field: ComponentIdentifierPicker
ui:options:
allowArbitraryValues: false
owner:
title: Owner
type: string
description: User/Group that owns the data product.
ui:field: EntitySelectionPicker
ui:fieldName: dataproduct
ui:property: spec.owner
ui:options:
allowArbitraryValues: false
dependsOn:
title: Additional Dependencies
type: array
description: |
A Workload could depend on other components in the same System. This information will be used to deploy the components in such an order that their dependencies already exist.
items:
type: string
ui:field: EntityRelationsPicker
ui:fieldName: dataproduct
relation: hasPart
ui:options:
allowArbitraryValues: false
readsFrom:
title: Reads from
type: array
ui:field: EntitySearchPicker
ui:options:
multiSelection: true
entities:
- type: Consumable
displayField: '{{name}}'
returnField: urn
filter:
practiceShaper:
kind: canBeReadFrom
canBeReadFrom: componenttype:default/workload
userFilters:
- search
- domain
- system
- environment
columns:
- name: name
path: '{{name}}'
- type: Resource
displayName: Resource
displayField: '{{spec.mesh.name}}'
returnField: urn
userFilters:
- search
columns:
- name: name
path: '{{metadata.name}}'
tags:
title: Tags
type: array
description: Tags for the component.
default: []
items:
type: string
- title: Artifact information
description: |
Fill out the information about the Artifact containing the Airflow DAG.
properties:
artifactName:
title: Artifact Name
type: string
description: |
The name of the artifact to be referenced. Leave empty to use the default name composed by the identifier of the component.
- title: Airflow infrastructure details
required:
- dagName
properties:
scheduleCron:
title: Cron expression defining schedule
type: string
description: Cron expression defining schedule on which the job will trigger
dagName:
title: Dag Name
type: string
description: Name of the Airflow DAG
default: dag.py
steps:
- id: template
name: Fetch Skeleton + Template
action: fetch:template
input:
url: ./skeleton
targetPath: .
values:
# Workload basic info
name: '${{ parameters.name }}'
fullyQualifiedName: '${{ parameters.name | trim }}'
description: '${{ parameters.description }}'
dataproduct: '${{ parameters.dataproduct }}'
displayName: '${{ parameters.displayName }}'
domain: '${{ parameters.domain }}'
owner: '${{ parameters.owner }}'
identifier: '${{ parameters.identifier }}'
dependsOn: ${{ parameters.dependsOn }}
readsFrom: ${{ parameters.readsFrom }}
tags: ${{ parameters.tags }}
# Artifact info
artifactName: '${{ parameters.artifactName }}'
# DAG info
scheduleCron: '${{ parameters.scheduleCron }}'
dagName: '${{ parameters.dagName }}'
# Template info
useCaseTemplateId: urn:dmb:utm:google-composer-workload-template:0.0.0
infrastructureTemplateId: urn:dmb:itm:google-composer-workload-tech-adapter:0
useCaseTemplateVersion: 0.0.0
- id: publish
name: Publish
action: witboostMeshComponent:publish:gitlab
input:
allowedHosts: ['gitlab.com']
description: This is ${{ parameters.name }}
repoUrl: 'gitlab.com?owner=AgileDMBSandbox%2F${{orgname}}%2Fmesh.repository%2F${{ parameters.domain | replace(r/domain:| |-/, "") }}%2F${{ parameters.dataproduct.split(".")[1] | replace(r/ |-/g, "") }}&repo=${{ parameters.name.split(" ") | join("") | lower }}'
rootDirectory: .
dataproduct: ${{ parameters.dataproduct }}
- id: register
name: Register
action: catalog:register
input:
repoContentsUrl: '${{ steps.publish.output.repoContentsUrl }}'
catalogInfoPath: '/catalog-info.yaml'
output:
links:
- title: Repository
url: ${{ steps.publish.output.remoteUrl }}
- title: Open in catalog
icon: catalog
entityRef: ${{ steps.register.output.entityRef }}