Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update pipelines #25

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions 9.0.x/pipeline-run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@ spec:
- name: use-letsencrypt-certs
value: "true"
#lets encrypt secret location and namespace
# - name: tlscert-secret
# value: "user-serving-cert-000"
# - name: tlscert-namespace
# value: "openshift-kube-apiserver"
- name: tlscert-secret
value: "user-serving-cert-000"
value: "letsencrypt-certs"
- name: tlscert-namespace
value: "openshift-kube-apiserver"
value: "openshift-ingress"
- name: ibm-entitlement-key
value: "false"
#mas-license-secret
Expand All @@ -35,10 +39,12 @@ spec:
# install MAS Core. This task may be skipped once done successfully
- name: mas-install-core
value: "true"
- name: mas-instance-id
value: "inst1"

# install MAS Manage, depending on MAS Core, optionally CP4D/DB2
- name: mas-install-manage
value: "false"
value: "true"
- name: mas-install-demo-data
value: "true"
- name: mas-cp4d-install-cognos
Expand Down Expand Up @@ -72,7 +78,7 @@ spec:
- name: cpd-admin-password
value: "xxx"

# install MAS AI Broker, depending on MAS Core, Manage, IoT and Monitor
# install MAS AI Broker, depending on MAS Core. Check/update sc in pvc.yml, ns in np.yml
- name: mas-install-aibroker
value: "false"
- name: artifactory_username
Expand Down
56 changes: 34 additions & 22 deletions 9.0.x/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ spec:
- name: ibm-entitlement-key
steps:
- name: copy-entitlement-key-to-ws
image: quay.io/openshift/origin-cli:4.10
image: quay.io/openshift/origin-cli:4.15
script: |
#!/usr/bin/env bash
if [ $(params.ibm-entitlement-key) == "false" ]; then
Expand Down Expand Up @@ -227,7 +227,7 @@ spec:
- name: LICENSE_FILE_SECRET_NAME
steps:
- name: write-maximo-licensefile
image: quay.io/openshift/origin-cli:4.12
image: quay.io/openshift/origin-cli:4.15
script: |
#!/usr/bin/env bash

Expand Down Expand Up @@ -355,7 +355,7 @@ spec:
- name: mas-install-core
steps:
- name: run-mas-cli
image: quay.io/ibmmas/cli:latest
image: quay.io/ibmmas/cli:11.12.0
script: |
#!/usr/bin/env bash
# extract license id from license.dat
Expand Down Expand Up @@ -387,7 +387,7 @@ spec:

#check ai broker public cert
#cat ansible-devops/roles/suite_certs/defaults/main.yml
wget -qO - "https://raw.githubusercontent.com/zxue/ansible-devops/master/ibm/mas_devops/roles/suite_certs/defaults/main.yml" > ansible-devops/roles/suite_certs/defaults/main.yml
#wget -qO - "https://raw.githubusercontent.com/zxue/ansible-devops/master/ibm/mas_devops/roles/suite_certs/defaults/main.yml" > ansible-devops/roles/suite_certs/defaults/main.yml
#cat ansible-devops/roles/suite_certs/defaults/main.yml

ansible-playbook ibm.mas_devops.oneclick_core
Expand All @@ -401,6 +401,7 @@ spec:
timeout: "12h"
runAfter:
- get-tls-certs
- install-mas-core
workspaces:
- name: ws
params:
Expand Down Expand Up @@ -434,7 +435,7 @@ spec:
- name: rwo-storageclass
steps:
- name: run-mas-cli
image: quay.io/ibmmas/cli:latest
image: quay.io/ibmmas/cli:11.12.0
script: |
#!/usr/bin/env bash
export MAS_INSTANCE_ID=$(params.mas-instance-id)
Expand Down Expand Up @@ -479,7 +480,8 @@ spec:
mkdir -p $MAS_CONFIG_DIR

# Cloud Pak for Data Platform (~1 1/2 hours)
ROLE_NAME=ibm_catalogs ansible-playbook ibm.mas_devops.run_role
#ROLE_NAME=ibm_catalogs ansible-playbook ibm.mas_devops.run_role
#ROLE_NAME=cert_manager ansible-playbook ibm.mas_devops.run_role
ROLE_NAME=cp4d ansible-playbook ibm.mas_devops.run_role
- name: install-cp4d-db2
when:
Expand Down Expand Up @@ -523,7 +525,7 @@ spec:
- name: rwo-storageclass
steps:
- name: run-mas-cli
image: quay.io/ibmmas/cli:latest
image: quay.io/ibmmas/cli:11.12.0
script: |
#!/usr/bin/env bash
export MAS_INSTANCE_ID=$(params.mas-instance-id)
Expand Down Expand Up @@ -606,7 +608,7 @@ spec:
- name: cpd-install-spss
steps:
- name: run-mas-cli
image: quay.io/ibmmas/cli:latest
image: quay.io/ibmmas/cli:11.12.0
script: |
#!/usr/bin/env bash

