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

C4GT 2 #18

Open
wants to merge 42 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
e15e1e2
start of copy from mojafos to mifos-gazelle
tdaly61 Aug 1, 2024
8232fc1
adding files from mojafos td-dev1 branch
tdaly61 Aug 1, 2024
adf387d
moved mifosx manifests as apps dir needs to be in gitignore
tdaly61 Aug 1, 2024
076cbf1
testing from mifos-gazelle, start to update docs
tdaly61 Aug 1, 2024
bdc711a
mifosx installed debuged and manifests now come from mifosx-docker repo
tdaly61 Aug 7, 2024
125a6dd
bug fixes for phee deploy and user options
tdaly61 Aug 8, 2024
cd2d3f6
fixed non clone of the ph-ee-template repo
tdaly61 Aug 8, 2024
cf49d92
ensure infrastructure deployed with fineract
tdaly61 Aug 8, 2024
baf5192
fixed vNext installation bug, started some tidy ups
tdaly61 Aug 9, 2024
707e3f3
feat: Add ingress configuration in ph_values.yaml
Ratnesh2003 Aug 19, 2024
bf6e2d5
Merge pull request #14 from Ratnesh2003/c4gt-ingress-config
tdaly61 Aug 28, 2024
c0755ca
Jmeter file added
deveshpandee Aug 28, 2024
17184a8
docs: Add script and docs to configure postman post deployment
Ratnesh2003 Aug 29, 2024
f3947c8
docs: Update NOTE for users
Ratnesh2003 Aug 29, 2024
40bffc7
Merge pull request #16 from Ratnesh2003/docs/running-postman-collections
tdaly61 Aug 30, 2024
0610eec
minor updates and cleanups for deployer and ph_values
tdaly61 Aug 30, 2024
29db2e1
up[date gitignore to ignore new repos dir
tdaly61 Aug 30, 2024
4725ae1
transitioning to c4gt2
tdaly61 Aug 30, 2024
255f1ae
started renaming everyting to be gazelle specific also doing director…
tdaly61 Aug 30, 2024
616be42
still renaming and re-orging
tdaly61 Aug 30, 2024
2714b63
getting close to finishing rename and re-org
tdaly61 Aug 31, 2024
340bcfc
almost finished rename and reorg
tdaly61 Aug 31, 2024
944e987
still rename and reorg
tdaly61 Aug 31, 2024
a258ebe
working on redeployability
tdaly61 Sep 2, 2024
4319ba8
rename and re-org essentially done, testing still required
tdaly61 Sep 4, 2024
fcc4b7f
ignore Chart.lock
tdaly61 Sep 4, 2024
e8cded5
added helm dep update for infra chart
tdaly61 Sep 4, 2024
df95180
Point to the cluster of the ph-ee namespace for removing mysql service
Abhinavcode13 Sep 7, 2024
dc8bb99
docs: Modify postman_setup.md and postman_setup.sh files
Ratnesh2003 Sep 10, 2024
3b22f82
Jmeter testing file updated
deveshpandee Sep 10, 2024
40dc44b
jmeter file updated
deveshpandee Sep 10, 2024
5cdf609
fixes for redeploy of phee
tdaly61 Sep 12, 2024
d589e57
Merge pull request #20 from deveshpandee/master
tdaly61 Sep 12, 2024
f9fd493
Merge pull request #19 from Ratnesh2003/docs/modify-postman-setup
tdaly61 Sep 12, 2024
c87b218
chores: added kibana in the infra namespace
Abhinavcode13 Sep 12, 2024
91869dd
tidied ph_values added support scripts in utils
tdaly61 Sep 19, 2024
c900d83
minor mod to ph_values for elastic
tdaly61 Sep 19, 2024
497fafc
have lots of the helm test now running
tdaly61 Oct 9, 2024
121a12f
adjust operations-app and web to have phee v1.13.0 versions
tdaly61 Oct 9, 2024
07e3003
debugging stuff for operations-web bulk upload mostly
tdaly61 Oct 18, 2024
bdacb35
adding some utils for integration tests
tdaly61 Oct 18, 2024
0f6b62d
mainly typo fixes
Oct 21, 2024
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
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,12 @@ cython_debug/

#Helm
charts/
Chart.lock

#gitrepos
vnext/
mojaloop/
ph/
fineract/
apps/
apps/
repos/
194 changes: 6 additions & 188 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,196 +1,14 @@
# A Deployable Package for Mifos/Fineract, Payment Hub EE, and Mojaloop (Mojafos)
# NEEDS UPDATING FOR MIFOS-GAZELLE

## Introduction

The deployable package is intended to simplify and automate the deployment process of three software applications, namely Mojaloop, PaymentHub, and Fineract, onto a Kubernetes cluster. This package aims to streamline the deployment process, reduce manual errors, and enable someone to demo how these softwares can work together.


## Pre-requisites
Make sure you have the following before you go through this guide.
- You should be running Ubuntu 20.04 LTS on the machine where you are running this script
- 32GB of RAM
- 30GB+ free space in your home directory

# Quick Start
> NOTE: The deployment made by this script is meant for demo purposes and not for production

## Clone the repository
To use Mojafos, you need to clone the repository to be able to run the software scripts.
Clone the repository into a directory of your choice.
After cloning the repository, you need to change the directory into the cloned repository.
```
git clone https://github.com/openMF/mojafos.git
```

Inside the directory run the following command to execute the script.

```bash
sudo ./run.sh -u $USER -m deploy -d true -a all -f 2 -e local
```
### Options
- `-u` This is used to pass in the user the script should use to execute it's commands. The value passed in is `$USER` which the current user of the shell
- `-m` This option specifies the mode in which the script should execute. The available values are
- `deploy` - Deploy applications
- `cleanup` - Undo what deploy did and clean up resources
- `-d` This flag tells the sccript whether to execute in verbose mode or not. The available values are :
- true - Output should provide as much information as possible
- false - Output should not be minimal
- `-a` This flag tells the script in which mode the depoloyment should be made. It is an optional flag therefore if it is not provided,the default deployment mode is all apps
- `-f` This flag specifies the number of fineract instances to deployed. If not specified, the default number of instances is 2
- `-e` This flag specifies the environment into which the applications should be deployed. If not specified, it will deploy into k3s locally.


# App Deployment Modes -a
There are three modes of deployment currently supported by Mojafos. This is relevant for the -a option
- Only Mojaloop `moja`
- Only Fineract `fin`
- Only Payment Hub `ph`
- All Apps `all`


# Target Environment -e
You can set the environment into which the applications should be deployed by setting the -e argument at the point of executing the script.

To use a remote kubernetes cluster, use the value `remote` and to create a local k8s cluster, use `local`
>Currently the tool is only tested on local kubernetes deployments but work is being done to test it on


After the script has successfully executed it will print the following output

```
========================================================================
Thank you for installing Mojaloop, Paymenthub and Fineract using Mojafos
========================================================================


TESTING
sudo ./run -u $USER -m test ml #For testing mojaloop
sudo ./run -u $USER -m test ph #For testing payment hub
sudo ./run -u $USER -m test fin #For testing fineract



CHECK DEPLOYMENTS USING kubectl
kubectl get pods -n mojaloop #For testing mojaloop
kubectl get pods -n paymenthub #For testing paymenthub
kubectl get pods -n fineract-n #For testing fineract. n is a number of a fineract instance


Copyright © 2023 The Mifos Initiative
```

# USING THE DEPLOYED APPS
# A Deployable Package for Mifos/Fineract, Payment Hub EE, and Mojaloop (Mifos-gazelle)

## Accessing Mojaloop
The Mojafos scripts add the required host names to the 127.0.0.1 entry in the /etc/hosts of the "install system" i.e. the system where mojafos is run. To access Mojaloop from beyond this system it is necessary to:-

ensure that http / port 80 is accessible on the install system. For instance if mojafos has installed Mojaloop onto a VM in the cloud then it will be necessary to ensure that the cloud network security rules allow inbound traffic on port 80 to that VM.

## MacOs and Linux
add the hosts listed below to an entry for the external/public ip address of that install system in the /etc/hosts file of the laptop you are using.
For example if Mojaloop vNext is installed on a cloud VM with a public IP of 192.168.56.100 Then add an entry to your laptop's /etc/hosts similar to ...
```bash
192.168.56.100 vnextadmin.local elasticsearch.local kibana.local mongoexpress.local kafkaconsole.local fspiop.local bluebank.local greenbank.local
```

You should now be able to browse or curl to Mojaloop vNext admin url using http://vnextadmin you can also access the deloyed instances of the Mojaloop testing toolkit at http://bluebank.local and http://greenbank.local or access the mongo and kafka consoles.

## Windows
- open Notepad
- Right click on Notepad and then Run as Administrator.
- allow this app to make changes to your device? type Yes.
- In Notepad, choose File then Open C:\Windows\System32\drivers\etc\hosts or click the address bar at the top and paste in the path and choose Enter. If you don’t see the host file in the /etc directory then select All files from the File name: drop-down list, then click on the hosts file.
- Add the IP from your VM or system and then add a host from the list of required hosts (see example below)
- flush your DNS cache. Click the Windows button and search command prompt, in the command prompt:-
```bash
ipconfig /flushdns
```
Note you can only have one host per line so on windows 10 your hosts file should look something like:

```bash
192.168.56.100 vnextadmin.local
192.168.56.100 elasticsearch.local
192.168.56.100 kibana.local
192.168.56.100 mongoexpress.local
192.168.56.100 kafkaconsole.local
192.168.56.100 fspiop.local
192.168.56.100 bluebank.local
192.168.56.100 greenbank.local
```

## Accessing Paymenthub

To access paymenthub, you would follow a similar set of instructions just like for accessing mojaloop.

## MacOs and Linux
add the hosts listed below to an entry for the external/public ip address of that install system in the /etc/hosts file of the laptop you are using.
For example if Paymenthub is installed on a cloud VM with a public IP of 192.168.56.100 Then add an entry to your laptop's /etc/hosts similar to ...

```bash
192.168.56.100 ops.sandbox.mifos.io
```

You should now be able to browse or curl to Paymenthub Operations Web portal url using http://ops.sandbox.mifos.io .

## Windows
- open Notepad
- Right click on Notepad and then Run as Administrator.
- allow this app to make changes to your device? type Yes.
- In Notepad, choose File then Open C:\Windows\System32\drivers\etc\hosts or click the address bar at the top and paste in the path and choose Enter. If you don’t see the host file in the /etc directory then select All files from the File name: drop-down list, then click on the hosts file.
- Add the IP from your VM or system and then add a host from the list of required hosts (see example below)
- flush your DNS cache. Click the Windows button and search command prompt, in the command prompt:-
```bash
ipconfig /flushdns
```
Note you can only have one host per line so on windows 10 your hosts file should look something like:

```bash
192.168.56.100 ops.sandbox.mifos.io
```

# Accessing Fineract
To access the fineract instances you just deployed using mojafos, you will needs to make similar edits to your hosts file configuration of your computer.

## MacOs and Linux
add the hosts listed below to an entry for the external/public ip address of that install system in the /etc/hosts file of the laptop you are using.
For example if one of the instances of fineract is installed on a cloud VM with a public IP of 192.168.56.100 Then add an entry to your laptop's /etc/hosts similar to ...

```bash
192.168.56.100 1-communityapp.sandbox.fynarfin.io 1-fynams.sandbox.fynarfin.io
```
Notice the 1 at the begining of the host name. This is automatically prepended at the begining of a fineract instance's host names to form it's ingress domain name.

If you set the number of fineract instances to 3, you would have domains ranging from `1-xxx.sandbox.fynarfin.io` to `3-xxx.fynarfin.io`

After editing your hosts config with the number of fineract instances you deployed, you should now be able to browse or curl to Community App url using http://1-communityapp.sandbox.fynarfin.io and fineract at http://1-fynams.sandbox.fynarfin.io

## Windows
- open Notepad
- Right click on Notepad and then Run as Administrator.
- allow this app to make changes to your device? type Yes.
- In Notepad, choose File then Open C:\Windows\System32\drivers\etc\hosts or click the address bar at the top and paste in the path and choose Enter. If you don’t see the host file in the /etc directory then select All files from the File name: drop-down list, then click on the hosts file.
- Add the IP from your VM or system and then add a host from the list of required hosts (see example below)
- flush your DNS cache. Click the Windows button and search command prompt, in the command prompt:-
```bash
ipconfig /flushdns
```
Note you can only have one host per line so on windows 10 your hosts file should look something like:

```bash
192.168.56.100 1-communityapp.sandbox.fynarfin.io
192.168.56.100 1-fynams.sandbox.fynarfin.io
```
# Clean Up

To tear down the infrastructure and all installed apps. You can run this command.

```bash
sudo ./run.sh -u $USER -m cleanup -d true -e local
```
## Introduction

This will delete all resources in the created namespaces and if the kubernetes cluster is `k3s` it will delete it as well.
The deployable package is intended to simplify and automate the deployment process of three software applications, namely Mojaloop, PaymentHub, and Fineract, onto a Kubernetes cluster. This package aims to streamline the deployment process, reduce manual errors, and enable someone to demo how these softwares can work together.

Please note that cleaning up the resources will take some time.
## SETTING THINGS UP
We maintain an in-detailed documentation on how to get started with Mifos-Gazelle. You can find them under the [/docs](./docs) directory

## CONTRIBUTION

Expand Down
29 changes: 29 additions & 0 deletions TO-GAZELLE-NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Mojafos is moving to mifos-gazelle

## Notes :
- the mojafos td-dev1 branch is the basis of the new mifos-gazelle utilities
- the interim mifos-gazelle branch c4gt1 contains a deployable version of the Mifosx app which is deployed via local kubernetes manifests , (mojaloop) vNext Beta1 also from kubernetes manifests and a simplified helm deployment of PHEE

## status
- all renaming to mifos-gazelle will happen in the mifos-gazelle repo in a non dev branch before merging to dev and of course the later release to main/master branch
- at the very start of Aug 2024 the Mojafos repo will be deprecated and all work go into mifos-gazelle (this repo)

## What is in the c4gt branch of mifos-gazelle compared to Mojafos dev branch
PHEE:
- simplified phee helm deployment, the operations-web UI is accessible via hostname ops.local BUT the application docker image currently has hardcoded URLs which mean that it will not currently work. The operations-web image is being debugged to remove these but timeline is unknown. postman collections should work against the operations-web UI and the rest of PHEE and Mifos
- this deployment relies upon the c4gt-gazelle-dev branch of the ph-ee-template repo

MifosX (i,e, fineract and web-app deloyment)
- Mifos fineract and the Mifos Web application is now deployed from the kubernetes manifests which are stored in the mifos-gazelle_1 branch of the https://github.com/openMF/mifosx-docker.git repository (see kubernetes/manifets subdir). The mifos-gazelle depoyer.sh script automatically clones and deploys this repo (see the example usage below )
- use the hostname mifos.local to access the web-app
- the deployment uses the existing Mojafos deployed mysql database in the infra namespace
- you need to add mifos.local to your local hosts file against the IP of the VM where MifosX is deployed 9see examples in the main mifos-gazelle readme)
- currently hardcoded to deploy only one instance of the web app and one of fineract.
- example usage sudo ./run.sh -m deploy -u azureuser -e local -d -a fin -f 1

