Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use images from AWS ECR repo #2

Merged
merged 2 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Images
IMAGE_VERSION=1.7.2
IMAGE_NAME=ghcr.io/open-telemetry/demo
IMAGE_NAME=718306648796.dkr.ecr.eu-west-1.amazonaws.com/opentelemetry-demo
TRACETEST_IMAGE_VERSION=v0.14.5

# Demo Platform
Expand Down
20 changes: 0 additions & 20 deletions .github/workflows/assign-reviewers.yml

This file was deleted.

63 changes: 23 additions & 40 deletions .github/workflows/build-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ on:
default: 'dev'
required: false
type: string
awsAccessKeyId:
description: 'ECR Access key id with write permissions'
required: true
type: string
awsSecretAccessKey:
description: 'ECR secret access key'
required: true
type: string

jobs:
build_and_push_images:
Expand All @@ -28,8 +36,7 @@ jobs:

env:
RELEASE_VERSION: "${{ github.event.release.tag_name }}"
DOCKERHUB_REPO: "otel/demo"
GHCR_REPO: "ghcr.io/open-telemetry/demo"
AWS_ECR_REPO: "718306648796.dkr.ecr.eu-west-1.amazonaws.com/opentelemetry-demo"

strategy:
fail-fast: false
Expand All @@ -38,87 +45,67 @@ jobs:
- 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
- file: ./test/Dockerfile
tag_suffix: integrationTests
context: ./
setup-qemu: true

steps:
- uses: actions/checkout@v4
Expand All @@ -140,24 +127,21 @@ jobs:
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

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
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
aws-access-key-id: ${{inputs.awsAccessKeyId}}
aws-secret-access-key: ${{inputs.awsSecretAccessKey}}
aws-region: us-west-2
mask-aws-account-id: true

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
with:
image: tonistiigi/binfmt:master
mask-password: true

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
Expand All @@ -173,7 +157,6 @@ jobs:
platforms: linux/amd64,linux/arm64
push: ${{ inputs.push }}
tags: |
${{ env.DOCKERHUB_REPO }}:${{ inputs.version }}-${{matrix.file_tag.tag_suffix }}
${{ env.GHCR_REPO }}:${{ inputs.version }}-${{ matrix.file_tag.tag_suffix }}
${{ env.AWS_ECR_REPO }}:${{ inputs.version }}-${{ matrix.file_tag.tag_suffix }}
cache-from: type=gha
cache-to: type=gha
23 changes: 0 additions & 23 deletions .github/workflows/stale.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ composer.lock
.venv
.dockerhub.env
.ghcr.env
.aws_ecr.env

src/frontend/cypress/videos
src/frontend/cypress/screenshots
Expand Down
22 changes: 7 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,24 +76,16 @@ install-tools: $(MISSPELL)
build:
docker compose build

.PHONY: build-and-push-dockerhub
build-and-push-dockerhub:
docker compose --env-file .dockerhub.env -f docker-compose.yml build
docker compose --env-file .dockerhub.env -f docker-compose.yml push

.PHONY: build-and-push-ghcr
build-and-push-ghcr:
docker compose --env-file .ghcr.env -f docker-compose.yml build
docker compose --env-file .ghcr.env -f docker-compose.yml push
.PHONY: build-and-push-aws-ecr
build-and-push-aws-ecr:
docker compose --env-file .aws_ecr.env -f docker-compose.yml build
docker compose --env-file .aws_ecr.env -f docker-compose.yml push

.PHONY: build-env-file
build-env-file:
cp .env .dockerhub.env
sed -i '/IMAGE_VERSION=.*/c\IMAGE_VERSION=${RELEASE_VERSION}' .dockerhub.env
sed -i '/IMAGE_NAME=.*/c\IMAGE_NAME=${DOCKERHUB_REPO}' .dockerhub.env
cp .env .ghcr.env
sed -i '/IMAGE_VERSION=.*/c\IMAGE_VERSION=${RELEASE_VERSION}' .ghcr.env
sed -i '/IMAGE_NAME=.*/c\IMAGE_NAME=${GHCR_REPO}' .ghcr.env
cp .env .aws_ecr.env
sed -i '/IMAGE_VERSION=.*/c\IMAGE_VERSION=${RELEASE_VERSION}' .aws_ecr.env
sed -i '/IMAGE_NAME=.*/c\IMAGE_NAME=${AWS_ECR_REPO}' .aws_ecr.env

run-tests:
docker compose run frontendTests
Expand Down
Loading
Loading