Expand Down Expand Up @@ -670,7 +672,7 @@ spec:
- name: cpd-install-spss
steps:
- name: run-mas-cli
image: quay.io/ibmmas/cli:latest
image: quay.io/ibmmas/cli:11.12.0
script: |
#!/usr/bin/env bash

Expand Down Expand Up @@ -737,7 +739,7 @@ spec:
- name: cpd-install-spss
steps:
- name: run-mas-cli
image: quay.io/ibmmas/cli:latest
image: quay.io/ibmmas/cli:11.12.0
script: |
#!/usr/bin/env bash

Expand Down Expand Up @@ -802,7 +804,7 @@ spec:
- name: cpd-install-spss
steps:
- name: run-mas-cli
image: quay.io/ibmmas/cli:latest
image: quay.io/ibmmas/cli:11.12.0
script: |
#!/usr/bin/env bash

Expand Down Expand Up @@ -870,7 +872,7 @@ spec:
- name: cpd-install-spss
steps:
- name: run-mas-cli
image: quay.io/ibmmas/cli:latest
image: quay.io/ibmmas/cli:11.12.0
script: |
#!/usr/bin/env bash

Expand Down Expand Up @@ -943,7 +945,7 @@ spec:
- name: rwo-storageclass
steps:
- name: run-mas-cli
image: quay.io/ibmmas/cli:latest
image: quay.io/ibmmas/cli:11.12.0
script: |
#!/usr/bin/env bash
export MAS_INSTANCE_ID=$(params.mas-instance-id)
Expand Down Expand Up @@ -1044,7 +1046,7 @@ spec:
- name: uds-lastname
steps:
- name: run-mas-cli
image: quay.io/ibmmas/cli:latest
image: quay.io/ibmmas/cli:11.12.0
script: |
#!/usr/bin/env bash
export MAS_INSTANCE_ID=$(params.mas-instance-id)
Expand Down Expand Up @@ -1100,7 +1102,7 @@ spec:
- name: rwo-storageclass
steps:
- name: run-mas-cli
image: quay.io/ibmmas/cli:latest
image: quay.io/ibmmas/cli:11.12.0
script: |
#!/usr/bin/env bash
export MAS_INSTANCE_ID=$(params.mas-instance-id)
Expand Down Expand Up @@ -1146,7 +1148,7 @@ spec:
- name: mas-channel
steps:
- name: run-mas-cli
image: quay.io/ibmmas/cli:latest
image: quay.io/ibmmas/cli:11.12.0
script: |
#!/usr/bin/env bash
export MAS_INSTANCE_ID=$(params.mas-instance-id)
Expand Down Expand Up @@ -1220,7 +1222,7 @@ spec:
- name: cpd-admin-password
steps:
- name: run-mas-cli
image: quay.io/ibmmas/cli:latest
image: quay.io/ibmmas/cli:11.12.0
script: |
#!/usr/bin/env bash

Expand Down Expand Up @@ -1285,6 +1287,8 @@ spec:
value: "$(params.artifactory_username)"
- name: artifactory_token
value: "$(params.artifactory_token)"
- name: rwo-storageclass
value: "$(params.rwo-storageclass)"
- name: mas_airbroker_watsonxai_apikey
value: "$(params.mas_airbroker_watsonxai_apikey)"
- name: mas_airbroker_watsonxai_url
Expand All @@ -1305,14 +1309,15 @@ spec:
- name: uds-email
- name: artifactory_username
- name: artifactory_token
- name: rwo-storageclass
- name: mas_airbroker_watsonxai_apikey
- name: mas_airbroker_watsonxai_url
- name: mas_airbroker_watsonxai_project_id
- name: mas_aibroker_channel

steps:
- name: run-mas-cli
image: quay.io/ibmmas/cli:latest
image: quay.io/ibmmas/cli:11.12.0
script: |
#!/usr/bin/env bash

Expand All @@ -1323,8 +1328,10 @@ spec:
# Update namespace "mas-inst1-aibroker" in maridb-np.yml

# download files form github repo or other location
export MINIO_FOLDER="https://raw.githubusercontent.com/zxue/deploy-maximo-aibroker/main/minio/"
export MARIADB_FOLDER="https://raw.githubusercontent.com/zxue/deploy-maximo-aibroker/main/mariadb/"
#export MINIO_FOLDER="https://raw.githubusercontent.com/zxue/deploy-maximo-aibroker/main/minio/"
#export MARIADB_FOLDER="https://raw.githubusercontent.com/zxue/deploy-maximo-aibroker/main/mariadb/"
export MINIO_FOLDER="https://raw.githubusercontent.com/cloud-native-toolkit/deployer-mas-cli/main/minio/"
export MARIADB_FOLDER="https://raw.githubusercontent.com/cloud-native-toolkit/deployer-mas-cli/main/mariadb/"

