Skip to content

Commit

Permalink
Merge pull request #4 from Azure/mergeupstream
Browse files Browse the repository at this point in the history
Mergeupstream
  • Loading branch information
asaharn committed Mar 5, 2024
2 parents 5045fdd + 2ed4621 commit fa028c4
Show file tree
Hide file tree
Showing 210 changed files with 32,573 additions and 21,923 deletions.
27 changes: 21 additions & 6 deletions .env
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@


# Images
IMAGE_VERSION=1.4.0
# Demo App version
IMAGE_VERSION=1.8.0
IMAGE_NAME=ghcr.io/open-telemetry/demo
DEMO_VERSION=latest

# Dependent images
COLLECTOR_CONTRIB_IMAGE=otel/opentelemetry-collector-contrib:0.93.0
GRAFANA_IMAGE=grafana/grafana:10.3.1
JAEGERTRACING_IMAGE=jaegertracing/all-in-one:1.53
# must also update version field in /src/grafana/provisioning/datasources/opensearch.yml
OPENSEARCH_IMAGE=opensearchproject/opensearch:2.11.1
POSTGRES_IMAGE=postgres:16.1
PROMETHEUS_IMAGE=quay.io/prometheus/prometheus:v2.49.1
REDIS_IMAGE=redis:7.2-alpine
TRACETEST_IMAGE_VERSION=v0.15.8
TRACETEST_IMAGE=kubeshop/tracetest:${TRACETEST_IMAGE_VERSION}

# Demo Platform
ENV_PLATFORM=local

# OpenTelemetry Collector
OTEL_COLLECTOR_HOST=otelcol
OTEL_COLLECTOR_PORT=4317
OTEL_EXPORTER_OTLP_ENDPOINT=http://${OTEL_COLLECTOR_HOST}:${OTEL_COLLECTOR_PORT}
PUBLIC_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4318/v1/traces
OTEL_COLLECTOR_PORT_GRPC=4317
OTEL_COLLECTOR_PORT_HTTP=4318
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

# OpenTelemetry Resource Definitions
OTEL_RESOURCE_ATTRIBUTES="service.namespace=opentelemetry-demo"
Expand Down Expand Up @@ -56,11 +70,12 @@ FRONTEND_ADDR=frontend:${FRONTEND_PORT}
# Frontend Proxy (Envoy)
FRONTEND_HOST=frontend
ENVOY_PORT=8080
FRONTEND_PROXY_ADDR=frontend-proxy:${ENVOY_PORT}

# Load Generator
LOCUST_WEB_PORT=8089
LOCUST_USERS=10
LOCUST_HOST=http://${FRONTEND_ADDR}
LOCUST_HOST=http://${FRONTEND_PROXY_ADDR}
LOCUST_WEB_HOST=loadgenerator
LOCUST_AUTOSTART=true
LOCUST_HEADLESS=false
Expand Down
177 changes: 177 additions & 0 deletions .github/workflows/build-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

on:
push:
paths:
- 'src/**'
- 'test/**'
workflow_call:
inputs:
push:
description: Should the images be pushed
default: false
required: false
type: boolean
version:
description: The version used when tagging the image
default: 'dev'
required: false
type: string

jobs:
build_and_push_images:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

env:
RELEASE_VERSION: "${{ github.event.release.tag_name }}"
DOCKERHUB_REPO: "otel/demo"
GHCR_REPO: "ghcr.io/open-telemetry/demo"

