Skip to content

Commit 9253832

Browse files
committed
Merge branch 'main' into merge-main-to-prod
2 parents 4abbfd2 + acf17cf commit 9253832

File tree

162 files changed

+16324
-8712
lines changed

Some content is hidden

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

162 files changed

+16324
-8712
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

+175
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
# Copyright The OpenTelemetry Authors
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
on:
5+
push:
6+
paths:
7+
- 'src/**'
8+
- 'test/**'
9+
workflow_call:
10+
inputs:
11+
push:
12+
description: Should the images be pushed
13+
default: false
14+
required: false
15+
type: boolean
16+
version:
17+
description: The version used when tagging the image
18+
default: 'dev'
19+
required: false
20+
type: string
21+
22+
jobs:
23+
build_and_push_images:
24+
runs-on: ubuntu-latest
25+
permissions:
26+
contents: read
27+
packages: write
28+
29+
env:
30+
RELEASE_VERSION: "${{ github.event.release.tag_name }}"
31+
DOCKERHUB_REPO: "otel/demo"
32+
GHCR_REPO: "ghcr.io/open-telemetry/demo"
33+
34+
strategy:
35+
fail-fast: false
36+
matrix:
37+
file_tag:
38+
- file: ./src/adservice/Dockerfile
39+
tag_suffix: adservice
40+
context: ./
41+
setup-qemu: true
42+
- file: ./src/cartservice/src/Dockerfile
43+
tag_suffix: cartservice
44+
context: ./
45+
setup-qemu: false
46+
- file: ./src/checkoutservice/Dockerfile
47+
tag_suffix: checkoutservice
48+
context: ./
49+
setup-qemu: true
50+
- file: ./src/currencyservice/Dockerfile
51+
tag_suffix: currencyservice
52+
context: ./src/currencyservice
53+
setup-qemu: true
54+
- file: ./src/emailservice/Dockerfile
55+
tag_suffix: emailservice
56+
context: ./src/emailservice
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
66+
- file: ./src/frontend/Dockerfile
67+
tag_suffix: frontend
68+
context: ./
69+
setup-qemu: true
70+
- file: ./src/frontendproxy/Dockerfile
71+
tag_suffix: frontendproxy
72+
context: ./
73+
setup-qemu: true
74+
- file: ./src/loadgenerator/Dockerfile
75+
tag_suffix: loadgenerator
76+
context: ./
77+
setup-qemu: true
78+
- file: ./src/paymentservice/Dockerfile
79+
tag_suffix: paymentservice
80+
context: ./
81+
setup-qemu: true
82+
- file: ./src/productcatalogservice/Dockerfile
83+
tag_suffix: productcatalogservice
84+
context: ./
85+
setup-qemu: true
86+
- file: ./src/quoteservice/Dockerfile
87+
tag_suffix: quoteservice
88+
context: ./
89+
setup-qemu: true
90+
- file: ./src/shippingservice/Dockerfile
91+
tag_suffix: shippingservice
92+
context: ./
93+
setup-qemu: true
94+
- file: ./src/recommendationservice/Dockerfile
95+
tag_suffix: recommendationservice
96+
context: ./
97+
setup-qemu: true
98+
- file: ./src/kafka/Dockerfile
99+
tag_suffix: kafka
100+
context: ./
101+
setup-qemu: true
102+
- file: ./src/accountingservice/Dockerfile
103+
tag_suffix: accountingservice
104+
context: ./
105+
setup-qemu: true
106+
- file: ./src/frauddetectionservice/Dockerfile
107+
tag_suffix: frauddetectionservice
108+
context: ./
109+
setup-qemu: true
110+
- file: ./src/frontend/Dockerfile.cypress
111+
tag_suffix: frontend-tests
112+
context: ./
113+
setup-qemu: true
114+
- file: ./test/Dockerfile
115+
tag_suffix: integrationTests
116+
context: ./
117+
setup-qemu: true
118+
119+
steps:
120+
- uses: actions/checkout@v4
121+
with:
122+
fetch-depth: 0
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
139+
- name: Log in to the Container registry
140+
uses: docker/login-action@v3
141+
with:
142+
registry: ghcr.io
143+
username: ${{ github.repository_owner }}
144+
password: ${{ secrets.GITHUB_TOKEN }}
145+
if: ${{ inputs.push }}
146+
- name: Log in to Docker Hub
147+
uses: docker/login-action@v3
148+
with:
149+
username: ${{ secrets.DOCKER_USERNAME }}
150+
password: ${{ secrets.DOCKER_PASSWORD }}
151+
if: ${{ inputs.push }}
152+
- name: Set up QEMU
153+
if: ${{ matrix.file_tag.setup-qemu }}
154+
uses: docker/setup-qemu-action@v3
155+
with:
156+
image: tonistiigi/binfmt:master
157+
- name: Set up Docker Buildx
158+
uses: docker/setup-buildx-action@v3
159+
with:
160+
config-inline: |
161+
[worker.oci]
162+
max-parallelism = 2
163+
- name: Matrix Build and push demo images
164+
if: steps.check_changes.outputs.skip == 'false'
165+
uses: docker/build-push-action@v5.0.0
166+
with:
167+
context: ${{ matrix.file_tag.context }}
168+
file: ${{ matrix.file_tag.file }}
169+
platforms: linux/amd64,linux/arm64
170+
push: ${{ inputs.push }}
171+
tags: |
172+
${{ env.DOCKERHUB_REPO }}:${{ inputs.version }}-${{matrix.file_tag.tag_suffix }}
173+
${{ env.GHCR_REPO }}:${{ inputs.version }}-${{ matrix.file_tag.tag_suffix }}
174+
cache-from: type=gha
175+
cache-to: type=gha

