-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: validate the configuration against actual collector binaries ru…
…nning on AWS (#111) * feat: proxy the backend API * docs: env vars * feat: add backend validation API * feat: establish a hook to get up2date validation information * feat: add support for ADOT and stabilize itest setup * chore: unify Jest config to the typescript one * chore: exclude ci scripts from linting * fix: ignored versions range for adot * chore: move validation to packages/otelbin-validation * chore: support different access keys for dev and prod accounts * chore: use Lambda function description to document which function validates which distro version * chore: add some documentation about the validation backend [skip ci] * chore: remove double-trigger for PR branches --------- Co-authored-by: Michele Mancioppi <[email protected]>
- Loading branch information
Showing
62 changed files
with
22,492 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Clean up test environment | ||
|
||
# only trigger on pull request closed events | ||
on: | ||
pull_request: | ||
types: [ closed ] | ||
|
||
jobs: | ||
cleanup_test_env: | ||
name: Clean up test environment ${{ github.ref }} | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: .nvmrc | ||
|
||
- name: Install CDK dependencies | ||
shell: bash | ||
working-directory: packages/otelbin-validation | ||
run: | | ||
npm ci | ||
- name: Delete validation backend | ||
shell: bash | ||
working-directory: packages/otelbin-validation | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ github.ref == 'refs/heads/main' && secrets.AWS_ACCESS_KEY_ID_PROD || secrets.AWS_ACCESS_KEY_ID_DEV }} | ||
AWS_SECRET_ACCESS_KEY: ${{ github.ref == 'refs/heads/main' && secrets.AWS_SECRET_ACCESS_KEY_PROD || secrets.AWS_SECRET_ACCESS_KEY_DEV }} | ||
AWS_DEFAULT_REGION: 'us-east-2' | ||
CDK_DEPLOY_ACCOUNT: ${{ github.ref == 'refs/heads/main' && '462608073829' || '622203989445' }} | ||
CDK_DEPLOY_REGION: 'us-east-2' | ||
GH_TOKEN: ${{ github.token }} | ||
TEST_ENVIRONMENT_NAME: ${{ steps.get_test_env_name.outputs.test_env_name }} | ||
run: | | ||
npx projen destroy --force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
name: Discover new OtelCol releases | ||
on: | ||
schedule: | ||
- cron: '0 2 * * *' # run at 2 AM UTC | ||
workflow_dispatch: {} | ||
|
||
jobs: | ||
check-community-releases: | ||
name: OpenTelemetry official distribution | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
distro: | ||
- name: otelcol-core | ||
artifact_prefix: otelcol_ | ||
artifact_suffix: _linux_amd64.rpm | ||
- name: otelcol-contrib | ||
artifact_prefix: otelcol-contrib_ | ||
artifact_suffix: _linux_amd64.rpm | ||
runs-on: ubuntu-latest | ||
outputs: | ||
releases: ${{ steps.list-releases.outputs.releases }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install dependencies | ||
env: | ||
NODE_MAJOR: 20 | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y ca-certificates curl gnupg | ||
sudo mkdir -p /etc/apt/keyrings | ||
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg | ||
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE_MAJOR}.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list | ||
sudo apt-get update | ||
sudo apt-get install nodejs -y | ||
- name: Build list generator | ||
working-directory: .github/workflows/scripts/list-releases | ||
run: | | ||
npm install | ||
npm run build | ||
- name: Look up ignored releases range | ||
id: lookup-ignored-releases | ||
shell: bash | ||
working-directory: packages/otelbin-validation/src/assets | ||
run: | | ||
echo "range=$(jq -r '.["${{matrix.distro.name}}"].ignoredReleases' < supported-distributions.json)" | tee -a ${GITHUB_OUTPUT} | ||
- name: List matching releases | ||
id: list-releases | ||
shell: bash | ||
env: | ||
DISTRO_NAME: ${{ matrix.distro.name }} | ||
GH_REPOSITORY: open-telemetry/opentelemetry-collector-releases | ||
GH_ASSET_PREFIX: ${{ matrix.distro.artifact_prefix }} | ||
GH_ASSET_SUFFIX: ${{ matrix.distro.artifact_suffix }} | ||
IGNORED_RELEASES: ${{ steps.lookup-ignored-releases.outputs.range }} | ||
working-directory: .github/workflows/scripts/list-releases | ||
run: | | ||
npm run start --silent | tee releases.json | ||
- name: Upload releases.json artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: releases-${{ matrix.distro.name }} | ||
path: .github/workflows/scripts/list-releases/releases.json | ||
|
||
check-adot-releases: | ||
name: AWS Distro for OpenTelemetry | ||
strategy: | ||
fail-fast: false | ||
runs-on: ubuntu-latest | ||
outputs: | ||
releases: ${{ steps.list-releases.outputs.releases }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install dependencies | ||
env: | ||
NODE_MAJOR: 20 | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y ca-certificates curl gnupg | ||
sudo mkdir -p /etc/apt/keyrings | ||
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg | ||
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE_MAJOR}.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list | ||
sudo apt-get update | ||
sudo apt-get install nodejs -y | ||
- name: Build list generator | ||
working-directory: .github/workflows/scripts/list-releases | ||
run: | | ||
npm install | ||
npm run build | ||
- name: Look up ignored releases range | ||
id: lookup-ignored-releases | ||
shell: bash | ||
working-directory: packages/otelbin-validation/src/assets | ||
run: | | ||
echo "range=$(jq -r '.["adot"].ignoredReleases' < supported-distributions.json)" | tee -a ${GITHUB_OUTPUT} | ||
- name: List matching releases | ||
id: list-releases | ||
working-directory: .github/workflows/scripts/list-releases | ||
env: | ||
DISTRO_NAME: adot | ||
GH_REPOSITORY: aws-observability/aws-otel-collector | ||
IGNORED_RELEASES: ${{ steps.lookup-ignored-releases.outputs.range }} | ||
run: | | ||
npm run start --silent | tee releases.json | ||
- name: Upload releases.json artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: releases-adot | ||
path: .github/workflows/scripts/list-releases/releases.json | ||
|
||
compose-supported-distro-list: | ||
name: Compose supported distro list | ||
needs: | ||
- check-community-releases | ||
- check-adot-releases | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Download release artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
path: releases/ | ||
- name: Merge release data | ||
run: | | ||
mv packages/otelbin-validation/src/assets/supported-distributions.json packages/otelbin-validation/src/assets/supported-distributions.json.old | ||
jq -rs 'reduce .[] as $item ({}; . * $item)' packages/otelbin-validation/src/assets/supported-distributions.json.old releases/*/*.json > packages/otelbin-validation/src/assets/supported-distributions.json | ||
- name: Upload updated releases.json artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: supported-distributions | ||
path: packages/otelbin-validation/src/assets/supported-distributions.json | ||
|
||
create-pr: | ||
name: Create Pull Request | ||
needs: | ||
- compose-supported-distro-list | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Download updated supported distro list | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: supported-distributions | ||
path: packages/otelbin-validation/src/assets | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v5 | ||
with: | ||
title: Update supported versions | ||
commit-message: 'chore: update the version list of supported OpenTelemetry collector distros' | ||
add-paths: packages/otelbin-validation/src/assets/supported-distributions.json | ||
branch: update-supported-versions | ||
reviewers: mmanciop,bripkens |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dist/ | ||
node_modules/ |
Oops, something went wrong.