Skip to content

Commit

Permalink
Merge remote-tracking branch 'otel-demo/main' into luke/update-fork
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-belton committed Dec 20, 2024
2 parents 5ecb0af + cb75eba commit 14eb1a0
Show file tree
Hide file tree
Showing 302 changed files with 49,453 additions and 7,866 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ src/*/*/Dockerfile

###################################
# shippingservice
./src/shippingservice/target
./src/shipping/target
###################################

# Mix artifacts
Expand Down
67 changes: 38 additions & 29 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,38 @@ BUGSNAG_APP_VERSION=1.0.0
BUGSNAG_RELEASE_STAGE=production

# Demo App version
IMAGE_VERSION=1.11.1
IMAGE_VERSION=1.12.0
IMAGE_NAME=ghcr.io/open-telemetry/demo
DEMO_VERSION=latest

# Build Args
TRACETEST_IMAGE_VERSION=v1.7.1
OTEL_JAVA_AGENT_VERSION=2.9.0
OPENTELEMETRY_CPP_VERSION=1.17.0

# Dependent images
COLLECTOR_CONTRIB_IMAGE=otel/opentelemetry-collector-contrib:0.108.0
FLAGD_IMAGE=ghcr.io/open-feature/flagd:v0.11.2
GRAFANA_IMAGE=grafana/grafana:11.2.0
JAEGERTRACING_IMAGE=jaegertracing/all-in-one:1.60
# must also update version field in ./src/grafana/provisioning/datasources/opensearch.yaml
OPENSEARCH_IMAGE=opensearchproject/opensearch:2.16.0
POSTGRES_IMAGE=postgres:16.4
PROMETHEUS_IMAGE=quay.io/prometheus/prometheus:v2.54.1
COLLECTOR_CONTRIB_IMAGE=otel/opentelemetry-collector-contrib:0.113.0
FLAGD_IMAGE=ghcr.io/open-feature/flagd:v0.11.4
GRAFANA_IMAGE=grafana/grafana:11.3.0
JAEGERTRACING_IMAGE=jaegertracing/all-in-one:1.62.0
# must also update version field in src/grafana/provisioning/datasources/opensearch.yaml
OPENSEARCH_IMAGE=opensearchproject/opensearch:2.18.0
POSTGRES_IMAGE=postgres:17.0
PROMETHEUS_IMAGE=quay.io/prometheus/prometheus:v2.55.1
VALKEY_IMAGE=valkey/valkey:8.0-alpine
# must also update the version arg in ./test/tracetesting/Dockerfile
TRACETEST_IMAGE=kubeshop/tracetest:v1.5.2
TRACETEST_IMAGE=kubeshop/tracetest:${TRACETEST_IMAGE_VERSION}

# Demo Platform
ENV_PLATFORM=local

# OpenTelemetry Collector
HOST_FILESYSTEM=/
DOCKER_SOCK=/var/run/docker.sock
OTEL_COLLECTOR_HOST=otelcol
OTEL_COLLECTOR_HOST=otel-collector
OTEL_COLLECTOR_PORT_GRPC=4317
OTEL_COLLECTOR_PORT_HTTP=4318
OTEL_COLLECTOR_CONFIG=./src/otelcollector/otelcol-config.yml
OTEL_COLLECTOR_CONFIG_EXTRAS=./src/otelcollector/otelcol-config-extras.yml
OTEL_COLLECTOR_CONFIG=./src/otel-collector/otelcol-config.yml
OTEL_COLLECTOR_CONFIG_EXTRAS=./src/otel-collector/otelcol-config-extras.yml
OTEL_EXPORTER_OTLP_ENDPOINT=http://${OTEL_COLLECTOR_HOST}:${OTEL_COLLECTOR_PORT_GRPC}
PUBLIC_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:8080/otlp-http/v1/traces

Expand All @@ -45,17 +49,17 @@ OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=cumulative
# Core Demo Services
# ******************
# Accounting Service
ACCOUNTING_SERVICE_DOCKERFILE=./src/accountingservice/Dockerfile
ACCOUNTING_DOCKERFILE=./src/accounting/Dockerfile

# Ad Service
AD_SERVICE_PORT=9555
AD_SERVICE_ADDR=adservice:${AD_SERVICE_PORT}
AD_SERVICE_DOCKERFILE=./src/adservice/Dockerfile
AD_PORT=9555
AD_ADDR=ad:${AD_PORT}
AD_DOCKERFILE=./src/ad/Dockerfile

# Cart Service
CART_SERVICE_PORT=7070
CART_SERVICE_ADDR=cartservice:${CART_SERVICE_PORT}
CART_SERVICE_DOCKERFILE=./src/cartservice/src/Dockerfile
CART_PORT=7070
CART_ADDR=cart:${CART_PORT}
CART_DOCKERFILE=./src/cart/src/Dockerfile

