From 27df445fc20f048c1c31e429f6c29075119fe454 Mon Sep 17 00:00:00 2001 From: askmeegs Date: Tue, 14 May 2019 10:02:35 -0400 Subject: [PATCH 1/5] Release v0.1.1 --- release/istio-manifests.yaml | 15 ---------- release/kubernetes-manifests.yaml | 48 ++++++++++++++++++++++++------- 2 files changed, 37 insertions(+), 26 deletions(-) diff --git a/release/istio-manifests.yaml b/release/istio-manifests.yaml index 284131d..57d669d 100644 --- a/release/istio-manifests.yaml +++ b/release/istio-manifests.yaml @@ -48,21 +48,6 @@ spec: number: 80 --- apiVersion: networking.istio.io/v1alpha3 -kind: ServiceEntry -metadata: - name: currency-provider-external -spec: - hosts: - - www.ecb.europa.eu - ports: - - number: 80 - name: http - protocol: HTTP - - number: 443 - name: https - protocol: HTTPS ---- -apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: frontend diff --git a/release/kubernetes-manifests.yaml b/release/kubernetes-manifests.yaml index 6fd20cd..64c1b10 100644 --- a/release/kubernetes-manifests.yaml +++ b/release/kubernetes-manifests.yaml @@ -32,9 +32,12 @@ spec: terminationGracePeriodSeconds: 5 containers: - name: server - image: gcr.io/google-samples/microservices-demo/emailservice:v0.1.0 + image: gcr.io/google-samples/microservices-demo/emailservice:v0.1.1 ports: - containerPort: 8080 + env: + - name: PORT + value: "8080" readinessProbe: periodSeconds: 5 exec: @@ -43,6 +46,9 @@ spec: periodSeconds: 5 exec: command: ["/bin/grpc_health_probe", "-addr=:8080"] + env: + - name: ENABLE_PROFILER + value: "0" resources: requests: cpu: 100m @@ -79,7 +85,7 @@ spec: spec: containers: - name: server - image: gcr.io/google-samples/microservices-demo/checkoutservice:v0.1.0 + image: gcr.io/google-samples/microservices-demo/checkoutservice:v0.1.1 ports: - containerPort: 5050 readinessProbe: @@ -89,6 +95,8 @@ spec: exec: command: ["/bin/grpc_health_probe", "-addr=:5050"] env: + - name: PORT + value: "5050" - name: PRODUCT_CATALOG_SERVICE_ADDR value: "productcatalogservice:3550" - name: SHIPPING_SERVICE_ADDR @@ -140,7 +148,7 @@ spec: terminationGracePeriodSeconds: 5 containers: - name: server - image: gcr.io/google-samples/microservices-demo/recommendationservice:v0.1.0 + image: gcr.io/google-samples/microservices-demo/recommendationservice:v0.1.1 ports: - containerPort: 8080 readinessProbe: @@ -152,8 +160,12 @@ spec: exec: command: ["/bin/grpc_health_probe", "-addr=:8080"] env: + - name: PORT + value: "8080" - name: PRODUCT_CATALOG_SERVICE_ADDR value: "productcatalogservice:3550" + - name: ENABLE_PROFILER + value: "0" resources: requests: cpu: 100m @@ -190,7 +202,7 @@ spec: spec: containers: - name: server - image: gcr.io/google-samples/microservices-demo/frontend:v0.1.0 + image: gcr.io/google-samples/microservices-demo/frontend:v0.1.1 ports: - containerPort: 8080 readinessProbe: @@ -210,6 +222,8 @@ spec: - name: "Cookie" value: "shop_session-id=x-liveness-probe" env: + - name: PORT + value: "8080" - name: PRODUCT_CATALOG_SERVICE_ADDR value: "productcatalogservice:3550" - name: CURRENCY_SERVICE_ADDR @@ -276,9 +290,12 @@ spec: terminationGracePeriodSeconds: 5 containers: - name: server - image: gcr.io/google-samples/microservices-demo/paymentservice:v0.1.0 + image: gcr.io/google-samples/microservices-demo/paymentservice:v0.1.1 ports: - containerPort: 50051 + env: + - name: PORT + value: "50051" readinessProbe: exec: command: ["/bin/grpc_health_probe", "-addr=:50051"] @@ -322,9 +339,12 @@ spec: terminationGracePeriodSeconds: 5 containers: - name: server - image: gcr.io/google-samples/microservices-demo/productcatalogservice:v0.1.0 + image: gcr.io/google-samples/microservices-demo/productcatalogservice:v0.1.1 ports: - containerPort: 3550 + env: + - name: PORT + value: "3550" readinessProbe: exec: command: ["/bin/grpc_health_probe", "-addr=:3550"] @@ -371,7 +391,7 @@ spec: terminationGracePeriodSeconds: 5 containers: - name: server - image: gcr.io/google-samples/microservices-demo/cartservice:v0.1.0 + image: gcr.io/google-samples/microservices-demo/cartservice:v0.1.1 ports: - containerPort: 7070 env: @@ -440,7 +460,7 @@ spec: value: "frontend:80" containers: - name: main - image: gcr.io/google-samples/microservices-demo/loadgenerator:v0.1.0 + image: gcr.io/google-samples/microservices-demo/loadgenerator:v0.1.1 env: - name: FRONTEND_ADDR value: "frontend:80" @@ -470,10 +490,13 @@ spec: terminationGracePeriodSeconds: 5 containers: - name: server - image: gcr.io/google-samples/microservices-demo/currencyservice:v0.1.0 + image: gcr.io/google-samples/microservices-demo/currencyservice:v0.1.1 ports: - name: grpc containerPort: 7000 + env: + - name: PORT + value: "7000" readinessProbe: exec: command: ["/bin/grpc_health_probe", "-addr=:7000"] @@ -516,9 +539,12 @@ spec: spec: containers: - name: server - image: gcr.io/google-samples/microservices-demo/shippingservice:v0.1.0 + image: gcr.io/google-samples/microservices-demo/shippingservice:v0.1.1 ports: - containerPort: 50051 + env: + - name: PORT + value: "50051" readinessProbe: periodSeconds: 5 exec: @@ -619,7 +645,7 @@ spec: terminationGracePeriodSeconds: 5 containers: - name: server - image: gcr.io/google-samples/microservices-demo/adservice:v0.1.0 + image: gcr.io/google-samples/microservices-demo/adservice:v0.1.1 ports: - containerPort: 9555 env: From ce03eb3c36ae712cd378ad7c3dfc6b059363b8d7 Mon Sep 17 00:00:00 2001 From: Dinesh Nagar Date: Wed, 22 May 2019 13:46:09 +0530 Subject: [PATCH 2/5] removed left-pad module (#218) --- src/currencyservice/client.js | 2 +- src/currencyservice/package.json | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/currencyservice/client.js b/src/currencyservice/client.js index f381dc8..51e7f23 100644 --- a/src/currencyservice/client.js +++ b/src/currencyservice/client.js @@ -46,7 +46,7 @@ const request = { }; function _moneyToString (m) { - return `${m.units}.${leftPad(m.nanos, 9, '0')} ${m.currency_code}`; + return `${m.units}.${m.nanos.toString().padStart(9,'0')} ${m.currency_code}`; } client.getSupportedCurrencies({}, (err, response) => { diff --git a/src/currencyservice/package.json b/src/currencyservice/package.json index 7a21752..3f45984 100644 --- a/src/currencyservice/package.json +++ b/src/currencyservice/package.json @@ -16,7 +16,6 @@ "async": "^1.5.2", "google-protobuf": "^3.0.0", "grpc": "^1.0.0", - "left-pad": "^1.3.0", "pino": "^5.6.2", "request": "^2.87.0", "xml2js": "^0.4.19" From dc98b16a4df81dd4678a3771941f6fe6a73517d3 Mon Sep 17 00:00:00 2001 From: Steven Dake Date: Mon, 27 May 2019 00:35:56 +0200 Subject: [PATCH 3/5] Add a demo of Hipster Shop + Istio across 3 clouds (#219) Hipster Shop was demonstrated in front of rougly 700 individuals at Kubecon EU. The demo itself was shown on 3 cloud providers (Azure, Google, On-prem). The full speaking engagement recording: https://www.youtube.com/watch?v=-t2BfT59zJA --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5d375fb..d59e7e5 100644 --- a/README.md +++ b/README.md @@ -272,6 +272,7 @@ resources. - [Day 3 – Keynote](https://youtu.be/JQPOPV_VH5w?t=815) showing Stackdriver APM (Tracing, Code Search, Profiler, Google Cloud Build) - [Introduction to Service Management with Istio](https://www.youtube.com/watch?v=wCJrdKdD6UM&feature=youtu.be&t=586) +- [KubeCon EU 2019 - Reinventing Networking: A Deep Dive into Istio's Multicluster Gateways - Steve Dake, Independent](https://youtu.be/-t2BfT59zJA?t=982) --- From 1c057fcbd84a838de46d2d9a31269a298f56422e Mon Sep 17 00:00:00 2001 From: Yoshi Yamaguchi <145104+ymotongpoo@users.noreply.github.com> Date: Thu, 13 Jun 2019 15:46:33 +0800 Subject: [PATCH 4/5] aligning function name and log message to the official product name (#229) * log: change log format to JSON payload for better log in Stackdriver change the log format in Go written service from text payload to JSON payload using 3rd party logging library (logrus). https://cloud.google.com/logging/docs/structured-logging https://github.com/sirupsen/logrus/blob/33a1e118e113c7d1dd24a80f80670864cd598519/json_formatter.go#L40-L49 Effected services are frontend, productcatalogservice, checkoutservice, and shippinservice. Also change target container registry and locust scenario for testing. * revert kubernetes manifests to point to the original container registry URLs * revert skaffold.yaml to point to the original registry * loadgenerator: revert locust settings * align all function names and messages to the official product name "Stackdriver" --- .../src/main/java/hipstershop/AdService.java | 4 ++-- src/checkoutservice/main.go | 16 ++++++++-------- src/frontend/main.go | 14 +++++++------- src/productcatalogservice/server.go | 18 +++++++++--------- src/shippingservice/main.go | 18 +++++++++--------- 5 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/adservice/src/main/java/hipstershop/AdService.java b/src/adservice/src/main/java/hipstershop/AdService.java index 3c63c98..4817e1b 100644 --- a/src/adservice/src/main/java/hipstershop/AdService.java +++ b/src/adservice/src/main/java/hipstershop/AdService.java @@ -214,7 +214,7 @@ public final class AdService { } private static void initStackdriver() { - logger.info("Initialize StackDriver"); + logger.info("Initialize Stackdriver"); long sleepTime = 10; /* seconds */ int maxAttempts = 5; @@ -252,7 +252,7 @@ public final class AdService { } } } - logger.info("StackDriver initialization complete."); + logger.info("Stackdriver initialization complete."); } private static void initJaeger() { diff --git a/src/checkoutservice/main.go b/src/checkoutservice/main.go index fdf1c83..42a6783 100644 --- a/src/checkoutservice/main.go +++ b/src/checkoutservice/main.go @@ -131,7 +131,7 @@ func initStats(exporter *stackdriver.Exporter) { } } -func initStackDriverTracing() { +func initStackdriverTracing() { // TODO(ahmetb) this method is duplicated in other microservices using Go // since they are not sharing packages. for i := 1; i <= 3; i++ { @@ -140,22 +140,22 @@ func initStackDriverTracing() { log.Infof("failed to initialize stackdriver exporter: %+v", err) } else { trace.RegisterExporter(exporter) - log.Info("registered stackdriver tracing") + log.Info("registered Stackdriver tracing") // Register the views to collect server stats. initStats(exporter) return } d := time.Second * 10 * time.Duration(i) - log.Infof("sleeping %v to retry initializing stackdriver exporter", d) + log.Infof("sleeping %v to retry initializing Stackdriver exporter", d) time.Sleep(d) } - log.Warn("could not initialize stackdriver exporter after retrying, giving up") + log.Warn("could not initialize Stackdriver exporter after retrying, giving up") } func initTracing() { initJaegerTracing() - initStackDriverTracing() + initStackdriverTracing() } func initProfiling(service, version string) { @@ -170,14 +170,14 @@ func initProfiling(service, version string) { }); err != nil { log.Warnf("failed to start profiler: %+v", err) } else { - log.Info("started stackdriver profiler") + log.Info("started Stackdriver profiler") return } d := time.Second * 10 * time.Duration(i) - log.Infof("sleeping %v to retry initializing stackdriver profiler", d) + log.Infof("sleeping %v to retry initializing Stackdriver profiler", d) time.Sleep(d) } - log.Warn("could not initialize stackdriver profiler after retrying, giving up") + log.Warn("could not initialize Stackdriver profiler after retrying, giving up") } func mustMapEnv(target *string, envKey string) { diff --git a/src/frontend/main.go b/src/frontend/main.go index a6bccda..5ba9577 100644 --- a/src/frontend/main.go +++ b/src/frontend/main.go @@ -191,20 +191,20 @@ func initStackdriverTracing(log logrus.FieldLogger) { // log.Warnf is used since there are multiple backends (stackdriver & jaeger) // to store the traces. In production setup most likely you would use only one backend. // In that case you should use log.Fatalf. - log.Warnf("failed to initialize stackdriver exporter: %+v", err) + log.Warnf("failed to initialize Stackdriver exporter: %+v", err) } else { trace.RegisterExporter(exporter) - log.Info("registered stackdriver tracing") + log.Info("registered Stackdriver tracing") // Register the views to collect server stats. initStats(log, exporter) return } d := time.Second * 20 * time.Duration(i) - log.Debugf("sleeping %v to retry initializing stackdriver exporter", d) + log.Debugf("sleeping %v to retry initializing Stackdriver exporter", d) time.Sleep(d) } - log.Warn("could not initialize stackdriver exporter after retrying, giving up") + log.Warn("could not initialize Stackdriver exporter after retrying, giving up") } func initTracing(log logrus.FieldLogger) { @@ -232,14 +232,14 @@ func initProfiling(log logrus.FieldLogger, service, version string) { }); err != nil { log.Warnf("warn: failed to start profiler: %+v", err) } else { - log.Info("started stackdriver profiler") + log.Info("started Stackdriver profiler") return } d := time.Second * 10 * time.Duration(i) - log.Debugf("sleeping %v to retry initializing stackdriver profiler", d) + log.Debugf("sleeping %v to retry initializing Stackdriver profiler", d) time.Sleep(d) } - log.Warn("warning: could not initialize stackdriver profiler after retrying, giving up") + log.Warn("warning: could not initialize Stackdriver profiler after retrying, giving up") } func mustMapEnv(target *string, envKey string) { diff --git a/src/productcatalogservice/server.go b/src/productcatalogservice/server.go index 60b0f3a..c76eafc 100644 --- a/src/productcatalogservice/server.go +++ b/src/productcatalogservice/server.go @@ -158,32 +158,32 @@ func initStats(exporter *stackdriver.Exporter) { } } -func initStackDriverTracing() { +func initStackdriverTracing() { // TODO(ahmetb) this method is duplicated in other microservices using Go // since they are not sharing packages. for i := 1; i <= 3; i++ { exporter, err := stackdriver.NewExporter(stackdriver.Options{}) if err != nil { - log.Warnf("failed to initialize stackdriver exporter: %+v", err) + log.Warnf("failed to initialize Stackdriver exporter: %+v", err) } else { trace.RegisterExporter(exporter) trace.ApplyConfig(trace.Config{DefaultSampler: trace.AlwaysSample()}) - log.Info("registered stackdriver tracing") + log.Info("registered Stackdriver tracing") // Register the views to collect server stats. initStats(exporter) return } d := time.Second * 10 * time.Duration(i) - log.Infof("sleeping %v to retry initializing stackdriver exporter", d) + log.Infof("sleeping %v to retry initializing Stackdriver exporter", d) time.Sleep(d) } - log.Warn("could not initialize stackdriver exporter after retrying, giving up") + log.Warn("could not initialize Stackdriver exporter after retrying, giving up") } func initTracing() { initJaegerTracing() - initStackDriverTracing() + initStackdriverTracing() } func initProfiling(service, version string) { @@ -198,14 +198,14 @@ func initProfiling(service, version string) { }); err != nil { log.Warnf("failed to start profiler: %+v", err) } else { - log.Info("started stackdriver profiler") + log.Info("started Stackdriver profiler") return } d := time.Second * 10 * time.Duration(i) - log.Infof("sleeping %v to retry initializing stackdriver profiler", d) + log.Infof("sleeping %v to retry initializing Stackdriver profiler", d) time.Sleep(d) } - log.Warn("could not initialize stackdriver profiler after retrying, giving up") + log.Warn("could not initialize Stackdriver profiler after retrying, giving up") } type productCatalog struct{} diff --git a/src/shippingservice/main.go b/src/shippingservice/main.go index 6360cd8..a203318 100644 --- a/src/shippingservice/main.go +++ b/src/shippingservice/main.go @@ -161,32 +161,32 @@ func initStats(exporter *stackdriver.Exporter) { } } -func initStackDriverTracing() { +func initStackdriverTracing() { // TODO(ahmetb) this method is duplicated in other microservices using Go // since they are not sharing packages. for i := 1; i <= 3; i++ { exporter, err := stackdriver.NewExporter(stackdriver.Options{}) if err != nil { - log.Warnf("failed to initialize stackdriver exporter: %+v", err) + log.Warnf("failed to initialize Stackdriver exporter: %+v", err) } else { trace.RegisterExporter(exporter) trace.ApplyConfig(trace.Config{DefaultSampler: trace.AlwaysSample()}) - log.Info("registered stackdriver tracing") + log.Info("registered Stackdriver tracing") // Register the views to collect server stats. initStats(exporter) return } d := time.Second * 10 * time.Duration(i) - log.Infof("sleeping %v to retry initializing stackdriver exporter", d) + log.Infof("sleeping %v to retry initializing Stackdriver exporter", d) time.Sleep(d) } - log.Warn("could not initialize stackdriver exporter after retrying, giving up") + log.Warn("could not initialize Stackdriver exporter after retrying, giving up") } func initTracing() { initJaegerTracing() - initStackDriverTracing() + initStackdriverTracing() } func initProfiling(service, version string) { @@ -201,12 +201,12 @@ func initProfiling(service, version string) { }); err != nil { log.Warnf("failed to start profiler: %+v", err) } else { - log.Info("started stackdriver profiler") + log.Info("started Stackdriver profiler") return } d := time.Second * 10 * time.Duration(i) - log.Infof("sleeping %v to retry initializing stackdriver profiler", d) + log.Infof("sleeping %v to retry initializing Stackdriver profiler", d) time.Sleep(d) } - log.Warn("could not initialize stackdriver profiler after retrying, giving up") + log.Warn("could not initialize Stackdriver profiler after retrying, giving up") } From f575b76f33b550b9f0f402ee814d5e17d385f210 Mon Sep 17 00:00:00 2001 From: iasinDev Date: Mon, 1 Jul 2019 23:49:31 +0200 Subject: [PATCH 5/5] Fix https://github.com/GoogleCloudPlatform/microservices-demo/issues/222 (#224) --- src/loadgenerator/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/src/loadgenerator/Dockerfile b/src/loadgenerator/Dockerfile index cebb98c..af7fa10 100644 --- a/src/loadgenerator/Dockerfile +++ b/src/loadgenerator/Dockerfile @@ -14,4 +14,5 @@ FROM base COPY --from=builder /install /usr/local COPY . . +RUN chmod +x ./loadgen.sh ENTRYPOINT ./loadgen.sh