README.md 21.9 KB
Newer Older
1
2
# Helm Installation Instructions

Daniel Scholl's avatar
Daniel Scholl committed
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
__CLI Login__

Login to Azure CLI using the OSDU Environment Service Principal.

```bash
# This logs your local Azure CLI in using the configured service principal.
az login --service-principal -u $ARM_CLIENT_ID -p $ARM_CLIENT_SECRET --tenant $ARM_TENANT_ID
```

__Helm Values__

Create the helm chart values file necessary to install charts.

- Download [helm-config.yaml](https://community.opengroup.org/osdu/platform/deployment-and-operations/infra-azure-provisioning/-/raw/master/charts/helm-config.yaml), which will configure OSDU on Azure.

  `wget https://community.opengroup.org/osdu/platform/deployment-and-operations/infra-azure-provisioning/-/raw/master/charts/helm-config.yaml -O config.yaml`

- Edit the newly downloaded [config.yaml](https://community.opengroup.org/osdu/platform/deployment-and-operations/infra-azure-provisioning/-/raw/master/charts/helm-config.yaml) and fill out the required sections `azure`, `ingress` and `istio`.

Daniel Scholl's avatar
Daniel Scholl committed
22
23


Daniel Scholl's avatar
Daniel Scholl committed
24
25
26
27
28
```bash
# Setup Variables
ADMIN_EMAIL="<your_cert_admin>"     # ie: admin@email.com
DNS_HOST="<your_ingress_hostname>"  # ie: osdu.contoso.com

Jason's avatar
Jason committed
29
GROUP=$(az group list --query "[?contains(name, 'cr${UNIQUE}')].name" -otsv)
Daniel Scholl's avatar
Daniel Scholl committed
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
ENV_VAULT=$(az keyvault list --resource-group $GROUP --query [].name -otsv)

# Translate Values File
cat > config.yaml << EOF
# This file contains the essential configs for the osdu on azure helm chart
global:

  # Service(s) Replica Count
  replicaCount: 2

  ################################################################################
  # Specify the azure environment specific values
  #
  azure:
    tenant: $(az keyvault secret show --id https://${ENV_VAULT}.vault.azure.net/secrets/tenant-id --query value -otsv)
    subscription: $(az keyvault secret show --id https://${ENV_VAULT}.vault.azure.net/secrets/subscription-id --query value -otsv)
    resourcegroup: $(az keyvault secret show --id https://${ENV_VAULT}.vault.azure.net/secrets/base-name-cr --query value -otsv)-rg
    identity: $(az keyvault secret show --id https://${ENV_VAULT}.vault.azure.net/secrets/base-name-cr --query value -otsv)-osdu-identity
    identity_id: $(az keyvault secret show --id https://${ENV_VAULT}.vault.azure.net/secrets/osdu-identity-id --query value -otsv)
    keyvault: $ENV_VAULT
    appid: $(az keyvault secret show --id https://${ENV_VAULT}.vault.azure.net/secrets/aad-client-id --query value -otsv)

  ################################################################################
  # Specify the Ingress Settings
  # DNS Hostname for thet Gateway
  # Admin Email Address to be notified for SSL expirations
  # Lets Encrypt SSL Server
  #     https://acme-staging-v02.api.letsencrypt.org/directory  --> Staging Server
  #     https://acme-v02.api.letsencrypt.org/directory --> Production Server
  #
  ingress:
    hostname: $DNS_HOST
    admin: $ADMIN_EMAIL
    sslServer: https://acme-v02.api.letsencrypt.org/directory  # Production

  ################################################################################
  # Specify the istio specific values
  # based64 encoded username and password
  #
  istio:
Jason's avatar
Jason committed
70
71
    username: $(az keyvault secret show --id https://${COMMON_VAULT}.vault.azure.net/secrets/istio-username --query value -otsv)
    password: $(az keyvault secret show --id https://${COMMON_VAULT}.vault.azure.net/secrets/istio-password --query value -otsv)
Daniel Scholl's avatar
Daniel Scholl committed
72
73
EOF
```
74
75
76
77
78
79
80
81
82
83
84
85
Create the helm chart values file necessary to install airflow charts.

- Download [helm-config.yaml](https://community.opengroup.org/osdu/platform/deployment-and-operations/infra-azure-provisioning/-/raw/master/charts/airflow/helm-config.yaml), which will configure OSDU on Azure.

  `wget https://community.opengroup.org/osdu/platform/deployment-and-operations/infra-azure-provisioning/-/raw/master/charts/airflow/helm-config.yaml -O config_airflow.yaml`

- Edit the newly downloaded [config_airflow.yaml](https://community.opengroup.org/osdu/platform/deployment-and-operations/infra-azure-provisioning/-/raw/master/charts/airflow/helm-config.yaml) and fill out the required sections `externalDatabase` and `externalRedis`.



```bash
# Setup Variables
86
87
BRANCH="master"
TAG="latest"
88
DNS_HOST="<your_ingress_hostname>"  # ie: osdu.contoso.com
89

90
91
92
93
94
GROUP=$(az group list --query "[?contains(name, 'cr${UNIQUE}')].name" -otsv)
ENV_VAULT=$(az keyvault list --resource-group $GROUP --query [].name -otsv)

# Translate Values File
cat > config_airflow.yaml << EOF
95
96
97
################################################################################
# Specify the azure environment specific values
#
98
99
appinsightstatsd:
  aadpodidbinding: "osdu-identity"
100
101
102
103
104
105
106
107
108

################################################################################
# Specify any optional override values
#
image:
  repository: $(az keyvault secret show --id https://${ENV_VAULT}.vault.azure.net/secrets/container-registry --query value -otsv).azurecr.io
  branch: $BRANCH
  tag: $TAG

109
110
airflowLogin:
  name: admin
harshit aggarwal's avatar
init    
harshit aggarwal committed
111
112
113
114
115
116
117
  
###############################################################################
# Specify configuration required for authentication of API calls to webserver
airflowAuthentication:
  username: admin
  keyvaultMountPath: /mnt/azure-keyvault/
  passwordKey: airflow-admin-password
118

119
120
121
122
123
124
################################################################################
# Specify any custom configs/environment values
#
customConfig:
  rbac:
    createUser: "True"
125

126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
################################################################################
# Specify pgbouncer configuration
#
pgbouncer:
  enabled: true
  port: 6543
  max_client_connections: 3000
  airflowdb:
    name: airflow
    host: $(az keyvault secret show --id https://${ENV_VAULT}.vault.azure.net/secrets/base-name-sr --query value -otsv)-pg.postgres.database.azure.com
    port: 5432
    pool_size: 100
    user:  osdu_admin@$(az keyvault secret show --id https://${ENV_VAULT}.vault.azure.net/secrets/base-name-sr --query value -otsv)-pg
    passwordSecret: "postgres"
    passwordSecretKey: "postgres-password"

142
143
144
################################################################################
# Specify the airflow configuration
#
145
airflow:
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

  ###################################
  # Kubernetes - Ingress Configs
  ###################################
  ingress:
    enabled: false                  #<-- Set this enabled to true for Admin UI
    web:
      annotations:
        kubernetes.io/ingress.class: azure/application-gateway
        appgw.ingress.kubernetes.io/request-timeout: "300"
        appgw.ingress.kubernetes.io/connection-draining: "true"
        appgw.ingress.kubernetes.io/connection-draining-timeout: "30"
        cert-manager.io/cluster-issuer: letsencrypt
        cert-manager.io/acme-challenge-type: http01
      path: "/airflow"
      host: $DNS_HOST
      livenessPath: "/airflow/health"
      tls:
        enabled: true
        secretName: osdu-certificate
      precedingPaths:
        - path: "/airflow/*"
          serviceName: airflow-web
          servicePort: 8080

  ###################################
  # Database - External Database
  ###################################
  postgresql:
    enabled: false
  externalDatabase:
    type: postgres
178
179
    ## Azure PostgreSQL Database host or pgbouncer host (if pgbouncer is enabled)
    host: airflow-pgbouncer.osdu.svc.cluster.local         
180
    ## Azure PostgreSQL Database username, formatted as {username}@{hostname}
181
    user: osdu_admin@$(az keyvault secret show --id https://${ENV_VAULT}.vault.azure.net/secrets/base-name-sr --query value -otsv)-pg
182
183
    passwordSecret: "postgres"
    passwordSecretKey: "postgres-password"
184
185
    port: 6543
    database: airflow
186
187
188
189
190
191
192
193
194
    database: airflow

  ###################################
  # Database - External Redis
  ###################################
  redis:
    enabled: false
  externalRedis:
    ## Azure Redis Cache host
195
    host: $(az keyvault secret show --id https://${ENV_VAULT}.vault.azure.net/secrets/base-name-sr --query value -otsv)-queue.redis.cache.windows.net
196
197
    port: 6380
    passwordSecret: "redis"
198
    passwordSecretKey: "redis-queue-password"
199
200
    databaseNumber: 1  #<-- Adding redis database number according to the Redis config map https://community.opengroup.org/osdu/platform/deployment-and-operations/infra-azure-provisioning/-/blob/master/charts/osdu-common/templates/redis-map.yaml#L7

201
202
203
204
205
206
207
208
209
210
211
212
213
214
215

  ###################################
  # Airflow - DAGs Configs
  ###################################
  dags:
    installRequirements: true
    persistence:
      enabled: true
      existingClaim: airflowdagpvc
      subPath: "dags"

  ###################################
  # Airflow - WebUI Configs
  ###################################
  web:
harshit aggarwal's avatar
init    
harshit aggarwal committed
216
217
218
219
220
221
222
223
224
    replicas: 1
    livenessProbe:
      timeoutSeconds: 60
    resources:
      requests:
        cpu: "2000m"
        memory: "2Gi"
      limits:
        cpu: "3000m"
harshit aggarwal's avatar
harshit aggarwal committed
225
        memory: "2Gi"
226
227
    podLabels:
      aadpodidbinding: "osdu-identity"
harshit aggarwal's avatar
init    
harshit aggarwal committed
228
229
    podAnnotations:
      sidecar.istio.io/userVolumeMount: '[{"name": "azure-keyvault", "mountPath": "/mnt/azure-keyvault", "readonly": true}]'
230
231
232
233
234
235
    baseUrl: "http://localhost/airflow"

  ###################################
  # Airflow - Worker Configs
  ###################################
  workers:
236
237
238
239
240
241
242
    resources:
      requests:
        cpu: "1200m"
        memory: "5Gi"
      limits:
        cpu: "1200m"
        memory: "5Gi"
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
    podLabels:
      aadpodidbinding: "osdu-identity"
    autoscaling:
      enabled: true
      ## minReplicas is picked from Values.workers.replicas and default value is 1
      maxReplicas: 3
      metrics:
      - type: Resource
        resource:
          name: memory
          target:
            type: Utilization
            averageUtilization: 50

  ###################################
  # Airflow - Flower Configs
  ###################################
  flower:
    enabled: false

  ###################################
  # Airflow - Scheduler Configs
  ###################################
  scheduler:
267
268
269
270
271
272
273
    resources:
      requests:
        cpu: "3000m"
        memory: "1Gi"
      limits:
        cpu: "3000m"
        memory: "1Gi"
274
275
276
277
278
279
280
281
    podLabels:
      aadpodidbinding: "osdu-identity"
    variables: |
      {}

  ###################################
  # Airflow - Common Configs
  ###################################
282
283
  airflow:
    image:
Kishore Battula's avatar
Kishore Battula committed
284
285
      repository: community.opengroup.org:5555/osdu/platform/deployment-and-operations/base-containers-azure/airflow-docker-image/master
      tag: v0.9
286
287
288
289
290
291
292
293
294
295
296
297
      pullPolicy: IfNotPresent
      pullSecret: ""
    config:
      AIRFLOW__SCHEDULER__STATSD_ON: "True"
      AIRFLOW__SCHEDULER__STATSD_HOST: "appinsights-statsd"
      AIRFLOW__SCHEDULER__STATSD_PORT: 8125
      AIRFLOW__SCHEDULER__STATSD_PREFIX: "osdu_airflow"
      AIRFLOW__CORE__DAGS_ARE_PAUSED_AT_CREATION: "False"
      ## Enable for Debug purpose
      AIRFLOW__WEBSERVER__EXPOSE_CONFIG: "False"
      AIRFLOW__WEBSERVER__AUTHENTICATE: "True"
      AIRFLOW__WEBSERVER__AUTH_BACKEND: "airflow.contrib.auth.backends.password_auth"
298
      AIRFLOW__WEBSERVER__RBAC: "True"
harshit aggarwal's avatar
init    
harshit aggarwal committed
299
      AIRFLOW__API__AUTH_BACKEND: "airflow.api.auth.backend.default"
300
301
302
303
      AIRFLOW__CORE__REMOTE_LOGGING: "True"
      AIRFLOW__CORE__REMOTE_LOG_CONN_ID: "az_log"
      AIRFLOW__CORE__REMOTE_BASE_LOG_FOLDER: "wasb-airflowlog"
      AIRFLOW__CORE__LOGGING_CONFIG_CLASS: "log_config.DEFAULT_LOGGING_CONFIG"
304
      AIRFLOW__CORE__LOG_FILENAME_TEMPLATE: "{{ run_id }}/{{ ti.dag_id }}/{{ ti.task_id }}/{{ ts }}/{% if 'correlation_id' in dag_run.conf %}{{ dag_run.conf['correlation_id'] }}{% else %}None{% endif %}/{{ try_number }}.log"
305
306
      AIRFLOW__CELERY__SSL_ACTIVE: "True"
      AIRFLOW__WEBSERVER__ENABLE_PROXY_FIX: "True"
307
      AIRFLOW__CORE__PLUGINS_FOLDER: "/opt/airflow/plugins"
308
      AIRFLOW__SCHEDULER__DAG_DIR_LIST_INTERVAL: 60
309
      AIRFLOW__CORE__LOGGING_LEVEL: DEBUG
310
311
      AIRFLOW_VAR_CORE__CONFIG__DATALOAD_CONFIG_PATH: "/opt/airflow/dags/configs/dataload.ini"
      AIRFLOW_VAR_CORE__SERVICE__SCHEMA__URL: "http://schema-service.osdu.svc.cluster.local/api/schema-service/v1/schema"
Kishore Battula's avatar
Kishore Battula committed
312
      AIRFLOW_VAR_CORE__SERVICE__SEARCH__URL: "http://search-service.osdu.svc.cluster.local/api/search/v2/query"
313
314
315
      AIRFLOW_VAR_CORE__SERVICE__STORAGE__URL: "http://storage.osdu.svc.cluster.local/api/storage/v2/records"
      AIRFLOW_VAR_CORE__SERVICE__FILE__HOST: "http://file.osdu.svc.cluster.local/api/file/v2"
      AIRFLOW_VAR_CORE__SERVICE__WORKFLOW__HOST: "http://ingestion-workflow.osdu.svc.cluster.local/api/workflow"
harshit aggarwal's avatar
init    
harshit aggarwal committed
316
317
318
319
320
      AIRFLOW__WEBSERVER__WORKERS: 15
      AIRFLOW__WEBSERVER__WORKER_REFRESH_BATCH_SIZE: 0
      AIRFLOW__CORE__STORE_SERIALIZED_DAGS: True #This flag decides whether to serialise DAGs and persist them in DB
      AIRFLOW__CORE__STORE_DAG_CODE: True #This flag decides whether to persist DAG files code in DB
      AIRFLOW__WEBSERVER__WORKER_CLASS: gevent    
321
      AIRFLOW_VAR_CORE__SERVICE__SEARCH_WITH_CURSOR__URL: "http://search-service.osdu.svc.cluster.local/api/search/v2/query_with_cursor"
322
323
324
325
326
327
328
329
330
331
332
    extraEnv:
      - name: AIRFLOW__CORE__FERNET_KEY
        valueFrom:
          secretKeyRef:
            name: airflow
            key: fernet-key
      - name: AIRFLOW_CONN_AZ_LOG
        valueFrom:
          secretKeyRef:
            name: airflow
            key: remote-log-connection
333
334
335
336
337
338
339
      - name: CLOUD_PROVIDER
        value: "azure"
      - name: KEYVAULT_URI
        valueFrom:
          configMapKeyRef:
            name: osdu-svc-properties
            key: ENV_KEYVAULT
Kishore Battula's avatar
Kishore Battula committed
340
341
342
      # Needed for installing python osdu python sdk. In future this will be changed
      - name: CI_COMMIT_TAG
        value: "v0.10.0"
343
344
345
346
347
348
    extraConfigmapMounts:
      - name: remote-log-config
        mountPath: /opt/airflow/config
        configMap: airflow-remote-log-config
        readOnly: true
    extraPipPackages: [
349
        "flask-bcrypt==0.7.1",
350
351
        "apache-airflow[statsd]",
        "apache-airflow[kubernetes]",
352
353
        "apache-airflow-backport-providers-microsoft-azure==2021.2.5",
        "dataclasses==0.8",
354
        "google-cloud-storage",
355
356
357
358
359
360
361
        "python-keycloak==0.24.0",
        "msal==1.9.0",
        "azure-identity==1.5.0",
        "azure-keyvault-secrets==4.2.0",
        "azure-storage-blob",
        "azure-servicebus==7.0.1",
        "toposort==1.6",
362
        "strict-rfc3339==0.7",
Kishore Battula's avatar
Kishore Battula committed
363
364
365
        "jsonschema==3.2.0",
        "pyyaml==5.4.1",
        "requests==2.25.1",
366
        "tenacity==8.0.1",
Kishore Battula's avatar
Kishore Battula committed
367
        "https://azglobalosdutestlake.blob.core.windows.net/pythonsdk/osdu_api-0.10.0.tar.gz"
368
369
370
371
372
    ]
    extraVolumeMounts:
      - name: azure-keyvault
        mountPath: "/mnt/azure-keyvault"
        readOnly: true
373
374
375
      - name: dags-data
        mountPath: /opt/airflow/plugins
        subPath: plugins
376
377
378
379
380
381
382
383
384
    extraVolumes:
      - name: azure-keyvault
        csi:
          driver: secrets-store.csi.k8s.io
          readOnly: true
          volumeAttributes:
            secretProviderClass: azure-keyvault
EOF
```
Daniel Scholl's avatar
Daniel Scholl committed
385
386
387
388

__Clone Service Repositories__

Manually ensure all the services have been cloned to your machine.
389
390

```bash
Daniel Scholl's avatar
Daniel Scholl committed
391
392
393
394
SRC_DIR="<ROOT_PATH_TO_SOURCE>" #  $HOME/source/osdu/osdu-gitlab

git clone https://community.opengroup.org/osdu/platform/system/partition.git $SRC_DIR/partition
git clone https://community.opengroup.org/osdu/platform/security-and-compliance/entitlements-azure.git $SRC_DIR/entitlements-azure
Rostislav_Vatolin's avatar
Rostislav_Vatolin committed
395
git clone https://community.opengroup.org/osdu/platform/security-and-compliance/entitlements.git $SRC_DIR/entitlements
Daniel Scholl's avatar
Daniel Scholl committed
396
397
398
399
400
git clone https://community.opengroup.org/osdu/platform/security-and-compliance/legal.git $SRC_DIR/legal
git clone https://community.opengroup.org/osdu/platform/system/storage.git $SRC_DIR/storage
git clone https://community.opengroup.org/osdu/platform/system/indexer-queue.git $SRC_DIR/indexer-queue
git clone https://community.opengroup.org/osdu/platform/system/indexer-service.git $SRC_DIR/indexer-service
git clone https://community.opengroup.org/osdu/platform/system/search-service.git $SRC_DIR/search-service
401
402
git clone https://community.opengroup.org/osdu/platform/system/file.git $SRC_DIR/file-service
git clone https://community.opengroup.org/osdu/platform/system/delivery.git $SRC_DIR/delivery
403
404
git clone https://community.opengroup.org/osdu/platform/system/reference/ unit-service.git $SRC_DIR/unit-service
git clone https://community.opengroup.org/osdu/platform/system/reference/crs-catalog-service.git $SRC_DIR/crs-catalog-service
Sumra Zafar's avatar
Sumra Zafar committed
405
git clone https://community.opengroup.org/osdu/platform/system/reference/crs-conversion-service.git $SRC_DIR/crs-conversion-service
Komal Makkar's avatar
Komal Makkar committed
406
git clone https://community.opengroup.org/osdu/platform/system/notification.git $SRC_DIR/notification
harshit aggarwal's avatar
harshit aggarwal committed
407
408
git clone https://community.opengroup.org/osdu/platform/data-flow/enrichment/wks.git $SRC_DIR/wks
git clone https://community.opengroup.org/osdu/platform/system/register.git $SRC_DIR/register
harshit aggarwal's avatar
harshit aggarwal committed
409
git clone https://community.opengroup.org/osdu/platform/system/schema-service.git $SRC_DIR/schema-service
410
git clonehttps://community.opengroup.org/osdu/platform/data-flow/ingestion/ingestion-workflow.git $SRC_DIR/ingestion-workflow
411
git clone https://community.opengroup.org/osdu/platform/domain-data-mgmt-services/seismic/seismic-dms-suite/seismic-store-service.git $SRC_DIR/seismic-store-service
412
git clone https://community.opengroup.org:osdu/platform/domain-data-mgmt-services/wellbore/wellbore-domain-services.git $SRC_DIR/wellbore-domain-services
Sumra Zafar's avatar
Sumra Zafar committed
413
git clone https://community.opengroup.org/osdu/platform/data-flow/ingestion/ingestion-service.git $SRC_DIR/ingestion-service
414
git clone https://community.opengroup.org/osdu/platform/security-and-compliance/policy.git $SRC_DIR/policy
415
416
```

Sumra Zafar's avatar
Sumra Zafar committed
417
__Additional Manual Steps__
418
Following services require additional steps for manual setup.
Sumra Zafar's avatar
Sumra Zafar committed
419
- [CRS Catalog Service](https://community.opengroup.org/osdu/platform/deployment-and-operations/infra-azure-provisioning/-/issues/56)
420
421
- [CRS Conversion Serice](https://community.opengroup.org/osdu/platform/deployment-and-operations/infra-azure-provisioning/-/issues/65)
- [Unit Service](https://community.opengroup.org/osdu/platform/deployment-and-operations/infra-azure-provisioning/-/issues/55)
422
423
- [Wellbore DMS](https://community.opengroup.org/osdu/platform/deployment-and-operations/infra-azure-provisioning/-/issues/36)

424

Daniel Scholl's avatar
Daniel Scholl committed
425
426
427
428
__Kubernetes API Access__

> Optional

Daniel Scholl's avatar
Daniel Scholl committed
429
It can often be helpful to be able to retrieve the cluster context and execute queries directly against the Kubernetes API.
Daniel Scholl's avatar
Daniel Scholl committed
430
431

```bash
Jason's avatar
Jason committed
432
BASE_NAME=$(az group list --query "[?contains(name, 'sr${UNIQUE}')].name" -otsv |grep -v MC | rev | cut -c 3- | rev)
Daniel Scholl's avatar
Daniel Scholl committed
433
434
435
436
437

az aks get-credentials -n ${BASE_NAME}aks -g ${BASE_NAME}rg
```


Daniel Scholl's avatar
Daniel Scholl committed
438
439
440
__Helm Manifests__

Manually extract the manifests from the helm charts to your Flux Repo Directory.
441
442

```bash
Daniel Scholl's avatar
Daniel Scholl committed
443
444
INFRA_SRC="$SRC_DIR/infra-azure-provisioning"
FLUX_SRC="$INFRA_SRC/k8-gitops-manifests"
445
446
447
BRANCH="master"
TAG="latest"

Daniel Scholl's avatar
Daniel Scholl committed
448
449
450
# Setup the Flux Directory
mkdir -p ${FLUX_SRC}/providers/azure/hld-registry

451
452
453
# Extract manifests from the common osdu chart.
helm template osdu-flux ${INFRA_SRC}/charts/osdu-common -f ${INFRA_SRC}/charts/config.yaml > ${FLUX_SRC}/providers/azure/hld-registry/osdu-common.yaml

Daniel Scholl's avatar
Daniel Scholl committed
454
455
456
457
458
459
460
# Commit and Checkin to Deploy
(cd $FLUX_SRC \
  && git switch -c $UNIQUE \
  && git add ${FLUX_SRC}/providers/azure/hld-registry/osdu-common.yaml \
  && git commit -m "Initialize Common Chart" \
  && git push origin $UNIQUE)

Daniel Scholl's avatar
Daniel Scholl committed
461
# Extract manifests from the istio charts.
462
463
464
465
helm template osdu-flux ${INFRA_SRC}/charts/osdu-istio -f ${INFRA_SRC}/charts/config.yaml > ${FLUX_SRC}/providers/azure/hld-registry/osdu-istio.yaml

helm template osdu-flux ${INFRA_SRC}/charts/osdu-istio-auth -f ${INFRA_SRC}/charts/config.yaml > ${FLUX_SRC}/providers/azure/hld-registry/osdu-istio-auth.yaml

Daniel Scholl's avatar
Daniel Scholl committed
466
467
468
# Commit and Checkin to Deploy
(cd $FLUX_SRC \
  && git switch $UNIQUE \
Daniel Scholl's avatar
Daniel Scholl committed
469
  && git add ${FLUX_SRC}/providers/azure/hld-registry/osdu-istio.yaml \
Daniel Scholl's avatar
Daniel Scholl committed
470
471
472
473
  && git add ${FLUX_SRC}/providers/azure/hld-registry/osdu-istio-auth.yaml \
  && git commit -m "Initialize Istio Auth Chart" \
  && git push origin $UNIQUE)

474
475
476
# Publish Docker Images for airflow components
CONTAINER_REGISTRY=$(az keyvault secret show --id https://${ENV_VAULT}.vault.azure.net/secrets/container-registry --query value -otsv)
az acr login -n $CONTAINER_REGISTRY
477
for SERVICE in airflow-function airflow-statsd;
478
479
480
481
482
483
484
485
do
  cd ${INFRA_SRC}/source/$SERVICE
  IMAGE=$CONTAINER_REGISTRY.azurecr.io/$SERVICE-$BRANCH:$(TAG)
  docker build -t $IMAGE .
  docker push $IMAGE
done

# Installing PyYaml required for airflow
486
pip3 install -U PyYAML
487

488
489
490
491
492
493
494
495
496
497
# Extract manifests from the airflow charts.
helm template airflow ${INFRA_SRC}/charts/airflow -f ${INFRA_SRC}/charts/config_airflow.yaml | python3 ${INFRA_SRC}/charts/airflow/scripts/add-namespace.py > ${FLUX_SRC}/providers/azure/hld-registry/airflow.yaml

# Commit and Checkin to Deploy
(cd $FLUX_SRC \
  && git switch $UNIQUE \
  && git add ${FLUX_SRC}/providers/azure/hld-registry/airflow.yaml \
  && git commit -m "Initialize Airflow Chart" \
  && git push origin $UNIQUE)

Daniel Scholl's avatar
Daniel Scholl committed
498
# Extract manifests from each service chart.
499
500
501
SERVICE_LIST="infra-azure-provisioning \
              partition \
              entitlements-azure \
Rostislav_Vatolin's avatar
Rostislav_Vatolin committed
502
              entitlements \
503
504
505
506
507
508
              legal \
              storage \
              indexer-queue \
              indexer-service \
              search-service \
              delivery \
Jason's avatar
Jason committed
509
              file-service \
510
511
              unit-service \
              crs-conversion-service \
Komal Makkar's avatar
Komal Makkar committed
512
              crs-catalog-service \
harshit aggarwal's avatar
harshit aggarwal committed
513
              wks \
Komal Makkar's avatar
Komal Makkar committed
514
              register \
harshit aggarwal's avatar
harshit aggarwal committed
515
              notification \
Jason's avatar
Jason committed
516
              schema-service \
Sumra Zafar's avatar
Sumra Zafar committed
517
518
              ingestion-workflow \
              ingestion-service"
519

Jason's avatar
Jason committed
520
for SERVICE in $SERVICE_LIST;
Daniel Scholl's avatar
Daniel Scholl committed
521
522
523
524
do
  helm template $SERVICE ${SRC_DIR}/$SERVICE/devops/azure/chart --set image.branch=$BRANCH --set image.tag=$TAG > ${FLUX_SRC}/providers/azure/hld-registry/$SERVICE.yaml
done

525
526
527
528
529
530
531
532
533
534
535
536
537

SERVICE=wellbore-domain-services
helm template $SERVICE ${SRC_DIR}/$SERVICE/devops/azure/chart \
  --set image.repository=${CONTAINER_REGISTRY_NAME}.azurecr.io/${SERVICE}-${BRANCH} \
  --set image.tag=$TAG \
  --set annotations.buildNumber=undefined \
  --set annotations.buildOrigin=manual \
  --set annotations.commitBranch=undefined \
  --set annotations.commitId=undefined \
  --set labels.env=dev \
  > ${FLUX_SRC}/providers/azure/hld-registry/$SERVICE.yaml


Daniel Scholl's avatar
Daniel Scholl committed
538
539
540
541
542
543
# Commit and Checkin to Deploy
(cd $FLUX_SRC \
  && git switch $UNIQUE \
  && git add ${FLUX_SRC}/providers/azure/hld-registry/*.yaml \
  && git commit -m "Adding OSDU Services" \
  && git push origin $UNIQUE)
544
```