# Checkout Service
CHECKOUT_SERVICE_PORT=5050
Expand Down Expand Up @@ -93,7 +97,7 @@ IMAGE_PROVIDER_DOCKERFILE=./src/imageprovider/Dockerfile

# Load Generator
LOCUST_WEB_PORT=8089
LOCUST_USERS=10
LOCUST_USERS=5
LOCUST_HOST=http://${FRONTEND_PROXY_ADDR}
LOCUST_WEB_HOST=loadgenerator
LOCUST_AUTOSTART=true
Expand All @@ -112,27 +116,32 @@ PRODUCT_CATALOG_SERVICE_ADDR=productcatalogservice:${PRODUCT_CATALOG_SERVICE_POR
PRODUCT_CATALOG_DOCKERFILE=./src/productcatalogservice/Dockerfile

# Quote Service
QUOTE_SERVICE_PORT=8090
QUOTE_SERVICE_ADDR=http://quoteservice:${QUOTE_SERVICE_PORT}
QUOTE_SERVICE_DOCKERFILE=./src/quoteservice/Dockerfile
QUOTE_PORT=8090
QUOTE_ADDR=http://quote:${QUOTE_PORT}
QUOTE_DOCKERFILE=./src/quote/Dockerfile

# Recommendation Service
RECOMMENDATION_SERVICE_PORT=9001
RECOMMENDATION_SERVICE_ADDR=recommendationservice:${RECOMMENDATION_SERVICE_PORT}
RECOMMENDATION_SERVICE_DOCKERFILE=./src/recommendationservice/Dockerfile

# Shipping Service
SHIPPING_SERVICE_PORT=50050
SHIPPING_SERVICE_ADDR=shippingservice:${SHIPPING_SERVICE_PORT}
SHIPPING_SERVICE_DOCKERFILE=./src/shippingservice/Dockerfile
SHIPPING_PORT=50050
SHIPPING_ADDR=shipping:${SHIPPING_PORT}
SHIPPING_DOCKERFILE=./src/shipping/Dockerfile

# ******************
# Dependent Services
# ******************
# flagd
# Flagd
FLAGD_HOST=flagd
FLAGD_PORT=8013

# Flagd UI
FLAGD_UI_HOST=flagd-ui
FLAGD_UI_PORT=4000
FLAGD_UI_DOCKERFILE=./src/flagd-ui/Dockerfile

# Kafka
KAFKA_SERVICE_PORT=9092
KAFKA_SERVICE_ADDR=kafka:${KAFKA_SERVICE_PORT}
Expand Down
2 changes: 1 addition & 1 deletion .github/component_owners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0
# this file is used by .github/workflows/assign-reviewers.yml
components:
src/adservice:
src/ad:
- jack-berg
- mateuszrzeszutek
- trask
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,12 @@ updates:
interval: "daily"
labels:
- "infra"
- package-ecosystem: "gomod"
directories:
- "/src/checkoutservice"
- "/src/productcatalogservice"
groups:
go-production-dependencies:
dependency-type: "production"
schedule:
interval: "daily"
53 changes: 42 additions & 11 deletions .github/workflows/component-build-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,20 @@ on:
type: string

jobs:
protobufcheck:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Generate
run: make clean docker-generate-protobuf
- name: Check Clean Work Tree
run: make check-clean-work-tree

build_and_push_images:
runs-on: ubuntu-latest
needs: protobufcheck

permissions:
contents: read
packages: write
Expand All @@ -39,16 +51,16 @@ jobs:
fail-fast: false
matrix:
file_tag:
- file: ./src/accountingservice/Dockerfile
tag_suffix: accountingservice
- file: ./src/accounting/Dockerfile
tag_suffix: accounting
context: ./
setup-qemu: true
- file: ./src/adservice/Dockerfile
tag_suffix: adservice
- file: ./src/ad/Dockerfile
tag_suffix: ad
context: ./
setup-qemu: true
- file: ./src/cartservice/src/Dockerfile
tag_suffix: cartservice
- file: ./src/cart/src/Dockerfile
tag_suffix: cart
context: ./
setup-qemu: false
- file: ./src/checkoutservice/Dockerfile
Expand Down Expand Up @@ -99,16 +111,20 @@ jobs:
tag_suffix: productcatalogservice
context: ./
setup-qemu: true
- file: ./src/quoteservice/Dockerfile
tag_suffix: quoteservice
- file: ./src/quote/Dockerfile
tag_suffix: quote
context: ./
setup-qemu: true
- file: ./src/recommendationservice/Dockerfile
tag_suffix: recommendationservice
context: ./
setup-qemu: true
- file: ./src/shippingservice/Dockerfile
tag_suffix: shippingservice
- file: ./src/shipping/Dockerfile
tag_suffix: shipping
context: ./
setup-qemu: true
- file: ./src/flagd-ui/Dockerfile
tag_suffix: flagd-ui
context: ./
setup-qemu: true
- file: ./test/tracetesting/Dockerfile
Expand All @@ -120,6 +136,17 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Load environment variables from .env file
run: |
if [ -f .env ]; then
# Filter out comments and empty lines, then add each variable to $GITHUB_ENV
grep -vE '^\s*#|^\s*$' .env | while read -r line; do
echo "$line" >> $GITHUB_ENV
done
else
echo ".env file not found!"
exit 1
fi
- name: Check for changes and set push options
id: check_changes
run: |
Expand Down Expand Up @@ -162,12 +189,16 @@ jobs:
max-parallelism = 2
- name: Matrix Build and push demo images
if: steps.check_changes.outputs.skip == 'false'
uses: docker/build-push-action@v6.9.0
uses: docker/build-push-action@v6.10.0
with:
context: ${{ matrix.file_tag.context }}
file: ${{ matrix.file_tag.file }}
platforms: linux/amd64,linux/arm64
push: ${{ inputs.push }}
build-args: |
OTEL_JAVA_AGENT_VERSION=${{ env.OTEL_JAVA_AGENT_VERSION }}
OPENTELEMETRY_CPP_VERSION=${{ env.OPENTELEMETRY_CPP_VERSION }}
TRACETEST_IMAGE_VERSION=${{ env.TRACETEST_IMAGE_VERSION }}
tags: |
${{ inputs.dockerhub_repo }}:${{ inputs.version }}-${{matrix.file_tag.tag_suffix }}
${{ inputs.dockerhub_repo }}:latest-${{matrix.file_tag.tag_suffix }}
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/dependabot-auto-update-protobuf-diff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

on:
pull_request:
branches: [ main ]

permissions:
actions: write
pull-requests: write
contents: write
packages: write

jobs:
dependabot-auto-update-protobuf-diff:
runs-on: ubuntu-latest
# Only run this job if the PR is opened by dependabot and the last commit is from dependabot
if: github.event.pull_request.user.login == 'dependabot[bot]'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.DEPENDABOT_TOKEN }}
- name: Generate
run: make clean docker-generate-protobuf
- name: Commit only if there are changes
run: |
if ! git diff --quiet; then
git config user.name "dependabot[bot]"
git config user.email "49699333+dependabot[bot]@users.noreply.github.com"
git add .
git commit -s -m "chore: update protobuf"
git push
fi
2 changes: 1 addition & 1 deletion .github/workflows/gradle-wrapper-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: gradle/actions/wrapper-validation@v4.1.0
- uses: gradle/actions/wrapper-validation@v4.2.2
2 changes: 1 addition & 1 deletion .github/workflows/label-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- 'docker-compose*.yml'
- 'src/flagd/**'
- 'src/grafana/**'
- 'src/otelcollector/**'
- 'src/otel-collector/**'
- 'src/prometheus/**'
- name: "Add Label: docs-update-required"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ jobs:
uses: actions/checkout@v4
- name: run tracetesting
run: |
make build && make run-tracetesting
make build && docker system prune -f && make run-tracetesting
14 changes: 7 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,12 @@ composer.lock

