You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by GitBox <gi...@apache.org> on 2021/01/20 04:57:29 UTC

[GitHub] [fineract] BLasan opened a new pull request #1584: Add init-container to check MYSQL server deployment (FINERACT-1300)

BLasan opened a new pull request #1584:
URL: https://github.com/apache/fineract/pull/1584


   ## Description
   
   See[ FINERACT-1300](https://issues.apache.org/jira/browse/FINERACT-1300)
   
   
   ## Checklist
   
   Please make sure these boxes are checked before submitting your pull request - thanks!
   
   - [x] Write the commit message as per https://github.com/apache/fineract/#pull-requests
   
   - [x] Acknowledge that we will not review PRs that are not passing the build _("green")_ - it is your responsibility to get a proposed PR to pass the build, not primarily the project's maintainers.
   
   - [ ] Create/update unit or integration tests for verifying the changes made.
   
   - [x] Follow coding conventions at https://cwiki.apache.org/confluence/display/FINERACT/Coding+Conventions.
   
   - [ ] Add required Swagger annotation and update API documentation at fineract-provider/src/main/resources/static/api-docs/apiLive.htm with details of any API changes
   
   - [x] Submission is not a "code dump".  (Large changes can be made "in repository" via a branch.  Ask on the developer mailing list for guidance, if required.)
   
   FYI our guidelines for code reviews are at https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] vorburger merged pull request #1584: Add init-container to check MYSQL server deployment (FINERACT-1300)

Posted by GitBox <gi...@apache.org>.
vorburger merged pull request #1584:
URL: https://github.com/apache/fineract/pull/1584


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] vorburger commented on a change in pull request #1584: Add init-container to check MYSQL server deployment (FINERACT-1300)

Posted by GitBox <gi...@apache.org>.
vorburger commented on a change in pull request #1584:
URL: https://github.com/apache/fineract/pull/1584#discussion_r563163346



##########
File path: kubernetes/fineract-server-deployment.yml
##########
@@ -54,6 +54,10 @@ spec:
         app: fineract-server
         tier: backend
     spec:
+      initContainers:
+        - name: init-mydb
+          image: busybox:1.28
+          command: ['sh', '-c', 'echo -e "Checking for the availability of MYSQL server deployment"; while ! nc -z "fineractmysql" 3306; do sleep 1; printf "-"; done; echo -e " >> MYSQL server has started";']

Review comment:
       @BLasan a thought: instead of using `busybox` and `nc`, why not just re-use `image: mysql:5.7` with `mysqladmin` ?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] BLasan commented on pull request #1584: Add init-container to check MYSQL server deployment (FINERACT-1300)

Posted by GitBox <gi...@apache.org>.
BLasan commented on pull request #1584:
URL: https://github.com/apache/fineract/pull/1584#issuecomment-766103883


   @vorburger @xurror  please review sir


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] BLasan commented on a change in pull request #1584: Add init-container to check MYSQL server deployment (FINERACT-1300)

Posted by GitBox <gi...@apache.org>.
BLasan commented on a change in pull request #1584:
URL: https://github.com/apache/fineract/pull/1584#discussion_r563173785



##########
File path: kubernetes/fineract-server-deployment.yml
##########
@@ -54,6 +54,10 @@ spec:
         app: fineract-server
         tier: backend
     spec:
+      initContainers:
+        - name: init-mydb
+          image: busybox:1.28
+          command: ['sh', '-c', 'echo -e "Checking for the availability of MYSQL server deployment"; while ! nc -z "fineractmysql" 3306; do sleep 1; printf "-"; done; echo -e " >> MYSQL server has started";']

Review comment:
       Yeah, but sir that's why we have added liveness probe for mysql deployment. And from fineract point of view, it only needs to check whether the particular server and port up and running. Your point is correct and it's fulfilled by liveness probe inside mysql container.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] vorburger commented on pull request #1584: Add init-container to check MYSQL server deployment (FINERACT-1300)

Posted by GitBox <gi...@apache.org>.
vorburger commented on pull request #1584:
URL: https://github.com/apache/fineract/pull/1584#issuecomment-766090950


   /rebase


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] vorburger commented on a change in pull request #1584: Add init-container to check MYSQL server deployment (FINERACT-1300)

Posted by GitBox <gi...@apache.org>.
vorburger commented on a change in pull request #1584:
URL: https://github.com/apache/fineract/pull/1584#discussion_r563161178



##########
File path: kubernetes/fineractmysql-deployment.yml
##########
@@ -96,11 +96,7 @@ spec:
                   key: password
           livenessProbe:
             exec:
