Skip to content

Commit

Permalink
Merge branch 'upstream-main' into jpmunz/react-native-example
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmunz committed Dec 19, 2024
2 parents 9a190ce + 623c0e4 commit 90d1a26
Show file tree
Hide file tree
Showing 129 changed files with 13,099 additions and 7,250 deletions.
30 changes: 15 additions & 15 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ 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 @@ -46,17 +46,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 @@ -94,7 +94,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,9 +112,9 @@ 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
Expand All @@ -134,7 +134,7 @@ FLAGD_HOST=flagd
FLAGD_PORT=8013

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

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"
32 changes: 22 additions & 10 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,8 +111,8 @@ 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
Expand All @@ -112,7 +124,7 @@ jobs:
context: ./
setup-qemu: true
- file: ./src/flagd-ui/Dockerfile
tag_suffix: flagdui
tag_suffix: flagd-ui
context: ./
setup-qemu: true
- file: ./test/tracetesting/Dockerfile
Expand Down Expand Up @@ -177,7 +189,7 @@ 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 }}
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/[email protected].0
- uses: gradle/actions/[email protected].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
7 changes: 2 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ src/shippingservice/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,12 +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/currencyservice/proto
/src/checkoutservice/genproto
/src/accountingservice/genproto

# Android
*.apk
10 changes: 6 additions & 4 deletions .licenserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
],
"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/",
Expand All @@ -51,6 +51,8 @@
"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/"
]
}
}
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,39 @@ the release.
([#1764](https://github.com/open-telemetry/opentelemetry-demo/pull/1764))
* [chore] Move build args to .env file
([#1767](https://github.com/open-telemetry/opentelemetry-demo/pull/1767))
* [frontendproxy] add access logs
([#1768](https://github.com/open-telemetry/opentelemetry-demo/pull/1768))
* [grafana] Fix Dashboards
([#1779](https://github.com/open-telemetry/opentelemetry-demo/pull/1779))
* [accountingservice] bump OpenTelemetry .NET Automatic Instrumentation
to 1.9.0 ([#1780](https://github.com/open-telemetry/opentelemetry-demo/pull/1780))
* [chore] update memory limits for flagd, flagdui, and loadgenerator
([#1786](https://github.com/open-telemetry/opentelemetry-demo/pull/1786))
* [chore] Add multi-platform build support
([#1785](https://github.com/open-telemetry/opentelemetry-demo/pull/1785))
* [chore] Generate protobuf code for Go and Python services
([#1794](https://github.com/open-telemetry/opentelemetry-demo/pull/1784))
* [paymentservice] Add nodejs instrumentation for runtime metrics
([#1797](https://github.com/open-telemetry/opentelemetry-demo/pull/1797))
* [flagd and paymentservice] Update `paymentServiceFailure` to use a list of
variants and add loyalty level attributes to spans. Added `service.name` to logs.
([#1815](https://github.com/open-telemetry/opentelemetry-demo/pull/1815))
* [accounting] rename accountingservice to accounting
([#1827](https://github.com/open-telemetry/opentelemetry-demo/pull/1827))
* [cartservice] - Add Exemplars to Cart Service
([#1830](https://github.com/open-telemetry/opentelemetry-demo/pull/1830))
* [ad] rename adservice to ad
([#1832](https://github.com/open-telemetry/opentelemetry-demo/pull/1832))
* [grafana] Add Exemplars Dashboard
([#1836](https://github.com/open-telemetry/opentelemetry-demo/pull/1836))
* [quote] rename quoteservice to quote
([#1838](https://github.com/open-telemetry/opentelemetry-demo/pull/1838))
* [flagd-ui] rename flagdui to flagd-ui
([#1840](https://github.com/open-telemetry/opentelemetry-demo/pull/1840))
* [otel-collector] rename otelcol to otel-collector
([#1841](https://github.com/open-telemetry/opentelemetry-demo/pull/1841))
* [cart] rename cartservice to cart
([#1839](https://github.com/open-telemetry/opentelemetry-demo/pull/1839))
* [react-native-app] Add React Native example app
([#1781](https://github.com/open-telemetry/opentelemetry-demo/pull/1781))

Expand Down
48 changes: 44 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,17 @@ cd opentelemetry-demo/
- Navigate to the Java Ad Service folder to install and update Gradle:

```shell
cd .\src\adservice\
cd .\src\ad\
.\gradlew installDist
.\gradlew wrapper --gradle-version 7.4.2
```

### Run Docker Compose

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

```shell
docker compose up -d
make start
```

### Verify the Webstore & the Telemetry
Expand Down Expand Up @@ -202,6 +201,47 @@ on each other), the owner should try to get people aligned by:
the owner should bring it to the OpenTelemetry Community Demo SIG
[meeting](README.md#contributing).

## Multi-platform Builds

Creating multi-platform builds requires docker buildx to be installed. This
is part of Docker Desktop for macOS, or can be installed using
`apt install docker-buildx` on Ubuntu.

To build and load the multi-platform images locally you will need to configure
docker to use `containerd`. This can be done in Docker Desktop settings on MacOS
or Windows. Please follow
[these instructions](https://docs.docker.com/engine/storage/containerd/#enable-containerd-image-store-on-docker-engine)
to configure Docker Engine on Linux/Ubuntu.

You will need a multi-platform capable builder with a limiter set on parallelism
to avoid errors while building the images. It is recommended to limit the
parallelism to 4. This can be done by specifying a configuration file when
creating the builder. The `buildkitd.toml` file in this repository can be used
as the builder configuration file.

To create a multi-platform builder with a parallelism limit of 4, use the
following command:

```shell
make create-multiplatform-builder
```

A builder will be created and set as the active builder. You can check the
builder status with `docker buildx inspect`. To build multi-platform images for
linux/amd64 and linux/arm64, use the following command:

```shell
make build-multiplatform
```

To build and push multi-platform images to a registry, ensure to set
`IMAGE_NAME` to the name of the registry and image repository to use in the
`.env.override` file and run:

```shell
make build-multiplatform-and-push
```

## Making a new release

Maintainers can create a new release when desired by following these steps.
Expand Down
Loading

0 comments on commit 90d1a26

Please sign in to comment.