{"id":13487919,"url":"https://github.com/kbhattac/coolretailer","last_synced_at":"2025-03-27T23:32:10.473Z","repository":{"id":31396985,"uuid":"164625924","full_name":"kbhattac/coolretailer","owner":"kbhattac","description":"Microservices with Istio, gRPC, Redis, BigQuery, Spring Boot, Spring Cloud and Stackdriver","archived":false,"fork":false,"pushed_at":"2023-07-07T09:45:01.000Z","size":2570,"stargazers_count":44,"open_issues_count":1,"forks_count":16,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-30T23:36:12.899Z","etag":null,"topics":["bigquery","google-cloud","google-kubernetes-engine","grafana","grpc","istio","kiali","locust","microservices","redis","spring-boot","spring-cloud","zipkin"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kbhattac.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-01-08T10:37:43.000Z","updated_at":"2023-05-07T10:37:02.000Z","dependencies_parsed_at":"2024-01-16T09:02:22.953Z","dependency_job_id":"10030c7b-6c46-480d-8645-88ec4449397a","html_url":"https://github.com/kbhattac/coolretailer","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kbhattac%2Fcoolretailer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kbhattac%2Fcoolretailer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kbhattac%2Fcoolretailer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kbhattac%2Fcoolretailer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kbhattac","download_url":"https://codeload.github.com/kbhattac/coolretailer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245944020,"owners_count":20697945,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bigquery","google-cloud","google-kubernetes-engine","grafana","grpc","istio","kiali","locust","microservices","redis","spring-boot","spring-cloud","zipkin"],"created_at":"2024-07-31T18:01:06.464Z","updated_at":"2025-03-27T23:32:05.420Z","avatar_url":"https://github.com/kbhattac.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"[![Coverage Status](https://coveralls.io/repos/github/kbhattac/CoolRetailer/badge.svg?branch=master)](https://coveralls.io/github/kbhattac/CoolRetailer?branch=master) [![Build Status](https://travis-ci.org/kbhattac/coolretailer.svg?branch=master)](https://travis-ci.org/kbhattac/coolretailer) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n# CoolRetailer\n### Microservices application with Istio, gRPC, Redis, BigQuery, Spring Boot, Spring Cloud and Stackdriver\n- Smart product finder with autocomplete feature\n- Distributed Stackdriver Tracing with Log correlation across gRPC calls\n- Istio based Stackdriver Service Monitoring\n- Automatic synthetic load generation with [Locust](locust.io)\n- Complete CI/CD to GKE with Google Cloud Build\n- Redis in Master/Slave replication mode (image from Bitnami)\n- Autocomplete logic based on [ZRANGEBYLEX](https://redis.io/commands/zrangebylex) Redis command\n- Tunable cache size\n- Dataset from BestBuy (converted to ndjson using `JsonProcessor`)\n- Developed completely with [VSCode](https://code.visualstudio.com/)\n- Inspired by [Next '18 Microservices Demo](https://github.com/GoogleCloudPlatform/microservices-demo)\n- Covering slides on [Slideshare](https://www.slideshare.net/KaushikBhattacharya/devops-sre-at-google-scale)\n\n### Architecture:\n![Architecture](https://github.com/kbhattac/CoolRetailer/blob/master/images/arch.png)\n\n### Automatic Installation:\n[![Open in Cloud Shell](http://gstatic.com/cloudssh/images/open-btn.svg)](https://console.cloud.google.com/cloudshell/editor?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fkbhattac%2Fcoolretailer\u0026cloudshell_working_dir=setup\u0026cloudshell_tutorial=README.md)\n\nGuided one click installation from Google Cloud Shell. Complete stack (incl. all dashboards shown below + Istio fault simulation). No client tooling required.\n\n\n### Manual Installation:\n- Get the [Best Buy](https://github.com/BestBuyAPIs/open-data-set/blob/master/products.json) products dataset and save it to a GCS bucket: \n- BQ requires the JSON to be new line delimited. Use the provided utility JSON processor for this:\n```\njava -jar src/queryservice/target/queryservice-1.0.0.jar \\\n    --spring.profiles.active=JSON \\\n    --input.json=\"$PWD\"/products.json --exit\n```\n- Load it to BQ as dataset \u003ccode\u003ecoolretailer.products\u003c/code\u003e from GCS\n- Create a GCP service account with the following roles:\n\n`BigQuery Data Viewer`, `BigQuery Job User`, `Stackdriver Debugger Agent`, `Cloud Trace Agent`, `Context Graph Asserter`, `Error Reporting Admin`, `Logs Writer`, `Monitoring Metric Writer`\n\nand install the private key as app-gac.json as kubernetes secret app-gac.\n- apply Istio manifests in: `setup/istio-manifests`\n- set `PROJECT_ID`, `TAG_NAME`, `REDIS_HOST` in `setup/kubernetes-manifests/` and apply them\n\n### Notes:\n- Spring Cloud Sleuth Stackdriver Trace and Logging enabled.\n- Complete CI/CD pipeline with Google Cloud Build.\n- Test locally using:\n```\n$mvn spring-boot:run \\\n    -DGOOGLE_APPLICATION_CREDENTIALS=path-to-key-file \\\n    -DPROJECT_ID=coolretailer \\\n    -DGOOGLE_CLOUD_PROJECT=coolretailer \\\n    -Dspring-boot.run.arguments=--spring.redis.host=localhost\n```\n- Using docker from Cloud Shell:\n\n(If tunneling to the redis service is required)\n```\ngcloud container clusters get-credentials coolretailer2 --zone europe-west4-a --project coolretailer \\\n \u0026\u0026 kubectl port-forward $(kubectl get pod --selector=\"app=redis-master,role=master,tier=backend\" --output jsonpath='{.items[0].metadata.name}') 6379:6379\n\ngcloud auth configure-docker -q \u0026\u0026\\\ndocker run \\\n    --network=host \\\n    -v /home/kbhattacharya:/etc/app-gac \\\n    -e GOOGLE_CLOUD_PROJECT=coolretailer \\\n    -e PROJECT_ID=coolretailer \\\n    -e GOOGLE_APPLICATION_CREDENTIALS=/etc/app-gac/app-gac.json \\\n    -e --spring.sleuth.sampler.probability=1.0 \\\n    -e --spring.application.name=ux-local \\\n    -e --spring.cloud.gcp.trace.enabled=true \\\n    -e --spring.cloud.gcp.logging.enabled=true \\\n    -e --spring.cloud.gcp.project-id=coolretailer \\\n    -it gcr.io/coolretailer/queryservice\n```\n- Use [Cloud Memorystore](https://cloud.google.com/memorystore/docs/redis/connect-redis-instance-gke) instead of the Redis deployments (src/setup/kubernetes-manifests/archive/redis): \n- [Istio TLS setup](https://istio.io/docs/tasks/traffic-management/secure-ingress/)\n- See setup/istio-manifests/secure for simple TLS configuration\n- The static content is recommended to be served from a GCS bucket with Cloud CDN. Just drop off the content of `src/ui/static/ui.*` and `src/ui/static/lib` in a GCS bucket and provide `allUsers` READER access.\n\n### Screenshots:\n#### Application\n![CoolRetailer](https://github.com/kbhattac/CoolRetailer/blob/master/images/capture.png)\n#### Cloud Trace with Log correlation\n![Trace](https://github.com/kbhattac/CoolRetailer/blob/master/images/trace.png)\n#### Istio fault injection\n![Mesh](https://github.com/kbhattac/CoolRetailer/blob/master/images/mesh.png)\n#### Grafana\n![Grafana](https://github.com/kbhattac/CoolRetailer/blob/master/images/grafana.png)\n#### Istio Service monitoring\n![Istio](https://github.com/kbhattac/CoolRetailer/blob/master/images/istio.png)\n#### Kubernetes CPU telemetry\n![CPU](https://github.com/kbhattac/CoolRetailer/blob/master/images/cpu.png)\n\n### Disclaimer:\nThis is not an official Google product\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkbhattac%2Fcoolretailer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkbhattac%2Fcoolretailer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkbhattac%2Fcoolretailer/lists"}