-              command:
-                - mysqladmin
-                - ping
-                - -h
-                - localhost
+              command: ["sh","-c","mysqladmin ping -h localhost -uroot -p${MYSQL_ROOT_PASSWORD}"]

Review comment:
       NB this change here was already in #1583 (for FINERACT-1294), so this diff should disappear on a rebase.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] BLasan commented on pull request #1584: Add init-container to check MYSQL server deployment (FINERACT-1300)

Posted by GitBox <gi...@apache.org>.
BLasan commented on pull request #1584:
URL: https://github.com/apache/fineract/pull/1584#issuecomment-763489509


   @xurror @vorburger Please review


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] BLasan commented on a change in pull request #1584: Add init-container to check MYSQL server deployment (FINERACT-1300)

Posted by GitBox <gi...@apache.org>.
BLasan commented on a change in pull request #1584:
URL: https://github.com/apache/fineract/pull/1584#discussion_r563165591



##########
File path: kubernetes/fineract-server-deployment.yml
##########
@@ -54,6 +54,10 @@ spec:
         app: fineract-server
         tier: backend
     spec:
+      initContainers:
+        - name: init-mydb
+          image: busybox:1.28
+          command: ['sh', '-c', 'echo -e "Checking for the availability of MYSQL server deployment"; while ! nc -z "fineractmysql" 3306; do sleep 1; printf "-"; done; echo -e " >> MYSQL server has started";']

Review comment:
       Sir, in here we need to just check whether the MYSQL server (remote server) is up and running. By using busybox image we can achieve that easily (from the bash command). mysql:5.7 image will need some extra configurations to establish the connection and listen to a remote server.(setting up credentials etc.. which is unnecessary) Simply the idea here is to verify that mysql server is running properly on the correct port and then FINERACT server could properly connect to mysql server and do the required tasks. Otherwise if we get a problem with mysql server, fineract server will go in to a CrashLoopBackOff state which is unnecessary.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] BLasan edited a comment on pull request #1584: Add init-container to check MYSQL server deployment (FINERACT-1300)

Posted by GitBox <gi...@apache.org>.
BLasan edited a comment on pull request #1584:
URL: https://github.com/apache/fineract/pull/1584#issuecomment-763489509


   @xurror @vorburger SIr Please review


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] vorburger commented on a change in pull request #1584: Add init-container to check MYSQL server deployment (FINERACT-1300)

Posted by GitBox <gi...@apache.org>.
vorburger commented on a change in pull request #1584:
URL: https://github.com/apache/fineract/pull/1584#discussion_r563168576



##########
File path: kubernetes/fineract-server-deployment.yml
##########
@@ -54,6 +54,10 @@ spec:
         app: fineract-server
         tier: backend
     spec:
+      initContainers:
+        - name: init-mydb
+          image: busybox:1.28
+          command: ['sh', '-c', 'echo -e "Checking for the availability of MYSQL server deployment"; while ! nc -z "fineractmysql" 3306; do sleep 1; printf "-"; done; echo -e " >> MYSQL server has started";']

Review comment:
       > Simply the idea here is to verify that mysql server is running properly on the correct port and then FINERACT server could properly connect to mysql server and do the required tasks. Otherwise if we get a problem with mysql server, fineract server will go in to a CrashLoopBackOff state which is unnecessary.
   
   > we need to just check whether the MYSQL server (remote server) is up and running. 
   
   Understod, and I think that's a great idea!
   
   > By using busybox image we can achieve that easily (from the bash command). 
   
   `nc` just makes sure there's a connection on the port. 
   
   `mysqladmin ping` may do more? I' haven't checked. It should make sure server is really up. 
   
   `mysqladmin status` maybe better.
   
   > mysql:5.7 image will need some extra configurations to establish the connection and listen to a remote server.(setting up credentials etc.. which is unnecessary) 
   
   It shouldn't, hopefully just `-h fineractmysql` should suffice? (But I haven't tested it myself.)
   
   But you know how the saying "done is better than perfect"? 
   
   I'll merge this anyway, and leave it up to you if you want to improve it in a follow-up PR, or leave it as is, that's fine too; it's not super important.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] BLasan edited a comment on pull request #1584: Add init-container to check MYSQL server deployment (FINERACT-1300)

Posted by GitBox <gi...@apache.org>.
BLasan edited a comment on pull request #1584:
URL: https://github.com/apache/fineract/pull/1584#issuecomment-763489509


   @xurror @vorburger SIr Please review


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org