Project Milestone 2 - airavata-courses/ABC GitHub Wiki

Welcome to the ABC wiki!

You can access the app here http://149.165.169.38:3000/login

Initial concept (Napkin diagram):

napkin diagram

Architecture:

architecture

User Story:

  1. User will be able to create Tweets once logged in
  2. One will be able to search for other users and follow them
  3. Tweets will appear in the feed based on the users they follow.
  4. Current news trends will be displayed to user

Improvements from Project - 1:

  • Consul: In this project, we have implemented the service discovery with HashiCorp Consul. There is one master server and all of the consul clients will join the master node to create a cluster.

  • API Gateway: An API gateway has been implemeneted as a single point of entry to all the services to ensure service discovery via consul clients.

  • Email Service: This is the new service based on NodeJS which emails user whenever there is a new registration on the system

  • CI/CD: We've used Jenkins for CI/CD. Whenever there is commit to a specific branch the microservice on that branch will be built and deployed over Jetstream VM's.

Walkthrough:

  • Login into Jenkins URL. Please contact us for login details.

  • All of the branches represent a specific microservices and will be deployed to the respective virtual machines on a commit.

  • Test the CI/CD: In order to test the continuous integration and continuous deployment, you can do the following:

    1. Create dummy commit on a branch and a build will be triggered on Jenkins. Please perform the following steps to post a dummy commit
      1. git clone https://github.com/airavata-courses/ABC.git
      2. git checkout <branch_name>
      3. git pull
      4. Now you should be able to create a dummy commit and push on that branch.

    NOTE Please do not commit anything on master. It will not trigger anything.

    1. Go to Jenkins and click 'Build Now' for either of the develop-* jobs.
    2. In order to deploy all the microservices at once, please click Build Now for ABC-build-deploy job.

Challenges faced:

  1. During the start of the semester, we had setup everything on the CentOS. We ran into DNS errors during Consul interaction and because of this, we were unable to discover registered services. To solve this, we had to move our entire setup on Ubuntu.
  2. For the first milestone, all of the microservices were directly accessed directly via react. Consul services can be accessed with http://<service_name>.service.consul. For the service discovery, only consul agents can discover services using the mentioned url format. If consul URL is directly accessed with UI, it will error to Err_Name_Not_Resolved Error. To solve this, we introduced an API gateway which will run on a consul agent and thus providing service discovery.