Skip to content

Commit

Permalink
Merge pull request #376 from PrivateCloud-analytics/ms-olm-utils-azure
Browse files Browse the repository at this point in the history
ARO: Support for 4.5.0 version and OLM Utils Integration
  • Loading branch information
maulik-shah999 authored and GitHub Enterprise committed Aug 11, 2022
2 parents 1e060e4 + e06da7e commit 1f9da7d
Show file tree
Hide file tree
Showing 29 changed files with 2,182 additions and 1,355 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

.DS_Store
managed-openshift/azure/arm/azuredeploy.parameters.json
4 changes: 2 additions & 2 deletions managed-openshift/azure/arm/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Cloud Pak for Data 4.0 on Azure Red Hat OpenShift (ARO)
# Cloud Pak for Data 4.5 on Azure Red Hat OpenShift (ARO)

Cloud Pak for Data is an end to end platform that helps organizations in their journey to AI. It enables data engineers, data stewards, data scientists, and business analysts to collaborate using an integrated multiple-cloud platform.
Cloud Pak for Data uses IBM’s deep analytics portfolio to help organizations meet data and analytics challenges. The required building blocks (collect, organize, analyze, infuse) for information architecture are available using Cloud Pak for Data on Azure.
Expand All @@ -13,7 +13,7 @@ This reference deployment provides ARM templates to deploy Azure ARO Cluster wit
- A highly available storage infrastructure with OpenShift Container Storage.
- Scalable OpenShift compute nodes running Cloud Pak for Data services. See [Services](#cloud-pak-for-data-services) for the services that are enabled in this deployment.

Note: ARO at this time provisions OpenShift Container Platform v4.8.x. This may be changed when new versions are released. See support lifecycle [here](https://docs.microsoft.com/en-us/azure/openshift/support-lifecycle)
Note: ARO at this time provisions OpenShift Container Platform v4.10.x. This may be changed when new versions are released. See support lifecycle [here](https://docs.microsoft.com/en-us/azure/openshift/support-lifecycle)

## Cost and licenses
Cloud Pak for Data offers a try and buy experience.
Expand Down
411 changes: 292 additions & 119 deletions managed-openshift/azure/arm/aro/azuredeploy.json

Large diffs are not rendered by default.

14 changes: 1 addition & 13 deletions managed-openshift/azure/arm/aro/nested/cloudpakdeploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,6 @@
"description": "Admin Username"
}
},
"ocuser": {
"type": "string",
"metadata": {
"description": "OpenShift Username"
}
},
"ocpassword": {
"type": "securestring",
"metadata": {
"description": "OpenShift Password"
}
},
"storageOption": {
"type": "string",
"metadata": {
Expand Down Expand Up @@ -123,7 +111,7 @@
"type": "Microsoft.Compute/virtualMachines/extensions",
"name": "[concat(parameters('bastionHostname'), '/deployOpenshift')]",
"location": "[parameters('location')]",
"apiVersion": "2019-07-01",
"apiVersion": "2021-11-01",
"tags": {
"displayName": "DeployCloudPak",
"app": "[parameters('redHatTags').app]",
Expand Down
4 changes: 2 additions & 2 deletions managed-openshift/azure/arm/aro/nested/clusternode.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"type": "Microsoft.Compute/virtualMachines",
"name": "[parameters('hostname')]",
"location": "[parameters('location')]",
"apiVersion": "2019-07-01",
"apiVersion": "2021-11-01",
"tags": {
"Role": "[parameters('role')]",
"app": "[parameters('redHatTags').app]",
Expand Down Expand Up @@ -141,7 +141,7 @@
"diagnosticsProfile": {
"bootDiagnostics": {
"enabled": true,
"storageUri": "[reference(resourceId('Microsoft.Storage/storageAccounts', parameters('diagStorageAccount')), '2019-06-01').primaryEndpoints['blob']]"
"storageUri": "[reference(resourceId('Microsoft.Storage/storageAccounts', parameters('diagStorageAccount')), '2021-08-01').primaryEndpoints['blob']]"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions managed-openshift/azure/arm/aro/nested/ocs.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
}
},
"openshiftPassword": {
"type": "string",
"type": "securestring",
"metadata": {
"description": "Openshift Password"
}
Expand Down Expand Up @@ -101,7 +101,7 @@
"type": "Microsoft.Compute/virtualMachines/extensions",
"name": "[concat(parameters('bastionHostname'), '/deployOpenshift')]",
"location": "[parameters('location')]",
"apiVersion": "2019-07-01",
"apiVersion": "2021-11-01",
"tags": {
"displayName": "InstallOCS",
"app": "[parameters('redHatTags').app]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"resources": [
{
"type": "Microsoft.DomainRegistration/domains",
"apiVersion": "2019-08-01",
"apiVersion": "2021-03-01",
"dependsOn": [
"[resourceId('Microsoft.Network/dnszones', parameters('dnsZoneName'))]"
],
Expand Down
98 changes: 98 additions & 0 deletions managed-openshift/azure/arm/aro/scripts/CloudPakConfig.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
#!/bin/sh

set -x

export LOCATION=$1
export DOMAINNAME=$2
export SUDOUSER=$3
export WORKERNODECOUNT=$4
export CPDNAMESPACE=$5
export STORAGEOPTION=$6
export APIKEY=$7
export OPENSHIFTUSER=$8
export OPENSHIFTPASSWORD=$9
export CUSTOMDOMAIN=${10}
export CLUSTERNAME=${11}
export CHANNEL=${12}
export VERSION=${13}

export OPERATORNAMESPACE=ibm-common-services
export INSTALLERHOME=/home/$SUDOUSER/.ibm
export OCPTEMPLATES=/home/$SUDOUSER/.openshift/templates
export CPDTEMPLATES=/mnt/.cpd/templates

runuser -l $SUDOUSER -c "mkdir -p $INSTALLERHOME"
runuser -l $SUDOUSER -c "mkdir -p $OCPTEMPLATES"
runuser -l $SUDOUSER -c "sudo mkdir -p $CPDTEMPLATES"

#CPD Config

# runuser -l $SUDOUSER -c "wget https://github.com/IBM/cloud-pak-cli/releases/download/v3.8.0/cloudctl-linux-amd64.tar.gz -O $CPDTEMPLATES/cloudctl-linux-amd64.tar.gz"
# runuser -l $SUDOUSER -c "https://github.com/IBM/cloud-pak-cli/releases/download/v3.8.0/cloudctl-linux-amd64.tar.gz.sig -O $CPDTEMPLATES/cloudctl-linux-amd64.tar.gz.sig"
# runuser -l $SUDOUSER -c "cd $CPDTEMPLATES && sudo tar -xvf cloudctl-linux-amd64.tar.gz -C /usr/bin"
# runuser -l $SUDOUSER -c "chmod +x /usr/bin/cloudctl-linux-amd64"
# runuser -l $SUDOUSER -c "sudo mv /usr/bin/cloudctl-linux-amd64 /usr/bin/cloudctl"

### Install Prereqs: CPD CLI, JQ, and Podman
## Download & Install CPD CLI
runuser -l $SUDOUSER -c "sudo wget https://github.com/IBM/cpd-cli/releases/download/v11.0.0/cpd-cli-linux-EE-11.0.0.tgz -O $CPDTEMPLATES/cpd-cli-linux-EE-11.0.0.tgz"
runuser -l $SUDOUSER -c "cd $CPDTEMPLATES && sudo tar -xvf cpd-cli-linux-EE-11.0.0.tgz"
# Move cpd-cli, plugins and license in the CPDTEMPLATES folder
runuser -l $SUDOUSER -c "sudo mv $CPDTEMPLATES/cpd-cli-linux-EE-11.0.0-20/* $CPDTEMPLATES"
runuser -l $SUDOUSER -c "sudo rm -rf $CPDTEMPLATES/cpd-cli-linux-EE-11.0.0*"

# Service Account Token for CPD installation
runuser -l $SUDOUSER -c "oc new-project $CPDNAMESPACE"

# Service Account Token for CPD installation
runuser -l $SUDOUSER -c "oc new-project $OPERATORNAMESPACE"

## Installing jq
runuser -l $SUDOUSER -c "sudo wget https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 -O $CPDTEMPLATES/jq"
runuser -l $SUDOUSER -c "sudo mv $CPDTEMPLATES/jq /usr/bin"
runuser -l $SUDOUSER -c "sudo chmod +x /usr/bin/jq"

## Installing Podman
runuser -l $SUDOUSER -c "sudo yum install podman -y"

# Set url
if [[ $CUSTOMDOMAIN == "true" || $CUSTOMDOMAIN == "True" ]];then
export SUBURL="${CLUSTERNAME}.${DOMAINNAME}"
else
export SUBURL="${DOMAINNAME}.${LOCATION}.aroapp.io"
fi

#Login
var=1
while [ $var -ne 0 ]; do
echo "Attempting to login $OPENSHIFTUSER to https://api.${SUBURL}:6443"
oc login "https://api.${SUBURL}:6443" -u $OPENSHIFTUSER -p $OPENSHIFTPASSWORD --insecure-skip-tls-verify=true
var=$?
echo "exit code: $var"
done

# CPD CLI OCP Login
runuser -l $SUDOUSER -c "sudo $CPDTEMPLATES/cpd-cli manage login-to-ocp --server \"https://api.${SUBURL}:6443\" -u $OPENSHIFTUSER -p $OPENSHIFTPASSWORD"

# Update global pull secret

export ENTITLEMENT_USER=cp
export ENTITLEMENT_KEY=$APIKEY
pull_secret=$(echo -n "$ENTITLEMENT_USER:$ENTITLEMENT_KEY" | base64 -w0)
oc get secret/pull-secret -n openshift-config -o jsonpath='{.data.\.dockerconfigjson}' | base64 -d > $OCPTEMPLATES/dockerconfig.json
sed -i -e 's|:{|:{"cp.icr.io":{"auth":"'$pull_secret'"\},|' $OCPTEMPLATES/dockerconfig.json
oc set data secret/pull-secret -n openshift-config --from-file=.dockerconfigjson=$OCPTEMPLATES/dockerconfig.json

# Check nodestatus if they are ready.

while true; do
node_status=$(oc get nodes | grep -E "SchedulingDisabled|NotReady")
if [[ -z $node_status ]]; then
echo -e "\n******All nodes are running now.******"
break
fi
echo -e "\n******Waiting for nodes to get ready.******"
oc get nodes --no-headers | awk '{print $1 " " $2}'
echo -e "\n******sleeping for 60Secs******"
sleep 60
done
Loading

0 comments on commit 1f9da7d

Please sign in to comment.