• Stars
    star
    15,783
  • Rank 1,725 (Top 0.04 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created almost 6 years ago
  • Updated 11 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Sample cloud-first application with 10 microservices showcasing Kubernetes, Istio, and gRPC.

Online Boutique

Continuous Integration

Online Boutique is a cloud-first microservices demo application. Online Boutique consists of an 11-tier microservices application. The application is a web-based e-commerce app where users can browse items, add them to the cart, and purchase them.

Google uses this application to demonstrate the use of technologies like Kubernetes, GKE, Istio, Stackdriver, and gRPC. This application works on any Kubernetes cluster, like Google Kubernetes Engine (GKE). It’s easy to deploy with little to no configuration.

If you’re using this demo, please β˜…Star this repository to show your interest!

Note to Googlers (Google employees): Please fill out the form at go/microservices-demo.

Screenshots

Home Page Checkout Screen
Screenshot of store homepage Screenshot of checkout screen

Interactive quickstart (GKE)

Open in Cloud Shell

Quickstart (GKE)

  1. Ensure you have the following requirements:

  2. Clone the repository.

    git clone https://github.com/GoogleCloudPlatform/microservices-demo
    cd microservices-demo/
  3. Set the Google Cloud project and region and ensure the Google Kubernetes Engine API is enabled.

    export PROJECT_ID=<PROJECT_ID>
    export REGION=us-central1
    gcloud services enable container.googleapis.com \
      --project=${PROJECT_ID}

    Substitute <PROJECT_ID> with the ID of your Google Cloud project.

  4. Create a GKE cluster and get the credentials for it.

    gcloud container clusters create-auto online-boutique \
      --project=${PROJECT_ID} --region=${REGION}

    Creating the cluster may take a few minutes.

  5. Deploy Online Boutique to the cluster.

    kubectl apply -f ./release/kubernetes-manifests.yaml
  6. Wait for the pods to be ready.

    kubectl get pods

    After a few minutes, you should see the Pods in a Running state:

    NAME                                     READY   STATUS    RESTARTS   AGE
    adservice-76bdd69666-ckc5j               1/1     Running   0          2m58s
    cartservice-66d497c6b7-dp5jr             1/1     Running   0          2m59s
    checkoutservice-666c784bd6-4jd22         1/1     Running   0          3m1s
    currencyservice-5d5d496984-4jmd7         1/1     Running   0          2m59s
    emailservice-667457d9d6-75jcq            1/1     Running   0          3m2s
    frontend-6b8d69b9fb-wjqdg                1/1     Running   0          3m1s
    loadgenerator-665b5cd444-gwqdq           1/1     Running   0          3m
    paymentservice-68596d6dd6-bf6bv          1/1     Running   0          3m
    productcatalogservice-557d474574-888kr   1/1     Running   0          3m
    recommendationservice-69c56b74d4-7z8r5   1/1     Running   0          3m1s
    redis-cart-5f59546cdd-5jnqf              1/1     Running   0          2m58s
    shippingservice-6ccc89f8fd-v686r         1/1     Running   0          2m58s
    
  7. Access the web frontend in a browser using the frontend's external IP.

    kubectl get service frontend-external | awk '{print $4}'

    Visit http://EXTERNAL_IP in a web browser to access your instance of Online Boutique.

  8. Once you are done with it, delete the GKE cluster.

    gcloud container clusters delete online-boutique \
      --project=${PROJECT_ID} --region=${REGION}

    Deleting the cluster may take a few minutes.

Use Terraform to provision a GKE cluster and deploy Online Boutique

The /terraform folder contains instructions for using Terraform to replicate the steps from Quickstart (GKE) above.

Other deployment variations

Deploy Online Boutique variations with Kustomize

The /kustomize folder contains instructions for customizing the deployment of Online Boutique with different variations such as:

Architecture

Online Boutique is composed of 11 microservices written in different languages that talk to each other over gRPC.

Architecture of microservices

Find Protocol Buffers Descriptions at the ./protos directory.

Service Language Description
frontend Go Exposes an HTTP server to serve the website. Does not require signup/login and generates session IDs for all users automatically.
cartservice C# Stores the items in the user's shopping cart in Redis and retrieves it.
productcatalogservice Go Provides the list of products from a JSON file and ability to search products and get individual products.
currencyservice Node.js Converts one money amount to another currency. Uses real values fetched from European Central Bank. It's the highest QPS service.
paymentservice Node.js Charges the given credit card info (mock) with the given amount and returns a transaction ID.
shippingservice Go Gives shipping cost estimates based on the shopping cart. Ships items to the given address (mock)
emailservice Python Sends users an order confirmation email (mock).
checkoutservice Go Retrieves user cart, prepares order and orchestrates the payment, shipping and the email notification.
recommendationservice Python Recommends other products based on what's given in the cart.
adservice Java Provides text ads based on given context words.
loadgenerator Python/Locust Continuously sends requests imitating realistic user shopping flows to the frontend.

Features

  • Kubernetes/GKE: The app is designed to run on Kubernetes (both locally on "Docker for Desktop", as well as on the cloud with GKE).
  • gRPC: Microservices use a high volume of gRPC calls to communicate to each other.
  • Istio: Application works on Istio service mesh.
  • Cloud Operations (Stackdriver): Many services are instrumented with Profiling and Tracing. In addition to these, using Istio enables features like Request/Response Metrics and Context Graph out of the box. When it is running out of Google Cloud, this code path remains inactive.
  • Skaffold: Application is deployed to Kubernetes with a single command using Skaffold.
  • Synthetic Load Generation: The application demo comes with a background job that creates realistic usage patterns on the website using Locust load generator.

Development

See the Development guide to learn how to run and develop this app locally.

Demos featuring Online Boutique


This is not an official Google project.

More Repositories

1

terraformer

CLI tool to generate terraform files from existing infrastructure (reverse Terraform). Infrastructure to Code
Go
11,610
star
2

training-data-analyst

Labs and demos for courses for GCP Training (http://cloud.google.com/training).
Jupyter Notebook
7,479
star
3

python-docs-samples

Code samples used on cloud.google.com
Jupyter Notebook
6,985
star
4

generative-ai

Sample code and notebooks for Generative AI on Google Cloud
Jupyter Notebook
5,282
star
5

golang-samples

Sample apps and code written for Google Cloud in the Go programming language.
Go
4,136
star
6

nodejs-docs-samples

Node.js samples for Google Cloud Platform products.
JavaScript
2,762
star
7

tensorflow-without-a-phd

A crash course in six episodes for software developers who want to become machine learning practitioners.
Jupyter Notebook
2,735
star
8

professional-services

Common solutions and tools developed by Google Cloud's Professional Services team. This repository and its contents are not an officially supported Google product.
Python
2,730
star
9

gcsfuse

A user-space file system for interacting with Google Cloud Storage
Go
1,977
star
10

community

Java
1,908
star
11

PerfKitBenchmarker

PerfKit Benchmarker (PKB) contains a set of benchmarks to measure and compare cloud offerings. The benchmarks use default settings to reflect what most users will see. PerfKit Benchmarker is licensed under the Apache 2 license terms. Please make sure to read, understand and agree to the terms of the LICENSE and CONTRIBUTING files before proceeding.
Python
1,855
star
12

java-docs-samples

Java and Kotlin Code samples used on cloud.google.com
Java
1,610
star
13

ml-design-patterns

Source code accompanying O'Reilly book: Machine Learning Design Patterns
Jupyter Notebook
1,600
star
14

continuous-deployment-on-kubernetes

Get up and running with Jenkins on Google Kubernetes Engine
Shell
1,582
star
15

cloudml-samples

Cloud ML Engine repo. Please visit the new Vertex AI samples repo at https://github.com/GoogleCloudPlatform/vertex-ai-samples
Python
1,507
star
16

asl-ml-immersion

This repos contains notebooks for the Advanced Solutions Lab: ML Immersion
Jupyter Notebook
1,469
star
17

localllm

Python
1,449
star
18

cloud-builders

Builder images and examples commonly used for Google Cloud Build
Go
1,354
star
19

cloud-foundation-fabric

End-to-end modular samples and landing zones toolkit for Terraform on GCP.
HCL
1,343
star
20

vertex-ai-samples

Sample code and notebooks for Vertex AI, the end-to-end machine learning platform on Google Cloud
Jupyter Notebook
1,331
star
21

cloud-builders-community

Community-contributed images for Google Cloud Build
Go
1,233
star
22

data-science-on-gcp

Source code accompanying book: Data Science on the Google Cloud Platform, Valliappa Lakshmanan, O'Reilly 2017
Jupyter Notebook
1,230
star
23

berglas

A tool for managing secrets on Google Cloud
Go
1,223
star
24

cloud-sql-proxy

A utility for connecting securely to your Cloud SQL instances
Go
1,218
star
25

kubernetes-engine-samples

Sample applications for Google Kubernetes Engine (GKE)
HCL
1,178
star
26

functions-framework-nodejs

FaaS (Function as a service) framework for writing portable Node.js functions
TypeScript
1,162
star
27

cloud-vision

Sample code for Google Cloud Vision
Python
1,093
star
28

DataflowTemplates

Cloud Dataflow Google-provided templates for solving in-Cloud data tasks
Java
1,078
star
29

bigquery-utils

Useful scripts, udfs, views, and other utilities for migration and data warehouse operations in BigQuery.
Java
1,030
star
30

php-docs-samples

A collection of samples that demonstrate how to call Google Cloud services from PHP.
PHP
944
star
31

buildpacks

Builders and buildpacks designed to run on Google Cloud's container platforms
Go
937
star
32

deploymentmanager-samples

Deployment Manager samples and templates.
Jinja
928
star
33

bank-of-anthos

Retail banking sample application showcasing Kubernetes and Google Cloud
Java
926
star
34

cloud-foundation-toolkit

The Cloud Foundation toolkit provides GCP best practices as code.
Go
916
star
35

flask-talisman

HTTP security headers for Flask
Python
896
star
36

DataflowJavaSDK

Google Cloud Dataflow provides a simple, powerful model for building both batch and streaming parallel data processing pipelines.
857
star
37

gsutil

A command line tool for interacting with cloud storage services.
Python
857
star
38

k8s-config-connector

GCP Config Connector, a Kubernetes add-on for managing GCP resources
Go
826
star
39

nodejs-getting-started

A tutorial for creating a complete application using Node.js on Google Cloud Platform
JavaScript
800
star
40

keras-idiomatic-programmer

Books, Presentations, Workshops, Notebook Labs, and Model Zoo for Software Engineers and Data Scientists wanting to learn the TF.Keras Machine Learning framework
Jupyter Notebook
797
star
41

gcr-cleaner

Delete untagged image refs in Google Container Registry or Artifact Registry
Go
795
star
42

metacontroller

Lightweight Kubernetes controllers as a service
Go
790
star
43

getting-started-python

Code samples for using Python on Google Cloud Platform
Python
756
star
44

magic-modules

Add Google Cloud Platform support to Terraform
HTML
753
star
45

awesome-google-cloud

A curated list of awesome stuff for Google Cloud.
742
star
46

mlops-on-gcp

Jupyter Notebook
728
star
47

dotnet-docs-samples

.NET code samples used on https://cloud.google.com
C#
719
star
48

click-to-deploy

Source for Google Click to Deploy solutions listed on Google Cloud Marketplace.
Ruby
709
star
49

cloud-sdk-docker

Google Cloud CLI Docker Image - Docker Image containing the gcloud CLI and its bundled components.
Dockerfile
697
star
50

iap-desktop

IAP Desktop is a Windows application that provides zero-trust Remote Desktop and SSH access to Linux and Windows VMs on Google Cloud.
C#
687
star
51

tf-estimator-tutorials

This repository includes tutorials on how to use the TensorFlow estimator APIs to perform various ML tasks, in a systematic and standardised way
Jupyter Notebook
671
star
52

functions-framework-python

FaaS (Function as a service) framework for writing portable Python functions
Python
670
star
53

flink-on-k8s-operator

[DEPRECATED] Kubernetes operator for managing the lifecycle of Apache Flink and Beam applications.
Go
659
star
54

terraform-google-examples

Collection of examples for using Terraform with Google Cloud Platform.
HCL
573
star
55

functions-framework-dart

FaaS (Function as a service) framework for writing portable Dart functions
Dart
531
star
56

cloud-run-button

Let anyone deploy your GitHub repos to Google Cloud Run with a single click
Go
520
star
57

govanityurls

Use a custom domain in your Go import path
Go
513
star
58

bigquery-oreilly-book

Source code accompanying: BigQuery: The Definitive Guide by Lakshmanan & Tigani to be published by O'Reilly Media
Jupyter Notebook
499
star
59

getting-started-java

Java
478
star
60

ml-on-gcp

Machine Learning on Google Cloud Platform
Python
476
star
61

ipython-soccer-predictions

Sample iPython notebook with soccer predictions
Jupyter Notebook
473
star
62

covid-19-open-data

Datasets of daily time-series data related to COVID-19 for over 20,000 distinct locations around the world.
Python
470
star
63

ai-platform-samples

Official Repo for Google Cloud AI Platform. Find samples for Vertex AI, Google Cloud's new unified ML platform at: https://github.com/GoogleCloudPlatform/vertex-ai-samples
Jupyter Notebook
453
star
64

practical-ml-vision-book

Jupyter Notebook
441
star
65

gradle-appengine-templates

Freemarker based templates that build with the gradle-appengine-plugin
439
star
66

distributed-load-testing-using-kubernetes

Distributed load testing using Kubernetes on Google Container Engine
Smarty
438
star
67

terraform-validator

Terraform Validator is not an officially supported Google product; it is a library for conversion of Terraform plan data to CAI Assets. If you have been using terraform-validator directly in the past, we recommend migrating to `gcloud beta terraform vet`.
Go
436
star
68

hackathon-toolkit

GCP Hackathon Toolkit
HTML
434
star
69

monitoring-dashboard-samples

TypeScript
428
star
70

nodejs-docker

The Node.js Docker image used by Google App Engine Flexible.
TypeScript
406
star
71

cloud-ops-sandbox

Cloud Operations Sandbox is an open source collection of tools that helps practitioners to learn O11y and R9y practices from Google and apply them using Cloud Operations suite of tools.
HCL
398
star
72

cloud-code-vscode

Cloud Code for Visual Studio Code: Issues, Documentation and more
392
star
73

k8s-stackdriver

Go
390
star
74

professional-services-data-validator

Utility to compare data between homogeneous or heterogeneous environments to ensure source and target tables match
Python
375
star
75

cloud-code-samples

Code templates to make working with Kubernetes feel like editing and debugging local code.
Java
374
star
76

require-so-slow

`require`s taking too much time? Profile 'em.
TypeScript
373
star
77

functions-framework-go

FaaS (Function as a service) framework for writing portable Go functions
Go
373
star
78

k8s-multicluster-ingress

kubemci: Command line tool to configure L7 load balancers using multiple kubernetes clusters
Go
372
star
79

compute-image-packages

Packages for Google Compute Engine Linux images.
Python
370
star
80

healthcare

Python
367
star
81

android-docs-samples

Java
365
star
82

stackdriver-errors-js

Client-side JavaScript exception reporting library for Cloud Error Reporting
JavaScript
358
star
83

google-cloud-iot-arduino

Google Cloud IOT Example on ESP8266
C++
340
star
84

istio-samples

Istio demos and sample applications for GCP
Shell
331
star
85

ios-docs-samples

iOS samples that demonstrate APIs and services of Google Cloud Platform.
Swift
325
star
86

mlops-with-vertex-ai

An end-to-end example of MLOps on Google Cloud using TensorFlow, TFX, and Vertex AI
Jupyter Notebook
317
star
87

cloud-code-intellij

Plugin to support the Google Cloud Platform in IntelliJ IDEA - Docs and Issues Repository
315
star
88

gcping

The source for the CLI and web app at gcping.com
Go
303
star
89

spring-cloud-gcp

New home for Spring Cloud GCP development starting with version 2.0.
Java
299
star
90

airflow-operator

Kubernetes custom controller and CRDs to managing Airflow
Go
296
star
91

security-analytics

Community Security Analytics provides a set of community-driven audit & threat queries for Google Cloud
Python
289
star
92

elixir-samples

A collection of samples on using Elixir with Google Cloud Platform.
Elixir
289
star
93

gke-networking-recipes

Shell
286
star
94

datalab-samples

Jupyter Notebook
281
star
95

compute-archlinux-image-builder

A tool to build a Arch Linux Image for GCE
Shell
280
star
96

solutions-terraform-cloudbuild-gitops

HCL
276
star
97

kotlin-samples

Kotlin
276
star
98

gcpdiag

gcpdiag is a command-line diagnostics tool for GCP customers.
Python
268
star
99

PerfKitExplorer

PerfKit Explorer is a dashboarding and performance analysis tool built with Google technologies and easily extensible. PerfKit Explorer is licensed under the Apache 2 license terms. Please make sure to read, understand and agree to the terms of the LICENSE and CONTRIBUTING files before proceeding.
JavaScript
268
star
100

kube-jenkins-imager

Shell
261
star