1#!/usr/bin/env cwl-runner
2### Materialized View Creator
3# Copyright (c) 2021. Harvard University
4#
5# Developed by Research Software Engineering,
6# Faculty of Arts and Sciences, Research Computing (FAS RC)
7# Author: Michael A Bouzinier
8#
9# Licensed under the Apache License, Version 2.0 (the "License");
10# you may not use this file except in compliance with the License.
11# You may obtain a copy of the License at
12#
13# http://www.apache.org/licenses/LICENSE-2.0
14#
15# Unless required by applicable law or agreed to in writing, software
16# distributed under the License is distributed on an "AS IS" BASIS,
17# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18# See the License for the specific language governing permissions and
19# limitations under the License.
20#
21
22cwlVersion: v1.2
23class: Workflow
24
25requirements:
26 SubworkflowFeatureRequirement: {}
27 StepInputExpressionRequirement: {}
28 InlineJavascriptRequirement: {}
29
30doc: |
31 This tool is a shortcut to create a materialized view and build
32 all indices associated with the view
33
34inputs:
35 database:
36 type: File
37 doc: Path to database connection file, usually database.ini
38 connection_name:
39 type: string
40 doc: The name of the section in the database.ini file
41 input:
42 type: File?
43 depends_on:
44 type: File?
45 doc: a special field used to enforce dependencies and execution order
46
47steps:
48 create:
49 run: create.cwl
50 doc: Load 2015 data (processed by Yun)
51 in:
52 table:
53 valueFrom: "mbsf_ab_2015"
54 domain:
55 valueFrom: "cms"
56 registry:
57 valueFrom: "mbsf_ab_2015.yaml"
58 database: database
59 input_data: input
60 connection_name: connection_name
61 when: $(inputs.input_data != null)
62 out: [ log, errors ]
63
64 index:
65 run: index.cwl
66 doc: Build indices
67 in:
68 depends_on: create/log
69 table:
70 valueFrom: "mbsf_ab_2015"
71 registry:
72 valueFrom: "mbsf_ab_2015.yaml"
73 domain:
74 valueFrom: "cms"
75 incremental:
76 valueFrom: $(true)
77 database: database
78 connection_name: connection_name
79
80 out: [ log, errors ]
81
82 vacuum:
83 run: vacuum.cwl
84 doc: Vacuum the view
85 in:
86 depends_on: index/log
87 table:
88 valueFrom: "mbsf_ab_2015"
89 registry:
90 valueFrom: "mbsf_ab_2015.yaml"
91 domain:
92 valueFrom: "cms"
93 database: database
94 connection_name: connection_name
95 out: [ log, errors ]
96
97outputs:
98 create_log:
99 type: File
100 outputSource: create/log
101 index_log:
102 type: File
103 outputSource: index/log
104 vacuum_log:
105 type: File
106 outputSource: vacuum/log
107
108 create_err:
109 type: File
110 outputSource: create/errors
111 index_err:
112 type: File
113 outputSource: index/errors
114 vacuum_err:
115 type: File
116 outputSource: vacuum/errors