Skip to content

Commit 4c33f23

Browse files
authored
Merge pull request #28 from DataDog/merge-main
Merge upstream main
2 parents a54beed + acf17cf commit 4c33f23

File tree

164 files changed

+14993
-17305
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+14993
-17305
lines changed

.env

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11

22

33
# Images
4-
IMAGE_VERSION=1.4.0
4+
IMAGE_VERSION=1.7.0
55
IMAGE_NAME=ghcr.io/open-telemetry/demo
6+
TRACETEST_IMAGE_VERSION=v0.14.5
67

78
# Demo Platform
89
ENV_PLATFORM=local
@@ -12,7 +13,7 @@ OTEL_COLLECTOR_HOST=otelcol
1213
OTEL_COLLECTOR_PORT_GRPC=4317
1314
OTEL_COLLECTOR_PORT_HTTP=4318
1415
OTEL_EXPORTER_OTLP_ENDPOINT=http://${OTEL_COLLECTOR_HOST}:${OTEL_COLLECTOR_PORT_GRPC}
15-
PUBLIC_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:8080/oltp-http/v1/traces
16+
PUBLIC_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:8080/otlp-http/v1/traces
1617

1718
# OpenTelemetry Resource Definitions
1819
OTEL_RESOURCE_ATTRIBUTES="service.namespace=opentelemetry-demo"

.github/workflows/build-images.yml

+57-20
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Copyright The OpenTelemetry Authors
22
# SPDX-License-Identifier: Apache-2.0
3+
34
on:
5+
push:
6+
paths:
7+
- 'src/**'
8+
- 'test/**'
49
workflow_call:
510
inputs:
611
push:
@@ -10,7 +15,7 @@ on:
1015
type: boolean
1116
version:
1217
description: The version used when tagging the image
13-
default: dev
18+
default: 'dev'
1419
required: false
1520
type: string
1621

@@ -33,99 +38,131 @@ jobs:
3338
- file: ./src/adservice/Dockerfile
3439
tag_suffix: adservice
3540
context: ./
41+
setup-qemu: true
3642
- file: ./src/cartservice/src/Dockerfile
3743
tag_suffix: cartservice
3844
context: ./
45+
setup-qemu: false
3946
- file: ./src/checkoutservice/Dockerfile
4047
tag_suffix: checkoutservice
4148
context: ./
49+
setup-qemu: true
4250
- file: ./src/currencyservice/Dockerfile
4351
tag_suffix: currencyservice
4452
context: ./src/currencyservice
53+
setup-qemu: true
4554
- file: ./src/emailservice/Dockerfile
4655
tag_suffix: emailservice
4756
context: ./src/emailservice
48-
# TODO: https://github.com/open-telemetry/opentelemetry-demo/issues/956
49-
# - file: ./src/featureflagservice/Dockerfile
50-
# tag_suffix: featureflagservice
51-
# context: ./
57+
setup-qemu: true
58+
# NOTE:
59+
# https://github.com/open-telemetry/opentelemetry-demo/issues/956
60+
# Until dedicated ARM runners are available for GHA we cannot upgrade
61+
# OTP/Elixir versions. Please do not change the OTP/Elixir versions.
62+
- file: ./src/featureflagservice/Dockerfile
63+
tag_suffix: featureflagservice
64+
context: ./
65+
setup-qemu: true
5266
- file: ./src/frontend/Dockerfile
5367
tag_suffix: frontend
5468
context: ./
69+
setup-qemu: true
5570
- file: ./src/frontendproxy/Dockerfile
5671
tag_suffix: frontendproxy
5772
context: ./
73+
setup-qemu: true
5874
- file: ./src/loadgenerator/Dockerfile
5975
tag_suffix: loadgenerator
6076
context: ./
61-
- file: ./src/otelcollector/Dockerfile
62-
tag_suffix: otelcollector
63-
context: ./
77+
setup-qemu: true
6478
- file: ./src/paymentservice/Dockerfile
6579
tag_suffix: paymentservice
6680
context: ./
81+
setup-qemu: true
6782
- file: ./src/productcatalogservice/Dockerfile
6883
tag_suffix: productcatalogservice
6984
context: ./
85+
setup-qemu: true
7086
- file: ./src/quoteservice/Dockerfile
7187
tag_suffix: quoteservice
7288
context: ./
89+
setup-qemu: true
7390
- file: ./src/shippingservice/Dockerfile
7491
tag_suffix: shippingservice
7592
context: ./
93+
setup-qemu: true
7694
- file: ./src/recommendationservice/Dockerfile
7795
tag_suffix: recommendationservice
7896
context: ./
97+
setup-qemu: true
7998
- file: ./src/kafka/Dockerfile
8099
tag_suffix: kafka
81100
context: ./
101+
setup-qemu: true
82102
- file: ./src/accountingservice/Dockerfile
83103
tag_suffix: accountingservice
84104
context: ./
105+
setup-qemu: true
85106
- file: ./src/frauddetectionservice/Dockerfile
86107
tag_suffix: frauddetectionservice
87108
context: ./
109+
setup-qemu: true
88110
- file: ./src/frontend/Dockerfile.cypress
89111
tag_suffix: frontend-tests
90112
context: ./
113+
setup-qemu: true
91114
- file: ./test/Dockerfile
92115
tag_suffix: integrationTests
93116
context: ./
117+
setup-qemu: true
94118

