Skip to content

Commit

Permalink
[dash0] use images from AWS ECR repository
Browse files Browse the repository at this point in the history
  • Loading branch information
basti1302 committed Jan 30, 2024
1 parent 56a294d commit a2389a7
Show file tree
Hide file tree
Showing 9 changed files with 219 additions and 261 deletions.
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.

41 changes: 24 additions & 17 deletions .github/workflows/build-images.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

name: Build and Push Images

on:
push:
paths:
Expand All @@ -19,6 +21,8 @@ on:
required: false
type: string

workflow_dispatch:

jobs:
build_and_push_images:
runs-on: ubuntu-latest
Expand All @@ -28,8 +32,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 Down Expand Up @@ -140,19 +143,23 @@ 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
- name: Configure AWS credentials
if: inputs.push == 'true'
uses: aws-actions/configure-aws-credentials@v4
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
aws-access-key-id: ${{secrets.DEPLOYMENT_WRITE_ECR_ACCESS_KEY}}
aws-secret-access-key: ${{secrets.DEPLOYMENT_WRITE_ECR_SECRET_ACCESS_KEY}}
aws-region: us-west-2
mask-aws-account-id: true

- name: Login to Amazon ECR
id: login-ecr
if: inputs.push == 'true'
uses: aws-actions/amazon-ecr-login@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
if: ${{ inputs.push }}
mask-password: true

- name: Set up QEMU
if: ${{ matrix.file_tag.setup-qemu }}
uses: docker/setup-qemu-action@v3
Expand All @@ -164,16 +171,16 @@ jobs:
config-inline: |
[worker.oci]
max-parallelism = 2
- name: Matrix Build and push demo images
if: steps.check_changes.outputs.skip == 'false'
# if: steps.check_changes.outputs.skip == 'false'
uses: docker/[email protected]
with:
context: ${{ matrix.file_tag.context }}
file: ${{ matrix.file_tag.file }}
platforms: linux/amd64,linux/arm64
platforms: linux/amd64
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
11 changes: 6 additions & 5 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ on:
workflow_dispatch:

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

markdownlint:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -83,3 +78,9 @@ jobs:
run: make install-tools
- name: run checklicense
run: make checklicense

build_images:
uses: ./.github/workflows/build-images.yml
with:
push: false
version: 'dev'
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
name: "Build and Publish"
name: "Create a Release"

on:
release:
Expand Down
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

0 comments on commit a2389a7

Please sign in to comment.