.github/workflows/checks.yml

+16-7
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,20 @@ on:
77
branches: [ main ]
88

99
jobs:
10+
<<<<<<< HEAD
11+
=======
12+
build_images:
13+
uses: ./.github/workflows/build-images.yml
14+
with:
15+
push: false
16+
version: 'dev'
17+
18+
>>>>>>> main
1019
markdownlint:
1120
runs-on: ubuntu-latest
1221
steps:
1322
- name: check out code
14-
uses: actions/checkout@v3
23+
uses: actions/checkout@v4
1524

1625
- name: install dependencies
1726
run: npm install
@@ -23,9 +32,9 @@ jobs:
2332
runs-on: ubuntu-latest
2433
steps:
2534
- name: check out code
26-
uses: actions/checkout@v3
35+
uses: actions/checkout@v4
2736

28-
- uses: actions/setup-python@v4
37+
- uses: actions/setup-python@v5
2938
with:
3039
python-version: '3.x'
3140

@@ -39,7 +48,7 @@ jobs:
3948
runs-on: ubuntu-latest
4049
steps:
4150
- name: check out code
42-
uses: actions/checkout@v3
51+
uses: actions/checkout@v4
4352

4453
- name: run misspell
4554
run: make misspell
@@ -48,7 +57,7 @@ jobs:
4857
name: markdownlinkcheck
4958
runs-on: ubuntu-latest
5059
steps:
51-
- uses: actions/checkout@v3
60+
- uses: actions/checkout@v4
5261
- name: Run link check
5362
uses: gaurav-nelson/github-action-markdown-link-check@v1
5463
with:
@@ -60,7 +69,7 @@ jobs:
6069
runs-on: ubuntu-latest
6170

6271
steps:
63-
- uses: actions/checkout@v3
72+
- uses: actions/checkout@v4
6473

6574
- name: run sanitycheck.py
6675
run: python3 ./internal/tools/sanitycheck.py
@@ -69,7 +78,7 @@ jobs:
6978
runs-on: ubuntu-latest
7079
steps:
7180
- name: check out code
72-
uses: actions/checkout@v3
81+
uses: actions/checkout@v4
7382
- name: install tools
7483
run: make install-tools
7584
- 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

+8
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88

99
jobs:
1010
build_and_push_images:
11+
<<<<<<< HEAD
1112
runs-on: ubuntu-latest
1213
permissions:
1314
contents: read
@@ -121,3 +122,10 @@ jobs:
121122
${{ env.GHCR_REPO }}:${{ env.RELEASE_VERSION || 'pr' }}-${{ matrix.file_tag.tag_suffix }}
122123
cache-from: type=gha
123124
cache-to: type=gha
125+
=======
126+
uses: ./.github/workflows/build-images.yml
127+
with:
128+
push: true
129+
version: ${{ github.event.release.tag_name }}
130+
secrets: inherit
131+
>>>>>>> main
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)