wget -qO - "$MINIO_FOLDER"kustomization.yaml > $(workspaces.ws.path)/masconfig/minio/kustomization.yaml
wget -qO - "$MINIO_FOLDER"minio.yaml > $(workspaces.ws.path)/masconfig/minio/minio.yaml
Expand All @@ -1339,6 +1346,10 @@ spec:
wget -qO - "$MARIADB_FOLDER"mariadb-secret.yml > $(workspaces.ws.path)/masconfig/mariadb/mariadb-secret.yml
wget -qO - "$MARIADB_FOLDER"mariadb-service.yml > $(workspaces.ws.path)/masconfig/mariadb/mariadb-service.yml

# config env variables to mariadb yml files
export MAS_INSTANCE_ID=$(params.mas-instance-id)
export MAS_AIBROKER_STORAGE_CLASS=$(params.rwo-storageclass)

# run oc command lines to create minio storage and mariadb
cd $(workspaces.ws.path)/masconfig
chmod 777 $(workspaces.ws.path)/masconfig/mariadb/mariadb-deploy.sh
Expand All @@ -1352,7 +1363,7 @@ spec:
export MAS_ICR_CPOPEN="docker-na-public.artifactory.swg-devops.com/wiotp-docker-local/cpopen"

#MAS
export MAS_INSTANCE_ID=$(params.mas-instance-id)
#export MAS_INSTANCE_ID=$(params.mas-instance-id)
export MAS_ENTITLEMENT_USERNAME=$(params.uds-email)
export MAS_ENTITLEMENT_KEY=$(cat $(workspaces.ws.path)/ek.dat)

Expand All @@ -1374,7 +1385,8 @@ spec:
export MAS_AIBROKER_WATSONXAI_PROJECT_ID=$(params.mas_airbroker_watsonxai_project_id)
export MAS_AIBROKER_CHANNEL=$(params.mas_aibroker_channel)

# database
# mariadb database
#export MAS_AIBROKER_STORAGE_CLASS=$(params.rwo-storageclass)
export MAS_AIBROKER_DB_HOST="mariadb-instance.mariadb.svc.cluster.local"
export MAS_AIBROKER_DB_PORT="3306"
export MAS_AIBROKER_DB_USER="mariadb"
Expand Down
9 changes: 9 additions & 0 deletions mariadb/mariadb-deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

oc apply -f mariadb/mariadb-ns.yml
oc process -f mariadb/mariadb-pvc.yml -p=MAS_AIBROKER_STORAGE_CLASS=$MAS_AIBROKER_STORAGE_CLASS | oc apply -f -
oc apply -f mariadb/mariadb-sa.yml
oc process -f mariadb/mariadb-np.yml -p=MAS_INSTANCE_ID=$MAS_INSTANCE_ID | oc apply -f -
oc apply -f mariadb/mariadb-secret.yml
oc apply -f mariadb/mariadb-deployment.yml
oc apply -f mariadb/mariadb-service.yml
80 changes: 80 additions & 0 deletions mariadb/mariadb-deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mariadb-instance
namespace: mariadb
labels:
app: mariadb-instance
component: data-science-pipelines
dspa: instance
spec:
strategy:
type: Recreate
selector:
matchLabels:
app: mariadb-instance
component: data-science-pipelines
dspa: instance
template:
metadata:
labels:
app: mariadb-instance
component: data-science-pipelines
dspa: instance
spec:
serviceAccountName: ds-pipelines-mariadb-sa-instance
containers:
- name: mariadb
image: registry.redhat.io/rhel8/mariadb-103:1-188
ports:
- containerPort: 3306
readinessProbe:
exec:
command:
- /bin/sh
- "-i"
- "-c"
- >-
MYSQL_PWD=$MYSQL_PASSWORD mysql -h 127.0.0.1 -u $MYSQL_USER -D
$MYSQL_DATABASE -e 'SELECT 1'
failureThreshold: 3
initialDelaySeconds: 5
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
livenessProbe:
failureThreshold: 3
initialDelaySeconds: 30
periodSeconds: 10
successThreshold: 1
tcpSocket:
port: 3306
timeoutSeconds: 1
env:
- name: MYSQL_USER
value: "mariadb"
- name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
key: password
name: "ds-pipeline-db-instance"
- name: MYSQL_DATABASE
value: "kmpipeline"
- name: MYSQL_ALLOW_EMPTY_PASSWORD
value: "true"
resources:
requests:
cpu: 300m
memory: 800Mi
limits:
cpu: "1"
memory: 1Gi
volumeMounts:
- name: mariadb-persistent-storage
mountPath: /var/lib/mysql
volumes:
- name: mariadb-persistent-storage
persistentVolumeClaim:
claimName: mariadb-pvc
# emptyDir: {}
Loading