Skip to content

Commit

Permalink
Reduce initial run time (open-telemetry#362)
Browse files Browse the repository at this point in the history
* specify -alpha version

* use pre-built images

* faster initial run time

* add verbiage about --no-build flag
  • Loading branch information
puckpuck authored Sep 14, 2022
1 parent dfde7d1 commit 81627c0
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# compose
IMAGE_VERSION=v0.3.4
IMAGE_VERSION=v0.3.4-alpha
IMAGE_NAME=ghcr.io/open-telemetry/demo

# Collector
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,5 @@ significant modifications will be credited to OpenTelemetry Authors.
([#331](https://github.com/open-telemetry/opentelemetry-demo/pull/331))
* Add span events to shipping service
([#344](https://github.com/open-telemetry/opentelemetry-demo/pull/344))
* Improve initial run time, without a build
([#362](https://github.com/open-telemetry/opentelemetry-demo/pull/362))
72 changes: 24 additions & 48 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,8 @@ services:
build:
context: ./
dockerfile: ./src/adservice/Dockerfile
# cache_from:
# - ${IMAGE_NAME}:${IMAGE_VERSION}-adservice
# cache_to:
# - inline # see https://github.com/moby/buildkit#export-cache
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-adservice
ports:
- "${AD_SERVICE_PORT}"
environment:
Expand All @@ -74,10 +72,8 @@ services:
build:
context: ./
dockerfile: ./src/cartservice/src/Dockerfile
# cache_from:
# - ${IMAGE_NAME}:${IMAGE_VERSION}-cartservice
# cache_to:
# - inline # see https://github.com/moby/buildkit#export-cache
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-cartservice
ports:
- "${CART_SERVICE_PORT}"
environment:
Expand All @@ -98,10 +94,8 @@ services:
build:
context: ./
dockerfile: ./src/checkoutservice/Dockerfile
#cache_from:
# - ${IMAGE_NAME}:${IMAGE_VERSION}-checkoutservice
#cache_to:
# - inline # see https://github.com/moby/buildkit#export-cache
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-checkoutservice
ports:
- "${CHECKOUT_SERVICE_PORT}"
environment:
Expand Down Expand Up @@ -130,10 +124,8 @@ services:
container_name: currency-service
build:
context: ./src/currencyservice
# cache_from:
# - ${IMAGE_NAME}:${IMAGE_VERSION}-currencyservice
# cache_to:
# - inline # see https://github.com/moby/buildkit#export-cache
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-currencyservice
args:
- GRPC_VERSION=1.46.0
- OPENTELEMETRY_VERSION=1.5.0
Expand All @@ -153,10 +145,8 @@ services:
container_name: email-service
build:
context: ./src/emailservice
# cache_from:
# - ${IMAGE_NAME}:${IMAGE_VERSION}-emailservice
# cache_to:
# - inline # see https://github.com/moby/buildkit#export-cache
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-emailservice
ports:
- "${EMAIL_SERVICE_PORT}"
environment:
Expand All @@ -175,10 +165,8 @@ services:
build:
context: ./
dockerfile: ./src/frontend/Dockerfile
# cache_from:
# - ${IMAGE_NAME}:${IMAGE_VERSION}-frontend
# cache_to:
# - inline # see https://github.com/moby/buildkit#export-cache
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-frontend
ports:
- "${FRONTEND_PORT}:${FRONTEND_PORT}"
environment:
Expand Down Expand Up @@ -258,10 +246,8 @@ services:
build:
context: ./
dockerfile: ./src/paymentservice/Dockerfile
# cache_from:
# - ${IMAGE_NAME}:${IMAGE_VERSION}-paymentservice
# cache_to:
# - inline # see https://github.com/moby/buildkit#export-cache
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-paymentservice
ports:
- "${PAYMENT_SERVICE_PORT}"
environment:
Expand All @@ -279,10 +265,8 @@ services:
build:
context: ./
dockerfile: ./src/productcatalogservice/Dockerfile
# cache_from:
# - ${IMAGE_NAME}:${IMAGE_VERSION}-productcatalogservice
# cache_to:
# - inline # see https://github.com/moby/buildkit#export-cache
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-productcatalogservice
ports:
- "${PRODUCT_CATALOG_SERVICE_PORT}"
environment:
Expand All @@ -301,10 +285,8 @@ services:
build:
context: ./
dockerfile: ./src/recommendationservice/Dockerfile
# cache_from:
# - ${IMAGE_NAME}:${IMAGE_VERSION}-recommendationservice
# cache_to:
# - inline # see https://github.com/moby/buildkit#export-cache
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-recommendationservice
ports:
- "${RECOMMENDATION_SERVICE_PORT}"
depends_on:
Expand All @@ -325,10 +307,8 @@ services:
build:
context: ./
dockerfile: ./src/shippingservice/Dockerfile
#cache_from:
# - ${IMAGE_NAME}:${IMAGE_VERSION}-shippingservice
#cache_to:
# - inline # see https://github.com/moby/buildkit#export-cache
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-shippingservice
ports:
- "${SHIPPING_SERVICE_PORT}"
environment:
Expand All @@ -345,10 +325,8 @@ services:
container_name: feature-flag-service
build:
context: ./src/featureflagservice
# cache_from:
# - ${IMAGE_NAME}:${IMAGE_VERSION}-featureflagservice
# cache_to:
# - inline # see https://github.com/moby/buildkit#export-cache
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-featureflagservice
ports:
- "${FEATURE_FLAG_SERVICE_PORT}:${FEATURE_FLAG_SERVICE_PORT}" # Feature Flag Service UI
- "${FEATURE_FLAG_GRPC_SERVICE_PORT}" # Feature Flag Service gRPC API
Expand Down Expand Up @@ -385,10 +363,8 @@ services:
build:
context: ./
dockerfile: ./src/loadgenerator/Dockerfile
# cache_from:
# - ${IMAGE_NAME}:${IMAGE_VERSION}-loadgenerator
# cache_to:
# - inline # see https://github.com/moby/buildkit#export-cache
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-loadgenerator
ports:
- "${LOCUST_WEB_PORT}:${LOCUST_WEB_PORT}"
environment:
Expand Down
10 changes: 7 additions & 3 deletions docs/docker_deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@ cd opentelemetry-demo/

## Run Docker Compose

- Start the demo (it can take ~20min the first time the command is executed as
all the container images will be built):
- Start the demo:

```shell
docker compose up
docker compose up --no-build
```

**Note:** The `--no-build` flag is used to fetch released docker images from
[ghcr](http://ghcr.io/open-telemetry/demo) instead of building from source.
Removing the `--no-build` command line option will rebuild all images from
source. It may take more than 20 minutes to build if the flag is omitted.

## Verify the Webstore & the Telemetry

Once the images are built and containers are started you can access:
Expand Down

0 comments on commit 81627c0

Please sign in to comment.