Skip to content

Commit

Permalink
Added codes
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr. Jeffrey Chijioke-Uche committed Jul 25, 2024
0 parents commit 884f14e
Show file tree
Hide file tree
Showing 41 changed files with 1,134 additions and 0 deletions.
Binary file added .img/k1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .img/k13.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .img/k14.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .img/k16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .img/k17.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .img/k18.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .img/k2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .img/k3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .img/k4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .img/k5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .img/k6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .img/k7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 53 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# IBM Watsonx Discovery - Kibana Installation Toolkit
<img src=".img/k6.png" alt="Openshift Kibana Running - Runs" width="200" height="80"> <img src=".img/k14.png" alt="Openshift Kibana Running - Runs" width="200" height="80"> <img src=".img/k17.jpg" alt="Openshift Kibana Running - Runs" width="180" height="80"> <img src=".img/k18.png" alt="Openshift Kibana Running - Runs" width="100" height="80">

## Purpose
This tool provides algorithms and configuration files for the installation & deployment of [IBM Watsonx Discovery](https://cloud.ibm.com/databases/databases-for-elasticsearch/create) local Kibana on your machine and on the Redhat OpenShift Container Platform. It also supports Kibana deployment on custom OpenShift flavor. IBM Watsonx Discovery is an Index Engine for Watsonx solutions. Click here -> [Kibana Local Setup](/local) for local install & Click here -> [Kibana OpenShift Deployment](/openshift) for OpenShift deployment.

## Kibana Configuration

The table 1.0.0 below provides the configuration variables required for the deployment of Kibana locallt and on OpenShift. Each variable has specific requirements as outlined below. So, before you start, head back to Watsonx Discovery UI to get all the required information in Table 1.0.0.

Table 1.0.0: OpenShift Configmap and .Env Requirements
| Variable Name | Requirements |
|-----------------------------------|--------------------------------------------------------------------------------------|
| ELASTICSEARCH_ENDPOINT | <required - provide value as https://USERNAME:PASSWORD@HOST_without_https://> |
| ELASTICSEARCH_USERNAME | <required - provide value> |
| ELASTICSEARCH_PASSWORD | <required - provide value> |
| ELASTICSEARCH_HOST | <required - provide value without https://> |
| ELASTICSEARCH_PORT | <required - provide value> |
| ELASTICSEARCH_TLS_NAME | <required - provide value> |
| ELASTICSEARCH_VERSION | <required - provide value - format 0.0.0> |
| ELASTICSEARCH_SSL_VERIFICATIONMODE| <required - provide value - options: full, none, certificate > |

## Options

### 1. [Kibana Local Setup](/local)
-- If you choose Option-1: This will check for full valid elasticsearch certificate.
-- If you choose Option-2: This will not check for elasticsearch certicate.

![Local Kibana Running - Prompt](.img/k1.png)

![Local Kibana Running - Complete](.img/k2.png)

![Local Kibana Running - Runs](.img/k3.png)


### 2. [Kibana OpenShift Deployment](/openshift)
```sh
Get your Kibana OpenShift URL from your project named "elk":
oc login --token=xxxxxxxx --server=xxxxxxxxxxxxxxx
echo "https://$(oc get route kibana -n elk --template='{{ .spec.host }}')"
```
```sh
Your Result:
https://kibana-yourproject.apps.yourdomain.yourtld
```

![Openshift Kibana Running - Runs](.img/k4.png)

<br><br>
Author: <br>
Jeffrey Chijioke-Uche, Ph.D<br>
IBM Hybridcloud,Multicloud, & AI

19 changes: 19 additions & 0 deletions local/.env.deactivated
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#######################################################
# Software: IBM Watsonx Kibana Installation Tool
# Use: For Development of Watsonx Applications
# Audience: General Use
# Author: Dr. Jeffrey Chijioke-Uche, Ph.D
# Company: IBM Corporation
# Version 1.0
# License ID: 3.0 (the "License")
#######################################################
# .env
export ELASTICSEARCH_USERNAME="<Provide value>"
export ELASTICSEARCH_PASSWORD="<Provide value>"
export ELASTICSEARCH_HOST="<Provide value without https://>"
export ELASTICSEARCH_PORT="<Provide value>"
export KIBANA_PORT="5601"
export ELASTICSEARCH_VERSION="<Provide value>" # format: 0.0.0
export ELASTICSEARCH_TLS_NAME="<Provide value>"
export ELASTICSEARCH_SSL_VERIFICATIONMODE="full"
export ELASTICSEARCH_ENDPOINT="<Provide value as https://<username>:<password>@<host without https://>"
7 changes: 7 additions & 0 deletions local/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#############
elasticconfig
secret-v2.yml
secret*
.env
cacert.crt
kibana.yml
Binary file added local/.img/k14.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added local/.img/k18.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions local/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
MIT License
License ID: 3.0

Copyright (c) 2024 International Business Machines

Author: Dr. Jeffrey Chijioke-Uche, Ph.D (IBM)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
53 changes: 53 additions & 0 deletions local/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# IBM Watsonx Discovery - Local Kibana Installation
### Watsonx Discovery Kibana Local Installation
<img src=".img/k14.png" alt="Openshift Kibana Running - Runs" width="200" height="80"> <img src=".img/k18.png" alt="Openshift Kibana Running - Runs" width="100" height="80">

## Prerequisites
- Ensure that you have docker runtime installed.
- Ensure `envsubst` command is available (Ubuntu/Linux[`sudo apt-get update && apt-get install gettext-base`] OR MacOS[`brew install gettext && brew link --force gettext`])
- Ensure you have OpenSSL 3.x installed.
- Ensure you have cURL installed.
- Ensure you have access to running Watsonx Discovery[Db for Elasticsearch]. (Any Edition: Standard, Enterprise, Platinum)
- Ensure that your local machine is docker image ready.


## STEP 1: Clone the Toolkit
```sh
git clone https://github.ibm.com/JEFFREY-CHIJIOKE-UCHE/watsonx-discovery-kibana-installation-tool.git
cd watsonx-discovery-kibana-installation-tool
cd local
```


## STEP 2: Activate Two Essential Toolkits
```sh
mv .env.deactivated .env
mv cacert.crt.deactivated cacert.crt
```


## STEP 3: Add Your Elasticsearch Required Variable Values to local store
```sh
Open .env (which has empty values) and then fill in the values as required.
Save .env file.
```


## STEP 4: Paste Elasticsearch TLS/SSL Certificate
```sh
Go to Watsonx Discovery(Elasticsearch) UI then copy the TLS Certificate.
Open cacert.crt (which is empty) and then paste the TLS Certificate you copied.
Save cacert.crt
```


## STEP 5: Run!
```sh
bash start-run.sh
```

--------------------------------------
## STOP LOCAL KIBANA
```sh
bash stop-run.sh
```
Empty file added local/cacert.crt.deactivated
Empty file.
41 changes: 41 additions & 0 deletions local/generate_kibana-yml_config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash
#######################################################
# Software: IBM Watsonx Kibana Installation Tool
# Use: For Development of Watsonx Applications
# Audience: General Use
# Author: Dr. Jeffrey Chijioke-Uche, Ph.D
# Company: IBM Corporation
# Version 1.0
# License ID: 3.0 (the "License")
# Engine: Start Engine
#######################################################

# Load the environment variables from the .env file
if [ -f .env ]; then
echo ".env found, loading environment variables..."
source .env
else
echo ".env file not found! - Did you actually create one?"
exit 1
fi

# Kibana Configurations:
if [ "$ARCH" = "linux-amd64-arm64" ]; then
# Generate the kibana.yml file from the template
echo "Generating kibana.yml from kibana.yml.template..."
envsubst < kibana.yml.template > kibana.yml
echo "kibana.yml has been generated and overwritten with the provided environment variables."
elif [ "$ARCH" = "mac-amd64-arm64" ]; then
# Generate the kibana.yml file from the template
echo "Generating kibana.yml from kibana.yml.template..."
envsubst < kibana.yml.template > kibana.yml
echo "kibana.yml has been generated and overwritten with the provided environment variables."
elif [ "$ARCH" = "windows-x86-x64" ]; then
# Generate the kibana.yml file from the template
echo "Generating kibana.yml from kibana.yml.template..."
envsubst < kibana.yml.template > kibana.yml
echo "kibana.yml has been generated and overwritten with the provided environment variables."
else
echo "No Kibana.yml generated."
exit 1
fi
77 changes: 77 additions & 0 deletions local/kibana-L1.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#!/bin/bash
###############################################################
# Software: IBM Watsonx Kibana Installation Tool
# Use: For Development of Watsonx Applications
# Audience: General Use
# Author: Dr. Jeffrey Chijioke-Uche, Ph.D
# Company: IBM Corporation
# Version 1.0
# License ID: 3.0 (the "License")
# Engine: Start Engine
##############################################################

# Load the environment variables from the .env file
echo ""
echo "-------------------------------------------------------------------------------"
echo "K I B A N A * R U N N I N G * S T A T U S | W A T S O N X D I S C O V E R Y"
echo "-------------------------------------------------------------------------------"
if [ -f .env ]; then
echo ".env found, nice practice!"
TLSV=08262
source .env
source kibana_reset.sh
else
echo ".env file not found! - Did you actually create one?"
exit 1
fi

# Stop running watsonx discovery kibana.
echo ""
if command_exists podman && [ "$(podman ps -a -q -f name=ibm-watsonx-discovery-kibana)" ]; then
echo "Stopping and removing existing Kibana Podman container: ibm-watsonx-discovery-kibana..."
image_uninstaller
echo "Your Local Watsonx Discovery Kibana Instance Stopped!"
elif command_exists docker && [ "$(docker ps -a -q -f name=ibm-watsonx-discovery-kibana)" ]; then
echo "Stopping and removing existing Kibana Docker container: ibm-watsonx-discovery-kibana..."
image_uninstaller
echo "Your Local Watsonx Discovery Kibana Instance Stopped!"
elif command_exists buildah && [ "$(buildah ps -a -q -f name=ibm-watsonx-discovery-kibana)" ]; then
echo "Stopping and removing existing Kibana Buildah container: ibm-watsonx-discovery-kibana..."
image_uninstaller
echo "Your Local Watsonx Discovery Kibana Instance Stopped!"
else
echo "Local container ibm-watsonx-discovery-kibana does not exist, please wait.."
sleep 10
echo "Creating it, Please wait..."
fi

# Operating Systems:
source operating-systems.sh


# Runs:
if [ "$ARCH" = "linux-amd64-arm64" ]; then
# Run Kibana Container: Local: LinuxOS
source kibana-engine-linux.sh
tls_set_and_run_option
elif [ "$ARCH" = "mac-amd64-arm64" ]; then
# Run Kibana Container: Local: MacOS
source kibana-engine-mac.sh
tls_set_and_run_option
elif [ "$ARCH" = "windows-x86-x64" ]; then
# Run Kibana Container: Local: Windows WSL
source kibana-engine-win.sh
tls_set_and_run_option
else
echo "Your Operating System is not supported at this time."
exit 1
fi

# Start Time
echo ""
echo "Starting Kibana:"
echo "Kibana running, please wait while Watsonx Discovery Kibana completely starts..."
sleep 40
echo "Watsonx Kibana is supposed to have started by now."
echo "Go to http://localhost:$KIBANA_PORT to start your integration."
echo "Welcome to IBM Watsonx Discovery Kibana"
76 changes: 76 additions & 0 deletions local/kibana-L2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#!/bin/bash
###############################################################
# Software: IBM Watsonx Kibana Installation Tool
# Use: For Development of Watsonx Applications
# Audience: General Use
# Author: Dr. Jeffrey Chijioke-Uche, Ph.D
# Company: IBM Corporation
# Version 1.0
# License ID: 3.0 (the "License")
# Engine: Start Engine
##############################################################

# Load the environment variables from the .env file
echo ""
echo "-------------------------------------------------------------------------------"
echo "K I B A N A * R U N N I N G * S T A T U S | W A T S O N X D I S C O V E R Y"
echo "-------------------------------------------------------------------------------"
if [ -f .env ]; then
echo ".env found, nice practice!"
TLSV=00000
source .env
source kibana_reset.sh
else
echo ".env file not found! - Did you actually create one?"
exit 1
fi

# Stop running watsonx discovery kibana.
echo ""
if command_exists podman && [ "$(podman ps -a -q -f name=ibm-watsonx-discovery-kibana)" ]; then
echo "Stopping and removing existing Kibana Podman container: ibm-watsonx-discovery-kibana..."
image_uninstaller
echo "Your Local Watsonx Discovery Kibana Instance Stopped!"
elif command_exists docker && [ "$(docker ps -a -q -f name=ibm-watsonx-discovery-kibana)" ]; then
echo "Stopping and removing existing Kibana Docker container: ibm-watsonx-discovery-kibana..."
image_uninstaller
echo "Your Local Watsonx Discovery Kibana Instance Stopped!"
elif command_exists buildah && [ "$(buildah ps -a -q -f name=ibm-watsonx-discovery-kibana)" ]; then
echo "Stopping and removing existing Kibana Buildah container: ibm-watsonx-discovery-kibana..."
image_uninstaller
echo "Your Local Watsonx Discovery Kibana Instance Stopped!"
else
echo "Local container ibm-watsonx-discovery-kibana does not exist, please wait.."
sleep 10
echo "Creating it, Please wait..."
fi

# Operating Systems:
source operating-systems.sh

# Runs:
if [ "$ARCH" = "linux-amd64-arm64" ]; then
# Run Kibana Container: Local: LinuxOS
source kibana-engine-linux.sh
tls_set_and_run_option
elif [ "$ARCH" = "mac-amd64-arm64" ]; then
# Run Kibana Container: Local: MacOS
source kibana-engine-mac.sh
tls_set_and_run_option
elif [ "$ARCH" = "windows-x86-x64" ]; then
# Run Kibana Container: Local: Windows WSL
source kibana-engine-win.sh
tls_set_and_run_option
else
echo "Your Operating System is not supported at this time."
exit 1
fi

# Start Time
echo ""
echo "Starting Kibana:"
echo "Kibana running, please wait while Watsonx Discovery Kibana completely starts..."
sleep 40
echo "Watsonx Kibana is supposed to have started by now."
echo "Go to http://localhost:$KIBANA_PORT to start your integration."
echo "Welcome to IBM Watsonx Discovery Kibana"
Loading

0 comments on commit 884f14e

Please sign in to comment.