General
- there is a lot of tidying up to do once this is better tested, e.g. debug statements to remove and lots of redundant env vars to remove as well as commented out code to remove.
- there have been no changes to the infrastructure or vNext installs all work really has been around PHEE and MifosX
- this deployment relies almost but not quite entirely on non vendor specific deployment artifacts and assumes right now single instance local deployment.
- it should be straightforward to integrate the kubernetes operator work into this simplified single node deployment

14 changes: 7 additions & 7 deletions src/mojafos/deployer/fin_values.yaml → config/fin_values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fineract:
preStopScript: 'echo -e "******Fineract is stopping********";'
ingress:
enabled: true
hostname: "2-fynams.sandbox.fynarfin.io"
hostname: "1-fynams.sandbox.fynarfin.io"
path: "/"
wildcardhostname: "*.sandbox.fynarfin.io"
annotations:
Expand All @@ -30,7 +30,7 @@ fineract:
cpu: "1000m"
memory: "2Gi"
requests:
cpu: "1m"
cpu: "100m"
memory: "100m"

communityapp:
Expand All @@ -39,9 +39,9 @@ communityapp:
image: "openmf/community-app:latest"
ingress:
enabled: true
hostname: "2-communityapp.sandbox.fynarfin.io"
hostname: "1-communityapp.sandbox.fynarfin.io"
path: "/"
wildcardhostname: "2-communityapp.sandbox.fynarfin.io"
wildcardhostname: "1-communityapp.sandbox.fynarfin.io"
annotations:
kubernetes.io/ingress.class: "nginx"
resources:
Expand All @@ -57,7 +57,7 @@ webapp:
image: "fintecheando/web-app:master"
ingress:
enabled: true
hostname: "2-webapp.sandbox.fynarfin.io"
hostname: "1-webapp.sandbox.fynarfin.io"
path: "/web"
annotations:
kubernetes.io/ingress.class: "nginx"
Expand Down Expand Up @@ -104,8 +104,8 @@ mysql:
primary:
resources:
requests:
memory: "500m"
cpu: "500m"
memory: "100m"
cpu: "100m"
limits:
memory: "2Gi"
cpu: "1000m"
Expand Down
14 changes: 14 additions & 0 deletions config/nginx_values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## nginx configuration
## Ref: https://github.com/kubernetes/ingress-nginx/blob/main/docs/user-guide/nginx-configuration/index.md
##

controller:
ingressClassResource:
name: nginx
# extraArgs:
# default-ssl-certificate: "paymenthub/toms-secret-2"
# config:
# hsts: "false"
# hsts-max-age: "0"
# hsts-include-subdomains: "false"
# hsts-preload: "false"
Loading