95119
steps:
96-
- uses: actions/checkout@v3
120+
- uses: actions/checkout@v4
97121
with:
98122
fetch-depth: 0
99-
123+
- name: Check for changes and set push options
124+
id: check_changes
125+
run: |
126+
DOCKERFILE_DIR=$(dirname ${{ matrix.file_tag.file }})
127+
FILES_CHANGED=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} -- $DOCKERFILE_DIR)
128+
FORCE_PUSH=${{ inputs.push }}
129+
if [ "$FORCE_PUSH" = true ]; then
130+
echo "Force push is enabled, proceeding with build."
131+
echo "skip=false" >> "$GITHUB_OUTPUT"
132+
elif [ -z "$FILES_CHANGED" ]; then
133+
echo "No changes in ${{ matrix.file_tag.context }}, skipping build."
134+
echo "skip=true" >> "$GITHUB_OUTPUT"
135+
else
136+
echo "Changes detected in ${{ matrix.file_tag.context }}, proceeding with build."
137+
echo "skip=false" >> "$GITHUB_OUTPUT"
138+
fi
100139
- name: Log in to the Container registry
101-
uses: docker/login-action@v2
140+
uses: docker/login-action@v3
102141
with:
103142
registry: ghcr.io
104143
username: ${{ github.repository_owner }}
105144
password: ${{ secrets.GITHUB_TOKEN }}
106145
if: ${{ inputs.push }}
107-
108146
- name: Log in to Docker Hub
109-
uses: docker/login-action@v2
147+
uses: docker/login-action@v3
110148
with:
111149
username: ${{ secrets.DOCKER_USERNAME }}
112150
password: ${{ secrets.DOCKER_PASSWORD }}
113151
if: ${{ inputs.push }}
114-
115152
- name: Set up QEMU
116-
uses: docker/setup-qemu-action@v2
153+
if: ${{ matrix.file_tag.setup-qemu }}
154+
uses: docker/setup-qemu-action@v3
117155
with:
118156
image: tonistiigi/binfmt:master
119-
120157
- name: Set up Docker Buildx
121-
uses: docker/setup-buildx-action@v2
158+
uses: docker/setup-buildx-action@v3
122159
with:
123160
config-inline: |
124161
[worker.oci]
125-
max-parallelism = 2
126-
162+
max-parallelism = 2
127163
- name: Matrix Build and push demo images
128-
uses: docker/build-push-action@v3.3.0
164+
if: steps.check_changes.outputs.skip == 'false'
165+
uses: docker/build-push-action@v5.0.0
129166
with:
130167
context: ${{ matrix.file_tag.context }}
131168
file: ${{ matrix.file_tag.file }}

.github/workflows/checks.yml

+10-7
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,15 @@ on:
1212
jobs:
1313
build_images:
1414
uses: ./.github/workflows/build-images.yml
15+
with:
16+
push: false
17+
version: 'dev'
1518

