Commit graph

319 commits

Author SHA1 Message Date
Colin Nelson
ab601665d1 Reduced cartservice Docker Image size (#46)
Reduces docker image size for cartservice from ~2.36 GB to ~157 MB
Fixes Issue #36 

![image-size](https://user-images.githubusercontent.com/7820716/45908973-37a31e00-bdb4-11e8-92d3-d84acfb1c10f.png)
2018-09-24 09:54:25 -07:00
Ahmet Alp Balkan
3863f6d14d
recommendationsvc: optimize img (1.1 GB to 310 MB) (#45) 2018-09-21 15:40:25 -07:00
Simon Zeltser
1f60819dee Introducing super basic health check for cart service (#44)
* Introducing super basic health check for cart service
  - Generated C# proto implementation for grpc health check
  - Moved all C# protos to a dedicated folder
  - Implemented basic health checking to ping CartStore (which is Redis in default implementation)
  - Base plumbing for health checks

* Introducing super basic health check for cart service

- Generated C# proto implementation for grpc health check
- Moved all C# protos to a dedicated folder
- Implemented basic health checking to ping CartStore (which is Redis in default implementation)
- Base plumbing for health checks

* Changing Ping health probe to call Redis Cache Ping method
2018-09-21 12:09:52 -07:00
Ahmet Alp Balkan
1bab006af1
grpc: implement health check in go services (#27)
Also locked grpc-go to =1.14 exact version.
See grpc/grpc-go#2314 and grpc/grpc-go#2313 for reference
2018-09-20 10:31:31 -07:00
Ace Nassri
6c37a96f3a Add health checks to Node.js services (#26)
* Move Node healthchecks to gRPC

* gitignore proto files

* Switch to standard health RPC

* Fix lint

* Update client.js

* Add protos back + update them

* node services: fix & run genproto.sh

this gets currencyservice to work but paymentservice is still crashing
in the docker container.

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>

* Fix docker breaking

* update dockerfiles with released health probe

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-09-19 12:35:22 -07:00
Ahmet Alp Balkan
360d983512
adservice: use grpc health checks (#29)
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-09-19 12:35:07 -07:00
Ahmet Alp Balkan
880ee16be2
grpc: add health checks to python services (#28)
also converted line endings for recommendationservice/requirements.txt from
dos to unix.
2018-09-19 12:34:56 -07:00
rghetia
fc6df2daea Remove monitored resource autodetect (#42) 2018-09-14 12:27:25 -07:00
Ahmet Alp Balkan
0f23d6bbf9
frontend: add simple /healthz endpoint
Decouple frontend health checks from GET /, which relies on other services to
be reachable. See #34.

Closes #34.

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-09-04 22:44:05 -07:00
Ahmet Alp Balkan
228105d229
frontend: add link to github repo from footer
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-08-30 10:37:58 -07:00
Ahmet Alp Balkan
7f5bb6c60b
frontend: add vendor/ to dockerignore
this is causing leftover local vendor/ to be used in docker builds

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-08-27 13:29:16 -07:00
Eno Compton
342a2d5754 Resolve compilation error in frontend (#32)
Fixes #31
2018-08-27 09:47:13 -07:00
rghetia
7f2ecfea9e Instrument Go service with Stats and monitored resources. (#30)
added default views for stats  for http and grpc in Go services only.
added monitored resources for go.
2018-08-24 16:30:50 -07:00
Ahmet Alp Balkan
04c3876e94
frontend: add robots.txt to disallow
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-08-22 19:29:55 -07:00
rghetia
f35fdbcac3 Initial commit for Ads Service. (#21)
* Initial commit for Ads Service.

* update comments for AdsService and AdsServiceClient

* Refactor Ads to Ad
Move building AdService to Docker
Use default setting for Stackdriver Exporter.
Add license text.

* Revert the projectId

- also remove commented code from frontend/rpc.go

* Add adservie to skaffold.yaml

* Remove skaffold-adservice.yaml

* Replace personal projectId with demo projectId.

* Fix the crash in adservice when ran in locally.

* Ignore .skaffold*yaml file and .kubernetes-manifests-*/ dir for easy ProjectID switch.

* Fixed review comments.
1. Changed Ad redirect urls to products.
2. Removed leftovers from Dockerfile/kub*manifests*yaml
3. Added retry for StackDriver.
4. Added log for Ad request.
5. Added comment for gradle caching.
6. Added README.md to src/adservice.

* Added GRPC Health service to Ad Service
Also added
1. timeout to getAd RPC call in frontend.
2. Async thread for stackdriver init.
2018-08-22 17:02:46 -07:00
Ahmet Alp Balkan
3e90b73464
frontend: add integration for adservice
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-08-16 18:01:52 -07:00
Ahmet Alp Balkan
427f13fcd3
go: use dep in builds, remove relative imports
Fixes #11.
Fixes #12.
Fixes #13.

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-08-04 11:21:03 -07:00
Ahmet Alp Balkan
c7dd0cbf31
test-cli: remove
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-08-04 11:12:21 -07:00
Ahmet Alp Balkan
4572974c88
use dep to lock Go dependencies (without vendor/)
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-30 19:18:05 -07:00
Ahmet Alp Balkan
c8aed3e804
recommendationservice: add import traceback
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-30 10:48:46 -07:00
Ahmet Alp Balkan
3493cc1cb4
Add more license headers
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-25 21:25:27 -07:00
Ahmet Alp Balkan
d0128060e4
Add LICENSE headers to source files
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-25 09:54:28 -07:00
michaelawyu
05381b3626 Add emailservice
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-24 21:08:29 -07:00
Ahmet Alp Balkan
432c5462a0 frontend: add BANNER_COLOR to control jumbotron bg
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-19 11:28:14 -07:00
Ahmet Alp Balkan
f149cc050b productcatalogservice: fix build
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-17 22:50:54 -07:00
Ahmet Alp Balkan
316db889aa recomendationservice: disable tracing b/c memleak
enabling the tracing interceptor/sampler causes an unbounded memory leak
eventually OOMing the container.

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-17 22:49:27 -07:00
Ahmet Alp Balkan
ee935d48e9 recommendationservice: fully freeze pip
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-17 22:49:01 -07:00
Ahmet Alp Balkan
6cedeb1317 recommendationservice: use requirements.txt
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-17 22:48:33 -07:00
Ahmet Alp Balkan
b943dda1b7 go services: fix bug that starts profiling 3 times
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-17 22:36:17 -07:00
Ahmet Alp Balkan
d5394b4041 productcatalog: read products from json, fix tests
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-17 22:24:59 -07:00
morganmclean
dbc9523cea Changed product catalog to use json, so that it slows down and generates nice profiles 2018-07-17 21:35:11 -07:00
morganmclean
2713f47bbb Fixed package imports in recommendations 2018-07-17 16:21:53 -07:00
Ahmet Alp Balkan
16b1ebe95c recommendationservice: fix entrypoint
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-17 15:54:08 -07:00
morganmclean
73ef09c64d Merge branch 'master' of sso://user/ahmetb/microservices-demo 2018-07-17 15:05:24 -07:00
morganmclean
bfb740c079 Fixed Debugger config for node services 2018-07-17 15:04:25 -07:00
Ahmet Alp Balkan
0a9382976f recommendationservice: use requirements.txt
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-17 14:59:25 -07:00
Ahmet Alp Balkan
0a1054c75d shippingservice: prevent crash on profiler init
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-17 11:56:55 -07:00
Ahmet Alp Balkan
71c47b0869 fix frontend build yet again
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-17 11:49:50 -07:00
Ahmet Alp Balkan
f69fd6b0e2 frontend: fix build
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-17 11:48:43 -07:00
Ahmet Alp Balkan
5bb1a3f400 go services: do not fail (+retry) profiler init
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-17 11:45:09 -07:00
Ahmet Alp Balkan
cca50463ee recommendationservice: add init message
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-17 08:39:23 -07:00
Ahmet Alp Balkan
c602594c37 fix emailservice dockerfile, rm ports helper script
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-16 17:02:31 -07:00
Ahmet Alp Balkan
e4664c22ea refactor fix after profiler patch
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-16 15:17:59 -07:00
morganmclean
9486bc24fd Fixed recommendations instrumentation 2018-07-16 14:34:22 -07:00
morganmclean
6e1bbe46e2 partly fixed python 2018-07-16 14:29:14 -07:00
morganmclean
99ce1f84c2 Instrumented everything but Python 2018-07-16 14:29:14 -07:00
Ahmet Alp Balkan
e53b2956a2 Revert "frontend: temporarily add a port 8090 for healthz in mTLS"
This reverts commit 9c8b4bcad2c9cc4405a2a15b430e9823ebfd0a3e.
2018-07-16 11:02:02 -07:00
Ahmet Alp Balkan
b486251773 Revert "frontend: use LISTEN_ADDR, refactor Listen code"
This reverts commit 894c0e2a8dbcc76623c7d3ddf589e30e6b9985a9.
2018-07-16 11:01:58 -07:00
Ahmet Alp Balkan
ab2b15723c frontend: use LISTEN_ADDR, refactor Listen code
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-16 10:21:41 -07:00
Ahmet Alp Balkan
7b35fb1291 frontend: temporarily add a port 8090 for healthz in mTLS
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-15 21:28:55 -07:00
Ahmet Alp Balkan
021660bb95 loadgenerator: exit faster on SIGTERM
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-15 16:34:41 -07:00
Ahmet Alp Balkan
457e2edbdf frontend/static: fix product image aspect ratios
use film-camera.jpg (1331 × 854) as the base aspect ratio

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-15 16:30:18 -07:00
Ahmet Alp Balkan
afee0d099c loadgenerator: switch to python 3.6
python3.7 is causing lockup in locust.
See https://github.com/locustio/locust/issues/843

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-15 12:22:38 -07:00
Ahmet Alp Balkan
ba5bf6d4eb loadgenerator: kill periodically to prevent lockup
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-15 11:14:35 -07:00
Ahmet Alp Balkan
a3740aa7b5 shippingservice: add ca-certificates to image
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-13 16:17:47 -07:00
Ahmet Alp Balkan
d08a58cc21 add retries for stackdriver exporters in go
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-13 15:44:56 -07:00
Ahmet Alp Balkan
d01f525453 refactor initTrace -> initTracing()
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-13 10:47:42 -07:00
Ahmet Alp Balkan
5a32ddf0ff shippingservice: move initTrace() to a func
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-12 14:56:51 -07:00
Ahmet Alp Balkan
555c8a4c05 frontend/checkoutservice: add tracing
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-12 10:46:43 -07:00
Ahmet Alp Balkan
89618dbeb6 payment & productcatalog: sample rate 1.0
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-12 10:22:36 -07:00
Ahmet Alp Balkan
1799f36dc6 shippingsercice: export traces to stackdriver
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-11 19:55:36 -07:00
Ahmet Alp Balkan
6065e871a9 productcatalog: export traces to stackdriver
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-11 19:19:00 -07:00
morganmclean
88b29516fb Added node.js client tracing 2018-07-11 15:40:38 -07:00
morganmclean
59430d5854 Added node.js tracing 2018-07-11 15:19:17 -07:00
Ahmet Alp Balkan
af71f8f9b0 frontend: refactor http.Handler decoration
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-10 21:49:06 -07:00
Ahmet Alp Balkan
61cf05844d fix go builds after deleting pkg internal
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-10 20:11:30 -07:00
JBD
4a82b21b5e add OpenCensus Go support for HTTP and gRPC 2018-07-10 17:36:55 -07:00
Simon Zeltser
7101b6b4fe Changing the order of redis and cart service starting
This should help monitoring probe for cart service to succeed at first run
2018-07-09 21:02:27 -07:00
Ahmet Alp Balkan
0be5e7b1e2 cartservice: rm initContainer, fix probe query ip
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-09 12:56:54 -07:00
Ahmet Alp Balkan
0c1068aec6 cartservice: add an exec probe written in Go
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-07 16:56:52 -07:00
Ahmet Alp Balkan
684c6020cb frontend: whitelist currencies two more currencies
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-03 12:10:52 -07:00
Ahmet Alp Balkan
0b192fa95c frontend: small fixes for form controls
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-03 09:56:42 -07:00
Ahmet Alp Balkan
6c8d06428f frontend: recommendations widget is responsive
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-02 16:34:21 -07:00
Ahmet Alp Balkan
96ffafe0c5 frontend: error tpl invokes header/footer with vals
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-02 16:16:30 -07:00
Ahmet Alp Balkan
2f5cbd5eee frontend: add footer (session id + request id)
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-02 16:11:58 -07:00
Ahmet Alp Balkan
6a5ba2a51d frontend: fix checkout form mb
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-02 15:44:25 -07:00
Ahmet Alp Balkan
39169ca498 frontend: remove footer text
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-02 15:20:23 -07:00
Simon Zeltser
d457f7ec28 Making cartservice more reliable
1. Making sure we re-create redis connection upon disconnect
2. Fixed local cart store implementation to handle updates (useful for testing w/o redis)
3. Fixed windows scripts to work against redis correctly
2018-07-02 13:26:37 -07:00
Simon Zeltser
11c208a9f4 Merge remote-tracking branch 'origin' into createCartService 2018-07-02 13:25:34 -07:00
Ahmet Alp Balkan
85d04fc0b5 frontend: proper ensureSess middleware, add req id
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-02 10:13:02 -07:00
Ahmet Alp Balkan
2dcd7b6221 frontend: remove sessionid from log
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-02 10:00:10 -07:00
Ahmet Alp Balkan
b7404e3500 frontend: use logrus structured logger
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-01 21:21:26 -07:00
Ahmet Alp Balkan
257cbdf98b loadgenerator: complete implementation
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-06-29 17:10:28 -07:00
Ahmet Alp Balkan
08aa1cce26 shippingservice: add logs indicating rpc calls
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-06-29 16:37:01 -07:00
Ahmet Alp Balkan
8c3d36d81e loadgenerator prototype
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-06-29 16:37:01 -07:00
Ahmet Alp Balkan
ab045ae6e7 currencyservice: change port to 7000
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-06-29 13:45:03 -07:00
Simon Zeltser
989fad7f76 Merge remote-tracking branch 'origin' into createCartService 2018-06-29 11:41:08 -07:00
Simon Zeltser
17ffcb9a6e Merge conflict fix for redis cache exception handling 2018-06-29 11:16:10 -07:00
Ahmet Alp Balkan
84ff69147e frontend: use pkg/errors, show full stacktrace
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-06-29 11:08:11 -07:00
Ahmet Alp Balkan
307404714b cartservice: add try catch to GetCartAsync
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-06-29 11:08:10 -07:00
Ahmet Alp Balkan
977c2e5ffd cartservice: dockerfile optimizations
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-06-29 11:08:10 -07:00
Ahmet Alp Balkan
92274f4ff4 frontend: optimize dockerfile
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-06-29 11:08:10 -07:00
Simon Zeltser
f2ee88a9a2 Changed redis connection opening to be synchronous call
Also added exception handling for GetCartAsync
2018-06-29 11:08:10 -07:00
Ahmet Alp Balkan
86b45cd8ff currencyservice: less logs
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-06-29 11:08:10 -07:00
Ahmet Alp Balkan
e3a9580c76 frontend: add liveness/readiness probes
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-06-29 11:08:10 -07:00
Simon Zeltser
4ac66b072a Refactored the cart service to add more telemetry
1. Added more telemetry around starting redis cache
2. Now if you don't specify redis cache address via command line
or environment variable, it will run with local cart (no redis).
This is useful for debugging purposes
2018-06-29 11:08:10 -07:00
Ahmet Alp Balkan
4e57b1e0aa optimize dockerfile caching for go builds
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-06-29 11:08:09 -07:00
Ahmet Alp Balkan
e2c48c58d7 frontend/handlers: wrap err
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-06-29 11:08:09 -07:00
Ahmet Alp Balkan
b68f6a0324 k8s: add frontend dockerfile + skaffold
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-06-29 11:08:09 -07:00
Ahmet Alp Balkan
878be040e4 cartservice: add net-tools to build
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-06-29 11:08:09 -07:00