Skip to content

Milestone 2

Roja Raman edited this page Mar 28, 2019 · 7 revisions

Task accomplished

  • Deployment on JetStream open stack machines.
  • Design revamped in UI.
  • CI/CD using Jenkins (Master-slave configuration).
  • Zookeeper.
  • Improvements in Microservices.

Deployment on JetStream open stack machines

  • We have 6 centos small VM images from Jetstream.
  • One single network manages communication between 3 microservices and front end, another network manages Jenkins master-slave communication and one extra network manages communication among Zookeeper ensemble.
  • The 6 centos(rhel) machine IP are enumerated below:
    • Rhino 149.165.168.167 - Front end.
    • Purple 149.165.169.31 - Gateway microservice.
    • Red 149.165.169.159 - Profile management microservice.
    • Blue 149.165.168.77 - Search analysis microservice.
    • Zookeeper 149.165.170.230.
    • Jenkins Master 149.165.156.79.

Design improvements in UI

  • The UI now as manual login and signup integrated.
  • Several layout bug fixes.
  • The doctor search pagination has bug fixes.
  • The doctor entity has a profile popup.
  • A popup created to view practice locations of a doctor.
  • Search History shows the frequently searched word. A number is displayed in the badge above each words indicating the number of times it has been searched by the current user.
  • The location finder API is changed to more accurate and reliable 3rd party API.

CI/CD using Jenkins (Master-slave configuration).

  • A master Jenkins is installed at 149.165.156.79:8080.
  • There are 4 slaves located at :
    • Rhino 149.165.168.167:4200 - Front end.
    • Purple 149.165.169.31:3000 - Gateway microservice.
    • Red 149.165.169.159:8080 - Profile management microservice.
    • Blue 149.165.168.77:7000 - Search analysis microservice.
  • When a git push is done, the master builds the code of the corresponding branch and deploys at corresponding slave machines.
  • There are 4 jobs that listen to a GitHub web-hook message, the web-hook dictates the build process of jobs.

Zookeeper

  • The Zookeeper standalone runs on 149.165.170.230.
  • The 3 micro-services register themselves on ephemeral_sequential znodes of the zookeeper server ensemble.
  • The zookeeper ensemble receives regular heartbeats from microservices.
  • The process of registration is enumerated below:
    • The Purple micro service uses Racker Zookeeper client that creates an ephemeral_sequential node when it connects to the zookeeper. The client can be given an array of multiple zookeeper servers in the ensemble when one of the zookeeper servers in the ensemble goes down, the client connects to another server randomly and creates an ephemeral_Sequential node on it.
    • The blue micro service uses python kazoo zookeeper client to connect to the zookeeper ensemble.
    • The red micro service uses official java Apache Zookeeper client to connect to the zookeeper ensemble.

Improvements in Microservices

  • Externalized ports and zookeeper configuration for Red, Blue and Purple micro services.
  • The microservices now have a zookeeper client service running in parallel to main endpoint service.
  • Replaced PostgreSQL and MySQL with H2 distributed Database integration, this avoids the hassle of installing database servers on machines.
  • Blue micro service now communicates with database instead of files.
  • Resolved CORS issue in Red, Blue microservice
  • Improved Databases tables in Red microservice.
  • Improved command line args parsing in Purple, Blue microservice.

Project instructions

  • Log in to Jenkins system 149.165.156.79:8080 with credentials jenkins_restricted/jenkins_restricted
  • There are jobs and pipelines listed, you can run these at your will.
  • Insert a dummy commit in the following branches to see the Jenkins jobs build.

Rhino front - end branch

Branch URL: https://github.com/airavata-courses/MayDay/tree/develop-client-rhino

Jenkins job: http://149.165.156.79:8080/job/rhino/

Test URL: http://js-168-167.jetstream-cloud.org:4200/

Pipeline Url: http://149.165.156.79:8080/job/deploy_pipeline/

Purple Gateway microservice branch

Branch URL: https://github.com/airavata-courses/MayDay/tree/develop-microservice-purple

Jenkins job: http://149.165.156.79:8080/job/purple/

Test URL: http://149.165.169.31:3000/test

Pipeline Url: http://149.165.156.79:8080/job/deploy_pipeline/

Red Profile management microservice branch

Branch URL: https://github.com/airavata-courses/MayDay/tree/develop-microservice-red

Jenkins job: http://149.165.156.79:8080/job/red/

Test URL: http://149.165.169.159:8080/

Pipeline Url: http://149.165.156.79:8080/job/deploy_pipeline/

Blue Search Analysis microservice branch

Branch URL: https://github.com/airavata-courses/MayDay/tree/develop-microservice-blue

Jenkins job: http://149.165.156.79:8080/job/blue/

Test URL: http://149.165.168.77:7000/test

Pipeline Url: http://149.165.156.79:8080/job/deploy_pipeline/

Known issues

  • Advanced search doesn't work.
  • Redeploy cleans up user database.

Challenges faced heading towards Milestone 2

  • Jenkins master-slave configuration was difficult to do because of ssh connection problems, the public, and private key configuration was meticulously done to achieve this task.
  • Jet-stream instance networking took a while to get a hang of.
  • There were quota exceeded issues but we solved it by raising tickets to jet-stream admin.
  • We faced Cross-Origin Request Denial by our microservices, which we fixed by doing much research.
  • The location resolver API in the front end was not accurate and needed user permission, so had to resort to a more accurate but paid 3rd party API for that.
  • We had database installation and permission issues when we used MySQL and PostgreSQL, we migrated to H2 distributed database that is just a jar file, which can be distributed.
  • Zookeeper integration was very challenging, after going through a lot of documentation and tutorials, we set up zookeeper ensemble but then again needed to change the micro-services implementation so that they could support service discovery and registration.
  • Jenkins kills the jobs after build process is finished, so had to do a little hack so that the process keeps running in the background.

TODO for future Milestones

  • Use Kubernetes for fault tolerance and load balancing.
  • Move all 3rd party API to route from Purple micro service gateway.
  • Improve design inconsistencies in Rhino front end.
  • Borrow 4 more instances from jet-stream to build a production server ensemble.
  • Write unit tests and integrate them with a unit testing framework.