1619
markdownlint:
1720
runs-on: ubuntu-latest
1821
steps:
1922
- name: check out code
20-
uses: actions/checkout@v3
23+
uses: actions/checkout@v4
2124

2225
- name: install dependencies
2326
run: npm install
@@ -29,9 +32,9 @@ jobs:
2932
runs-on: ubuntu-latest
3033
steps:
3134
- name: check out code
32-
uses: actions/checkout@v3
35+
uses: actions/checkout@v4
3336

34-
- uses: actions/setup-python@v4
37+
- uses: actions/setup-python@v5
3538
with:
3639
python-version: '3.x'
3740

@@ -45,7 +48,7 @@ jobs:
4548
runs-on: ubuntu-latest
4649
steps:
4750
- name: check out code
48-
uses: actions/checkout@v3
51+
uses: actions/checkout@v4
4952

5053
- name: run misspell
5154
run: make misspell
@@ -54,7 +57,7 @@ jobs:
5457
name: markdownlinkcheck
5558
runs-on: ubuntu-latest
5659
steps:
57-
- uses: actions/checkout@v3
60+
- uses: actions/checkout@v4
5861
- name: Run link check
5962
uses: gaurav-nelson/github-action-markdown-link-check@v1
6063
with:
@@ -66,7 +69,7 @@ jobs:
6669
runs-on: ubuntu-latest
6770

6871
steps:
69-
- uses: actions/checkout@v3
72+
- uses: actions/checkout@v4
7073

7174
- name: run sanitycheck.py
7275
run: python3 ./internal/tools/sanitycheck.py
@@ -75,7 +78,7 @@ jobs:
7578
runs-on: ubuntu-latest
7679
steps:
7780
- name: check out code
78-
uses: actions/checkout@v3
81+
uses: actions/checkout@v4
7982
- name: install tools
8083
run: make install-tools
8184
- name: run checklicense

.github/workflows/gradle-wrapper-validation.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ jobs:
1313
validation:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
1717

18-
- uses: gradle/wrapper-validation-action@v1.0.6
18+
- uses: gradle/wrapper-validation-action@v1.1.0

.github/workflows/release.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ jobs:
1111
uses: ./.github/workflows/build-images.yml
1212
with:
1313
push: true
14-
version: ${{ github.event.release.tag_name }}"
14+
version: ${{ github.event.release.tag_name }}
15+
secrets: inherit
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Copyright The OpenTelemetry Authors
2+
# SPDX-License-Identifier: Apache-2.0
3+
name: Integration Tests
4+
5+
on:
6+
pull_request_target:
7+
branches:
8+
- main
9+
types: [closed]
10+
11+
jobs:
12+
build_runner:
13+
runs-on: ubuntu-latest
14+
name: "Build Runner"
15+
if: github.event.pull_request.merged == true
16+
steps:
17+
- name: metal-runner-action
18+
uses: equinix-labs/metal-action-runner@v0.1.1
19+
with:
20+
github_token: ${{ secrets.GH_CI_SECRET }}
21+
metal_auth_token: ${{ secrets.METAL_AUTH_TOKEN }}
22+
metal_project_id: ${{ secrets.METAL_PROJECT_ID }}
23+
metro: "da"
24+
plan: "c3.small.x86"
25+
os: "ubuntu_20_04"
26+
run_tests:
27+
needs: build_runner
28+
runs-on: self-hosted
29+
name: "Run CI"
30+
steps:
31+
- name: check out code
32+
uses: actions/checkout@v3
33+
- name: install docker
34+
run: |
35+
curl -fsSL https://get.docker.com -o get-docker.sh
36+
sudo sh get-docker.sh
37+
- name: run tracetesting
38+
run: |
39+
make build && make run-tracetesting
40+
destroy:
41+
needs: [build_runner, run_tests]
42+
runs-on: ubuntu-latest
43+
name: "Cleanup"
44+
steps:
45+
- name: metal-sweeper-action
46+
uses: equinix-labs/metal-sweeper-action@v0.6.1
47+
with:
48+
authToken: ${{ secrets.METAL_AUTH_TOKEN }}
49+
projectID: ${{ secrets.METAL_PROJECT_ID }}
50+
keepProject: true

0 commit comments

Comments
 (0)