src/frontend/cypress/videos
src/frontend/cypress/screenshots
src/shippingservice/target/
src/shipping/target/
test/tracetesting/tracetesting-vars.yaml

# Ignore copied/generated protobuf files
/src/cartservice/src/protos/
/src/accounting/src/protos/
/src/cart/src/protos/
/src/featureflagservice/proto/
/src/featureflagservice/src/ffs_demo_pb.erl
/src/featureflagservice/src/ffs_service_*.erl
Expand All @@ -52,9 +53,8 @@ test/tracetesting/tracetesting-vars.yaml
/src/frontend/pb/
/src/frontend/protos/
/src/paymentservice/demo.proto
/src/recommendationservice/demo_pb2*.py
/src/shippingservice/proto/
/src/productcatalogservice/genproto
/src/shipping/proto/
/src/currencyservice/proto
/src/checkoutservice/genproto
/src/accountingservice/genproto

# Android
*.apk
14 changes: 11 additions & 3 deletions .licenserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,21 @@
],
"ignore": [
"node_modules/",
"src/accountingservice/genproto/",
"src/cartservice/src/obj/",
"src/cartservice/tests/obj/",
"/src/accounting/src/protos/",
"src/cart/src/obj/",
"src/cart/tests/obj/",
"src/checkoutservice/genproto/",
"src/featureflagservice/assets/vendor/",
"src/featureflagservice/priv/",
"src/productcatalogservice/genproto/",
"src/react-native-app/ios/Pods/",
"src/react-native-app/ios/build/",
"src/react-native-app/android/app/build/",
"src/react-native-app/android/.gradle/",
"src/react-native-app/.expo/",
"src/react-native-app/expo-env.d.ts",
"src/recommendationservice/demo_pb2.py",
"src/recommendationservice/demo_pb2_grpc.py",
"internal/tools/"
]
}
Loading

0 comments on commit 14eb1a0

Please sign in to comment.