strategy:
fail-fast: false
matrix:
file_tag:
- file: ./src/adservice/Dockerfile
tag_suffix: adservice
context: ./
setup-qemu: true
- file: ./src/cartservice/src/Dockerfile
tag_suffix: cartservice
context: ./
setup-qemu: false
- file: ./src/checkoutservice/Dockerfile
tag_suffix: checkoutservice
context: ./
setup-qemu: true
- file: ./src/currencyservice/Dockerfile
tag_suffix: currencyservice
context: ./src/currencyservice
setup-qemu: true
- file: ./src/emailservice/Dockerfile
tag_suffix: emailservice
context: ./src/emailservice
setup-qemu: true
- file: ./src/ffspostgres/Dockerfile
tag_suffix: ffspostgres
context: ./
setup-qemu: true
# NOTE:
# https://github.com/open-telemetry/opentelemetry-demo/issues/956
# Until dedicated ARM runners are available for GHA we cannot upgrade
# OTP/Elixir versions. Please do not change the OTP/Elixir versions.
- file: ./src/featureflagservice/Dockerfile
tag_suffix: featureflagservice
context: ./
setup-qemu: true
- file: ./src/frontend/Dockerfile
tag_suffix: frontend
context: ./
setup-qemu: true
- file: ./src/frontendproxy/Dockerfile
tag_suffix: frontendproxy
context: ./
setup-qemu: true
- file: ./src/loadgenerator/Dockerfile
tag_suffix: loadgenerator
context: ./
setup-qemu: true
- file: ./src/paymentservice/Dockerfile
tag_suffix: paymentservice
context: ./
setup-qemu: true
- file: ./src/productcatalogservice/Dockerfile
tag_suffix: productcatalogservice
context: ./
setup-qemu: true
- file: ./src/quoteservice/Dockerfile
tag_suffix: quoteservice
context: ./
setup-qemu: true
- file: ./src/shippingservice/Dockerfile
tag_suffix: shippingservice
context: ./
setup-qemu: true
- file: ./src/recommendationservice/Dockerfile
tag_suffix: recommendationservice
context: ./
setup-qemu: true
- file: ./src/kafka/Dockerfile
tag_suffix: kafka
context: ./
setup-qemu: true
- file: ./src/accountingservice/Dockerfile
tag_suffix: accountingservice
context: ./
setup-qemu: true
- file: ./src/frauddetectionservice/Dockerfile
tag_suffix: frauddetectionservice
context: ./
setup-qemu: true
- file: ./src/frontend/Dockerfile.cypress
tag_suffix: frontend-tests
context: ./
setup-qemu: true

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check for changes and set push options
id: check_changes
run: |
DOCKERFILE_DIR=$(dirname ${{ matrix.file_tag.file }})
FILES_CHANGED=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} -- $DOCKERFILE_DIR)
FORCE_PUSH=${{ inputs.push }}
if [ "$FORCE_PUSH" = true ]; then
echo "Force push is enabled, proceeding with build."
echo "skip=false" >> "$GITHUB_OUTPUT"
elif [ -z "$FILES_CHANGED" ]; then
echo "No changes in ${{ matrix.file_tag.context }}, skipping build."
echo "skip=true" >> "$GITHUB_OUTPUT"
else
echo "Changes detected in ${{ matrix.file_tag.context }}, proceeding with build."
echo "skip=false" >> "$GITHUB_OUTPUT"
fi
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
if: ${{ inputs.push }}
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
if: ${{ inputs.push }}
- name: Set up QEMU
if: ${{ matrix.file_tag.setup-qemu }}
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:master
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
config-inline: |
[worker.oci]
max-parallelism = 2
- name: Matrix Build and push demo images
if: steps.check_changes.outputs.skip == 'false'
uses: docker/build-push-action@v5.0.0
with:
context: ${{ matrix.file_tag.context }}
file: ${{ matrix.file_tag.file }}
platforms: linux/amd64,linux/arm64
push: ${{ inputs.push }}
tags: |
${{ env.DOCKERHUB_REPO }}:${{ inputs.version }}-${{matrix.file_tag.tag_suffix }}
${{ env.DOCKERHUB_REPO }}:latest-${{matrix.file_tag.tag_suffix }}
${{ env.GHCR_REPO }}:${{ inputs.version }}-${{ matrix.file_tag.tag_suffix }}
${{ env.GHCR_REPO }}:latest-${{ matrix.file_tag.tag_suffix }}
cache-from: type=gha
cache-to: type=gha
23 changes: 16 additions & 7 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,24 @@
name: Checks

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
build_images:
uses: ./.github/workflows/build-images.yml
with:
push: false
version: 'dev'

markdownlint:
runs-on: ubuntu-latest
steps:
- name: check out code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: install dependencies
run: npm install
Expand All @@ -23,9 +32,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: check out code
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'

Expand All @@ -39,7 +48,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: check out code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: run misspell
run: make misspell
Expand All @@ -48,7 +57,7 @@ jobs:
name: markdownlinkcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Run link check
uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
Expand All @@ -60,7 +69,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: run sanitycheck.py
run: python3 ./internal/tools/sanitycheck.py
Expand All @@ -69,7 +78,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: check out code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: install tools
run: make install-tools
- name: run checklicense
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/gradle-wrapper-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ jobs:
validation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: gradle/wrapper-validation-action@v1.0.6
- uses: gradle/wrapper-validation-action@v2.1.1
17 changes: 17 additions & 0 deletions .github/workflows/nightly-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
name: Nightly Release

on:
schedule:
# Runs at 00:00 UTC every day
- cron: '0 0 * * *'

jobs:
build_and_push_images:
uses: ./.github/workflows/build-images.yml
if: github.repository == 'open-telemetry/opentelemetry-demo'
with:
push: true
version: nightly-${{ github.run_id }}
secrets: inherit
Loading

0 comments on commit fa028c4

Please sign in to comment.