This repository helps with setting up Piggyback Incentives for a developer on their local machine.
- Docker Desktop
- IntelliJ/Eclipse IDE - for Java Microservices
- Visual Studio Code - for React.JS Partner Portal
- Android Studio (and mobile SDKs) - for the Android mobile app.
- Mac - for the iOS app.
- Git
NOTE:
- Local machine setup does not support https.
- This project runs Kafka and Zookeeper. It is recommended to allocate at least 8 GB RAM to Docker Desktop.
Steps:
-
Clone this git repository to your local machine.
-
Run the command in piggyback-dev-runner/scripts/git_pull.txt
-
Comment out the nginx and certbot services from docker-compose yml.
-
Under piggyback-dev-runner folder, on a command line -
docker-compose up -d
This will start up all the microservices, databases and web interfaces in their respective docker containers. It may take a few minutes for the applications inside containers to finish initialization.
docker-compose down
This will stop and remove all containers started in the previous step.
For Java microservices, production docker images are built and pushed to GCR when a pull request is merged to develop. In order to ensure changes are deployed through the CD pipeline, please increment the tag for the production image in 4 files, as follows -
In Makefile_prod and Makefile_canary -
IMAGE_VERSION:=v5
In k8s/canary/-deployment.yaml and k8s/production/-deployment.yaml
containers:
- image: gcr.io/absolute-text-251105/piggy1-user:v5
NOTE: Do not merge pull requests to develop and master without incrementing the tag at all 4 positions, else changes will not be deployed to production.
scripts/LocationService.jmx can be imported to JMeter to perform load testing on Production instances of Location Service and test Kubernetes auto-scaling.
In order to setup nginx and certbot services as a https to http reverse proxy, follow the below steps:
Pre-requisites: Ensure you own a domain name, with CNAME and NS registered properly and mapped to your Dev VM's public IP address correctly. Scripts in this repository refer to test.piggyback.ga
Steps:
- Ensure all other services and databases are started.
- Run the following command: sudo ./init-letsencrypt.sh
The repository contains definition files for setting up all components in a kubernetes cluster in k8s/ folder. HTTPS setup can be performed using NGINX Ingress. The below URL can be refered to for high-level instructions to perform the setup.
https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nginx-ingress-with-cert-manager-on-digitalocean-kubernetes