forked from LinuxForHealth/health-patterns
-
Notifications
You must be signed in to change notification settings - Fork 1
178 lines (159 loc) · 8.5 KB
/
ibm.yaml
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
name: Deploy to IBM Cloud And Execute Enrichment Tests
on:
# release:
# types: [created]
pull_request:
branches: [ main ]
# Environment variables available to all jobs and steps in this workflow
env:
GITHUB_SHA: ${{ github.sha }}
IBM_CLOUD_API_KEY: ${{ secrets.IBM_CLOUD_API_KEY }}
ACD_API_KEY: ${{ secrets.ACD_API_KEY }}
DEFAULT_PASSWORD: ${{ secrets.DEFAULT_PASSWORD }}
IBM_CLOUD_REGION: us-east
CIS_INSTANCE: Cloud Internet Services - Health Patterns
DOMAIN_ID: 6ff29db14b24b78a36227f49e18f3177
POOL_ID: 64c39c1c0638d539cae6d5ff593a0493
CLUSTER_NAMESPACE: git${{github.run_id}}
FHIR_IP: ${CLUSTER_NAMESPACE}.wh-health-patterns.dev.watson-health.ibm.com/fhir
FHIR_DEID_IP: ${CLUSTER_NAMESPACE}.wh-health-patterns.dev.watson-health.ibm.com/fhir-deid
NIFI_IP: ${CLUSTER_NAMESPACE}.wh-health-patterns.dev.watson-health.ibm.com/
DEID_IP: ${CLUSTER_NAMESPACE}.wh-health-patterns.dev.watson-health.ibm.com/deid
EXP_KAFKA_IP: ${CLUSTER_NAMESPACE}.wh-health-patterns.dev.watson-health.ibm.com/expose-kafka
ASCVD_FROM_FHIR_IP: ${CLUSTER_NAMESPACE}.wh-health-patterns.dev.watson-health.ibm.com/ascvd-from-fhir
TERM_PREP_IP: ${CLUSTER_NAMESPACE}.wh-health-patterns.dev.watson-health.ibm.com/term-services-prep
DEID_PREP_IP: ${CLUSTER_NAMESPACE}.wh-health-patterns.dev.watson-health.ibm.com/deid-prep
NLP_INSIGHTS_IP: ${CLUSTER_NAMESPACE}.wh-health-patterns.dev.watson-health.ibm.com/nlp-insights
KAFKA_TOPIC_IN: "ingest.topic.in"
HELM_TIMEOUT: "10m0s"
LOGLEVEL: "ERROR"
jobs:
deploy:
name: Deploy Health Patterns Chart to the IBM Cloud
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
# Download and Install IBM Cloud CLI
- name: Install IBM Cloud CLI
run: |
curl -fsSL https://clis.cloud.ibm.com/install/linux | sh
ibmcloud --version
ibmcloud config --check-version=false
ibmcloud plugin install -f kubernetes-service
ibmcloud plugin install -f cis
# Authenticate with IBM Cloud CLI
- name: Authenticate into IBM Cloud Integration Squad Kubernetes Cluster
run: |
ibmcloud login --apikey "${IBM_CLOUD_API_KEY}" -r "${IBM_CLOUD_REGION}" -g dev-env-wdc-kube
ibmcloud ks cluster config --cluster health-patterns-1
# Create the Namespace and Global Load Balancer
- name: Create Namespace and GLB
run: |
kubectl create namespace ${CLUSTER_NAMESPACE}
ibmcloud cis glb-create ${DOMAIN_ID} --json '{"name" : "'${CLUSTER_NAMESPACE}'.wh-health-patterns.dev.watson-health.ibm.com", "fallback_pool" : "'${POOL_ID}'", "default_pools" : ["'${POOL_ID}'"], "ttl" : 1, "proxied" : true, "session_affinity" : "cookie"}' -i "${CIS_INSTANCE}"
# Setup and Install Ingestion Chart
- name: Install Ingestion Chart
run: |
pwd
cd helm-charts/health-patterns
kubectl config current-context
kubectl config set-context --current --namespace=${CLUSTER_NAMESPACE}
helm dependency update || true
sed -i -e "s/alvearie-nifi-headless.alvearie.svc/alvearie-nifi-headless."${CLUSTER_NAMESPACE}".svc/g" values.yaml
sed -i -e "s/\&hostname replace-me/\&hostname ${CLUSTER_NAMESPACE}.wh-health-patterns.dev.watson-health.ibm.com/g" values.yaml
cat values.yaml | grep ${CLUSTER_NAMESPACE}
helm install ingestion . --set ascvd-from-fhir.ingress.enabled=true --set deid-prep.ingress.enabled=true --set term-services-prep.ingress.enabled=true --set nlp-insights.enabled=true --set nlp-insights.ingress.enabled=true --set nlp-insights.nlpservice.quickumls.endpoint=https://quickumls.wh-health-patterns.dev.watson-health.ibm.com/match --set nlp-insights.nlpservice.acd.endpoint=https://us-east.wh-acd.cloud.ibm.com/wh-acd/api --set nlp-insights.nlpservice.acd.apikey=$ACD_API_KEY --set nlp-insights.nlpservice.acd.flow=wh_acd.ibm_clinical_insights_v1.0_standard_flow --wait --timeout $HELM_TIMEOUT
kubectl get all
# Build Enrichment Tests
- name: Build Enrichment Tests
run: |
cd enrich
echo "*************************************"
echo "* Build the testcases *"
echo "*************************************"
mvn clean install --log-file ./mvn.log -Dip.fhir=$FHIR_IP -Dip.fhir.deid=$FHIR_DEID_IP -Dip.deid.prep=$DEID_PREP_IP -Dip.term.prep=$TERM_PREP_IP -Dip.ascvd.from.fhir=$ASCVD_FROM_FHIR_IP -Dip.nlp.insights=$NLP_INSIGHTS_IP -Dpw=$DEFAULT_PASSWORD -Dloglevel=$LOGLEVEL
echo "*************************************"
echo "* Properties File: *"
echo "*************************************"
cat src/test/resources/enrich-flow.properties
# Execute Enrichment Tests
- name: Execute Enrichment Tests
run: |
cd enrich
echo "*************************************"
echo "* Waiting for 2 minutes *"
echo "*************************************"
date
sleep 120
date
echo "***********************************************"
echo "* Execute the testcases *"
echo "***********************************************"
echo "* Execute the EnrichmentInitTests *"
mvn -DskipTests=false -Dtest=EnrichmentInitTests test
echo "* Execute the BasicEnrichmentTests *"
mvn -DskipTests=false -Dtest=BasicEnrichmentTests test
echo "* Execute the EnrichmentConfigTests *"
mvn -DskipTests=false -Dtest=EnrichmentConfigTests test
echo "* Execute the ASCVDEnrichmentTests *"
mvn -DskipTests=false -Dtest=ASCVDEnrichmentTests test
echo "***********************************************"
echo "* Test Execution Summary *"
echo "***********************************************"
ls -lrt target/surefire-reports
cat target/surefire-reports/*.txt
# Build Ingestion Tests
- name: Build Ingestion Tests
run: |
cd ingest
echo "*************************************"
echo "* Build the testcases *"
echo "*************************************"
mvn clean install --log-file ./mvn.log -Dip.fhir=$FHIR_IP -Dip.fhir.deid=$FHIR_DEID_IP -Dip.nifi=$NIFI_IP -Dip.nifi.api=$NIFI_API_IP -Dip.kafka=$KAFKA_IP -Dip.deid=$DEID_IP -Dip.expkafka=$EXP_KAFKA_IP -Dkafka.topic.in=$KAFKA_TOPIC_IN -Dpw=$DEFAULT_PASSWORD -Dloglevel=$LOGLEVEL
echo "*************************************"
echo "* Properties File: *"
echo "*************************************"
cat src/test/resources/clinical-ingestion-flow.properties
# Execute Ingestion Tests
- name: Execute Ingestion Tests
run: |
cd ingest
echo "***************************************************"
echo "* Execute the testcases *"
echo "***************************************************"
echo "* Execute the BasicIngestionInitTests *"
mvn -DskipTests=false -Dtest=BasicIngestionInitTests test
echo "* Execute the BasicIngestionTests *"
mvn -DskipTests=false -Dtest=BasicIngestionTests test
echo "* Execute the BasicIngestionBLKTests *"
mvn -DskipTests=false -Dtest=BasicIngestionBLKTests test
echo "***************************************************"
echo "* Test Execution Summary *"
echo "***************************************************"
ls -lrt target/surefire-reports
cat target/surefire-reports/*.txt
# Uninstall Ingestion Chart
- name: Clean Up Ingestion Deployment
run: helm uninstall ingestion
continue-on-error: true
if: ${{ always() }}
# Delay for 30 seconds
- name: Delay for 30 seconds
run: sleep 30
continue-on-error: true
if: ${{ always() }}
# Delete Namespace
- name: Delete Namespace
run: kubectl delete namespace ${CLUSTER_NAMESPACE}
continue-on-error: true
if: ${{ always() }}
# Delete GLB
- name: Delete GLB
run: |
ibmcloud cis instance-set "${CIS_INSTANCE}"
glbid=$(ibmcloud cis glbs 6ff29db14b24b78a36227f49e18f3177 | grep ${CLUSTER_NAMESPACE})
glbid=${glbid:0:32}
ibmcloud cis glb-delete ${DOMAIN_ID} $glbid -i "${CIS_INSTANCE}"
continue-on-error: true
if: ${{ always() }}