From 8357804ed4e1859d0111f4175dd72628343695ac Mon Sep 17 00:00:00 2001 From: tomasAscencio Date: Thu, 5 Aug 2021 16:45:34 -0500 Subject: [PATCH 1/6] Modificacion casandra eureka activemq --- external_tools/docker-compose.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/external_tools/docker-compose.yml b/external_tools/docker-compose.yml index 3718df8..4bbc324 100644 --- a/external_tools/docker-compose.yml +++ b/external_tools/docker-compose.yml @@ -16,7 +16,7 @@ services: deploy: replicas: 1 restart_policy: - condition: any + condition: on-failure delay: 10s max_attempts: 3 @@ -32,7 +32,7 @@ services: deploy: replicas: 1 restart_policy: - condition: any + condition: on-failure delay: 10s max_attempts: 3 @@ -63,7 +63,7 @@ services: deploy: replicas: 1 restart_policy: - condition: any + condition: on-failure delay: 10s max_attempts: 3 volumes: From 3dc6fe4d8576ae15cd5e20f5cad7caae96518bc0 Mon Sep 17 00:00:00 2001 From: Noe Garcia Date: Thu, 5 Aug 2021 17:07:41 -0500 Subject: [PATCH 2/6] Se agrega healthcheck a servicio postgres --- external_tools/docker-compose.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/external_tools/docker-compose.yml b/external_tools/docker-compose.yml index 4bbc324..cea3bbc 100644 --- a/external_tools/docker-compose.yml +++ b/external_tools/docker-compose.yml @@ -46,6 +46,11 @@ services: environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres + healthcheck: + test: ["CMD-SHELL", "pg_isready"] + interval: 10s + timeout: 5s + retries: 5 ports: - "5432:5432" volumes: From 632da6f84500d5758286b1adf53ea4278c6cc4c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Romero?= <46640258+IOhacker@users.noreply.github.com> Date: Fri, 6 Aug 2021 09:04:17 -0500 Subject: [PATCH 3/6] Update README.md --- README.md | 115 +++++++++++++++++++++++++++++++++--------------------- 1 file changed, 70 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index 19ec759..d25cb17 100644 --- a/README.md +++ b/README.md @@ -2,34 +2,51 @@ This project contains Docker and Kubernetes Scripts for deploying Fineract CN, especially in Development. ## Requirements -- Kubernetes -- Docker -- Docker-compose -- Java + +### Fineract CN Libraries + +01. fineract-cn-lang +02. fineract-cn-postgresql +03. fineract-cn-anubis +04. fineract-cn-permitted-feign-client +05. fineract-cn-identity +06. fineract-cn-api +07. fineract-cn-async +08. fineract-cn-cassandra +09. fineract-cn-crypto +10. fineract-cn-test + +### Software Platform + +1. Kubernetes +2. Docker +3. Docker-compose +4. Java # Deploy and provision Fineract CN using Kubernetes Make sure you set up and connect to your Kubernetes cluster. You can follow [this](https://cwiki.apache.org/confluence/display/FINERACT/Install+and+configure+kubectl+and+Google+Cloud+SDK+on+ubuntu+16.04) guide to set up a Kubernetes cluster on GKE. - Enter the Kubernetes directory. - - `cd kubernetes_scripts` - +```console +cd kubernetes_scripts +``` - To deploy all the Fineract CN services on your cluster, run : - - `bash kubectl-start-up.sh` +```console +bash kubectl-start-up.sh +``` - You should make sure an external ip address had been assigned to all the deployed services by running: - - `kubectl get services` +```console +kubectl get services +``` - Finally provison the microservices by running: - - `cd bash_scripts` - - `bash provision.sh --deploy-on-kubernetes playground` # where playground is your tenant name - +```console +cd bash_scripts +bash provision.sh --deploy-on-kubernetes playground` # where playground is your tenant name +``` - To shut down and reset you cluster, run: - - `bash kubectl-shut-down.sh` - +```console +bash kubectl-shut-down.sh` +``` # Deploy and provision Fineract CN using Docker and Docker-compose You can either deploy and provision Fineract CN automatically using bash scripts or manually using Postman. @@ -42,38 +59,42 @@ You can either deploy and provision Fineract CN automatically using bash scripts # 1. Deploy and provision Fineract automatically using bash scripts - To start up all the Fineract CN services run: - - `bash start-up.sh` +```console +bash start-up.sh +``` - Then log the last Fineract CN microservice deployed by docker compose (fineract-cn-notification) to make sure all your Fineract services are now available. - - `docker logs -f fineract-cn-docker-compose_notifications-ms_1` +```console +docker logs -f fineract-cn-docker-compose_notifications-ms_1 +``` - Finally provison the microservices by - - `cd bash_scripts` - - `bash provision.sh playground` # where playground is your tenant name - +```console +cd bash_scripts +bash provision.sh playground # where playground is your tenant name +``` ## 2. Deploy Fineract manually using postman ## Perquisites ### Generate .env file with RSA keys -`java -cp external_tools/lang-0.1.0-BUILD-SNAPSHOT.jar org.apache.fineract.cn.lang.security.RsaKeyPairFactory UNIX > .env` - +```console +java -cp external_tools/lang-0.1.0-BUILD-SNAPSHOT.jar org.apache.fineract.cn.lang.security.RsaKeyPairFactory UNIX > .env +``` This library is taken from [fineract-cn-lang](https://github.com/apache/fineract-cn-lang#generate-and-print-rsa-keys). If needed you can pull a fresh copy of it: -`wget https://mifos.jfrog.io/mifos/libs-snapshot-local/org/apache/fineract/cn/lang/0.1.0-BUILD-SNAPSHOT/lang-0.1.0-BUILD-SNAPSHOT.jar external_tools/lang-0.1.0-BUILD-SNAPSHOT.jar` - +```console +wget https://mifos.jfrog.io/mifos/libs-snapshot-local/org/apache/fineract/cn/lang/0.1.0-BUILD-SNAPSHOT/lang-0.1.0-BUILD-SNAPSHOT.jar external_tools/lang-0.1.0-BUILD-SNAPSHOT.jar +``` ### Add other environment variables to the end of the .env file -`cat env_variables >> .env` - +```console +cat env_variables >> .env +``` If you run some service from localhost then [add these services to your hosts file](#use-the-postman-scripts-when-running-locally). ## Procedure ### Start external tools (database, cassandra, etc) -``` +```console cd external_tools docker-compose up ``` @@ -81,7 +102,7 @@ docker-compose up ### Start micro services First only start provisioner-ms by running following in project root: -``` +```console docker-compose up provisioner-ms ``` after it has started (and created table seshat to Postgre database) you can start rest of the services. @@ -92,7 +113,7 @@ In the docker-compose.yml (that resides in project root) there are more than 10 Running all services together consumes a lot of memory. So you can start a subset of services. For example you could start the following additional micro services and an fims-web-app: -``` +```console docker-compose up rhythm-ms identity-ms customer-ms accounting-ms deposit-ms portfolio-ms office-ms teller-ms fims-web-app ``` If you want you can add other micro services (listed in docker-compose.yml) to the list. @@ -110,7 +131,7 @@ Instead demo_server we have Postman scripts and we use 'playground' as tenant na We provide a postman-request-collection as well as a postman-environment that defines variables that are used to hold values received in responses. Both files are located under [postman-initial-requests folder](postman_scripts): -``` +```console postman_scripts/Fineract-Cn-Initial-Requests.postman_collection.json postman_scripts/Fineract-Cn-Initial-Setup-Environment.postman_environment.json ``` @@ -125,7 +146,7 @@ Initialize Postman as follows: The first request will retrieve a token. The response should look like this, with a different token: -``` +```json { "token": "Bearer eyJhbGciOiJSUzUxMiJ9.eyJhdWQiOiJwcm92aXNpb25lci12MSIsInN1YiI6IndlcGVtbmVmcmV0IiwiL21pZm9zLmlvL3NpZ25hdHVyZVRpbWVzdGFtcCI6IjIwMTctMDQtMThUMDlfNDRfMjIiLCIvbWlmb3MuaW8vdG9rZW5Db250ZW50IjoiUk9MRV9BRE1JTiIsImlzcyI6InN5c3RlbSIsImlhdCI6MTUwMDA1NjgxNywiZXhwIjoxNTAwNDE2ODE3fQ.OfxTUTStJbKQc4rAPW5PLIQYNjCG_uqcNPR4up6pIQBWLDxkgEiU9EF1WrB5NQdzXBJIHqjDFQpaVywm5DersIh4LxPGD3MZj3TqZK5_LUcZvBDTa4Xgb41e3xXkWB4TkN6KqfmiK12Ngjrrj7qZGBdtypDmFmZwKQRZIOL6T3QbI7LpbPGpeWjpWZirFgtcn5B1Z_h3r9rirCzecUdVjlaplQufxDuVFJS0R3N67pyuGQENvCAC716ID5KbokTQtITXfjnCztFuQBbtCPcYLIzxsKv_-E5k6Gd0pv01OC0XpY3NSgfAolVVgvSXKoRnL3NwAMP2yuzX6i8hR_q82Q", "accessTokenExpiration": "2019-07-18T22:26:57.784" @@ -144,9 +165,9 @@ Use the accounts_with_type.csv file found in postman_scripts and [follow the ins 1. Check if the micro services to which the requests are made are up and running. Check the container for details of failures (if any): - +```console docker-compose logs provisioner-ms - +``` 2. Check that apps have registered with eureka: http://localhost:8761/ 3. Reach out to [mailing list](https://lists.apache.org/list.html?dev@fineract.apache.org) with the relevant details @@ -162,7 +183,7 @@ Navigate to http://localhost:8888 in your browser and enter the credentials of t The following user-profile is available in fims-web-app after above setup was completed successfully: -``` +```console tenant: playground user: mifos password: password @@ -172,7 +193,7 @@ password: password Postman scripts use service names (postgres, provisioner-ms, etc) when referring to different services. If you want to use the same Postman scripts when running micro services locally then add into your hosts (/etc/hosts in Unix) file: -``` +```console 127.0.0.1 eureka 127.0.0.1 postgres 127.0.0.1 cassandra @@ -196,9 +217,13 @@ If you want to use the same Postman scripts when running micro services locally ### How to reset everything and start from scratch -Run ./shut-down-and-reset.sh or - +Run +```console +./shut-down-and-reset.sh ``` +or + +```console cd external_tools docker-compose stop docker-compose rm From 07cfa31baf895ad09c7ebf26adc75333b8aa9568 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Romero?= <46640258+IOhacker@users.noreply.github.com> Date: Fri, 6 Aug 2021 09:12:32 -0500 Subject: [PATCH 4/6] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d25cb17..68c1d3c 100644 --- a/README.md +++ b/README.md @@ -41,11 +41,11 @@ kubectl get services - Finally provison the microservices by running: ```console cd bash_scripts -bash provision.sh --deploy-on-kubernetes playground` # where playground is your tenant name +bash provision.sh --deploy-on-kubernetes playground # where playground is your tenant name ``` - To shut down and reset you cluster, run: ```console -bash kubectl-shut-down.sh` +bash kubectl-shut-down.sh ``` # Deploy and provision Fineract CN using Docker and Docker-compose From d613ee489bcdbbd692328b948cd2157903989d75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Romero?= <46640258+IOhacker@users.noreply.github.com> Date: Fri, 6 Aug 2021 09:49:08 -0500 Subject: [PATCH 5/6] Update README.md --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 68c1d3c..23160e5 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,15 @@ This project contains Docker and Kubernetes Scripts for deploying Fineract CN, e 09. fineract-cn-crypto 10. fineract-cn-test +### Environment Variables + +The following variables are required for publishg the binary artifacts. Values are examples, change them to fit your environment. +```console +ARTIFACTORY_URL = 'https://url-to-artifactory/artifactory/' +ARTIFACTORY_USER = 'user' +ARTIFACTORY_PASSWORD = 'password' +ARTIFACTORY_REPOKEY = 'libs-snapshot-local' +``` ### Software Platform 1. Kubernetes From ad73bdf3c156752f39006f6ceab665ca59211822 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Romero?= <46640258+IOhacker@users.noreply.github.com> Date: Fri, 6 Aug 2021 10:03:24 -0500 Subject: [PATCH 6/6] Update README.md --- README.md | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/README.md b/README.md index 23160e5..246f55e 100644 --- a/README.md +++ b/README.md @@ -3,28 +3,6 @@ This project contains Docker and Kubernetes Scripts for deploying Fineract CN, e ## Requirements -### Fineract CN Libraries - -01. fineract-cn-lang -02. fineract-cn-postgresql -03. fineract-cn-anubis -04. fineract-cn-permitted-feign-client -05. fineract-cn-identity -06. fineract-cn-api -07. fineract-cn-async -08. fineract-cn-cassandra -09. fineract-cn-crypto -10. fineract-cn-test - -### Environment Variables - -The following variables are required for publishg the binary artifacts. Values are examples, change them to fit your environment. -```console -ARTIFACTORY_URL = 'https://url-to-artifactory/artifactory/' -ARTIFACTORY_USER = 'user' -ARTIFACTORY_PASSWORD = 'password' -ARTIFACTORY_REPOKEY = 'libs-snapshot-local' -``` ### Software Platform 1. Kubernetes