Release Nightly #381
This file contains hidden or 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
| name: Release Nightly | |
| on: | |
| schedule: | |
| # Run at 0:00 AM UTC every day | |
| - cron: '0 0 * * *' | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: write | |
| packages: write | |
| pull-requests: write | |
| actions: read | |
| jobs: | |
| # --------------------------------------------------------------------------- | |
| # OTel Collector Nightly | |
| # --------------------------------------------------------------------------- | |
| build-otel-collector-nightly: | |
| name: Build OTel Collector Nightly (${{ matrix.arch }}) | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| include: | |
| - arch: amd64 | |
| platform: linux/amd64 | |
| runner: ubuntu-latest | |
| - arch: arm64 | |
| platform: linux/arm64 | |
| runner: ubuntu-latest-arm64 | |
| runs-on: ${{ matrix.runner }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
| password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Load Environment Variables from .env | |
| uses: xom9ikk/dotenv@v2 | |
| - name: Build and Push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: ./docker/otel-collector/Dockerfile | |
| platforms: ${{ matrix.platform }} | |
| target: prod | |
| tags: | | |
| ${{ env.OTEL_COLLECTOR_IMAGE_NAME_DOCKERHUB }}:${{ env.IMAGE_NIGHTLY_TAG }}-${{ matrix.arch }} | |
| ${{ env.NEXT_OTEL_COLLECTOR_IMAGE_NAME_DOCKERHUB }}:${{ env.IMAGE_NIGHTLY_TAG }}-${{ matrix.arch }} | |
| push: true | |
| cache-from: type=gha,scope=otel-collector-nightly-${{ matrix.arch }} | |
| cache-to: | |
| type=gha,mode=max,scope=otel-collector-nightly-${{ matrix.arch }} | |
| publish-otel-collector-nightly: | |
| name: Publish OTel Collector Nightly Manifest | |
| needs: build-otel-collector-nightly | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Load Environment Variables from .env | |
| uses: xom9ikk/dotenv@v2 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
| password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
| - name: Setup Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Create multi-arch manifests | |
| run: | | |
| TAG="${{ env.IMAGE_NIGHTLY_TAG }}" | |
| for IMAGE in "${{ env.OTEL_COLLECTOR_IMAGE_NAME_DOCKERHUB }}" "${{ env.NEXT_OTEL_COLLECTOR_IMAGE_NAME_DOCKERHUB }}"; do | |
| docker buildx imagetools create \ | |
| -t "${IMAGE}:${TAG}" \ | |
| "${IMAGE}:${TAG}-amd64" \ | |
| "${IMAGE}:${TAG}-arm64" | |
| done | |
| # --------------------------------------------------------------------------- | |
| # App Nightly | |
| # --------------------------------------------------------------------------- | |
| build-app-nightly: | |
| name: Build App Nightly (${{ matrix.arch }}) | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| include: | |
| - arch: amd64 | |
| platform: linux/amd64 | |
| runner: Large-Runner-x64-32 | |
| - arch: arm64 | |
| platform: linux/arm64 | |
| runner: Large-Runner-ARM64-32 | |
| runs-on: ${{ matrix.runner }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
| password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Load Environment Variables from .env | |
| uses: xom9ikk/dotenv@v2 | |
| - name: Build and Push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| file: ./docker/hyperdx/Dockerfile | |
| platforms: ${{ matrix.platform }} | |
| target: prod | |
| build-contexts: | | |
| hyperdx=./docker/hyperdx | |
| api=./packages/api | |
| app=./packages/app | |
| build-args: | | |
| CODE_VERSION=${{ env.IMAGE_NIGHTLY_TAG }} | |
| tags: | | |
| ${{ env.IMAGE_NAME_DOCKERHUB }}:${{ env.IMAGE_NIGHTLY_TAG }}-${{ matrix.arch }} | |
| push: true | |
| sbom: true | |
| provenance: true | |
| cache-from: type=gha,scope=app-nightly-${{ matrix.arch }} | |
| cache-to: type=gha,mode=max,scope=app-nightly-${{ matrix.arch }} | |
| publish-app-nightly: | |
| name: Publish App Nightly Manifest | |
| needs: build-app-nightly | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Load Environment Variables from .env | |
| uses: xom9ikk/dotenv@v2 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
| password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
| - name: Setup Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Create multi-arch manifest | |
| run: | | |
| TAG="${{ env.IMAGE_NIGHTLY_TAG }}" | |
| IMAGE="${{ env.IMAGE_NAME_DOCKERHUB }}" | |
| docker buildx imagetools create \ | |
| -t "${IMAGE}:${TAG}" \ | |
| "${IMAGE}:${TAG}-amd64" \ | |
| "${IMAGE}:${TAG}-arm64" | |
| # --------------------------------------------------------------------------- | |
| # Local Nightly (all-in-one-noauth) | |
| # --------------------------------------------------------------------------- | |
| build-local-nightly: | |
| name: Build Local Nightly (${{ matrix.arch }}) | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| include: | |
| - arch: amd64 | |
| platform: linux/amd64 | |
| runner: Large-Runner-x64-32 | |
| - arch: arm64 | |
| platform: linux/arm64 | |
| runner: Large-Runner-ARM64-32 | |
| runs-on: ${{ matrix.runner }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
| password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Load Environment Variables from .env | |
| uses: xom9ikk/dotenv@v2 | |
| - name: Build and Push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| file: ./docker/hyperdx/Dockerfile | |
| platforms: ${{ matrix.platform }} | |
| target: all-in-one-noauth | |
| build-contexts: | | |
| clickhouse=./docker/clickhouse | |
| otel-collector=./docker/otel-collector | |
| hyperdx=./docker/hyperdx | |
| api=./packages/api | |
| app=./packages/app | |
| build-args: | | |
| CODE_VERSION=${{ env.IMAGE_NIGHTLY_TAG }} | |
| tags: | | |
| ${{ env.LOCAL_IMAGE_NAME_DOCKERHUB }}:${{ env.IMAGE_NIGHTLY_TAG }}-${{ matrix.arch }} | |
| ${{ env.NEXT_LOCAL_IMAGE_NAME_DOCKERHUB }}:${{ env.IMAGE_NIGHTLY_TAG }}-${{ matrix.arch }} | |
| push: true | |
| sbom: true | |
| provenance: true | |
| cache-from: type=gha,scope=local-nightly-${{ matrix.arch }} | |
| cache-to: type=gha,mode=max,scope=local-nightly-${{ matrix.arch }} | |
| publish-local-nightly: | |
| name: Publish Local Nightly Manifest | |
| needs: build-local-nightly | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Load Environment Variables from .env | |
| uses: xom9ikk/dotenv@v2 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
| password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
| - name: Setup Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Create multi-arch manifests | |
| run: | | |
| TAG="${{ env.IMAGE_NIGHTLY_TAG }}" | |
| for IMAGE in "${{ env.LOCAL_IMAGE_NAME_DOCKERHUB }}" "${{ env.NEXT_LOCAL_IMAGE_NAME_DOCKERHUB }}"; do | |
| docker buildx imagetools create \ | |
| -t "${IMAGE}:${TAG}" \ | |
| "${IMAGE}:${TAG}-amd64" \ | |
| "${IMAGE}:${TAG}-arm64" | |
| done | |
| # --------------------------------------------------------------------------- | |
| # All-in-One Nightly (all-in-one-auth) | |
| # --------------------------------------------------------------------------- | |
| build-all-in-one-nightly: | |
| name: Build All-in-One Nightly (${{ matrix.arch }}) | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| include: | |
| - arch: amd64 | |
| platform: linux/amd64 | |
| runner: Large-Runner-x64-32 | |
| - arch: arm64 | |
| platform: linux/arm64 | |
| runner: Large-Runner-ARM64-32 | |
| runs-on: ${{ matrix.runner }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
| password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Load Environment Variables from .env | |
| uses: xom9ikk/dotenv@v2 | |
| - name: Build and Push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| file: ./docker/hyperdx/Dockerfile | |
| platforms: ${{ matrix.platform }} | |
| target: all-in-one-auth | |
| build-contexts: | | |
| clickhouse=./docker/clickhouse | |
| otel-collector=./docker/otel-collector | |
| hyperdx=./docker/hyperdx | |
| api=./packages/api | |
| app=./packages/app | |
| build-args: | | |
| CODE_VERSION=${{ env.IMAGE_NIGHTLY_TAG }} | |
| tags: | | |
| ${{ env.ALL_IN_ONE_IMAGE_NAME_DOCKERHUB }}:${{ env.IMAGE_NIGHTLY_TAG }}-${{ matrix.arch }} | |
| ${{ env.NEXT_ALL_IN_ONE_IMAGE_NAME_DOCKERHUB }}:${{ env.IMAGE_NIGHTLY_TAG }}-${{ matrix.arch }} | |
| push: true | |
| sbom: true | |
| provenance: true | |
| cache-from: type=gha,scope=all-in-one-nightly-${{ matrix.arch }} | |
| cache-to: | |
| type=gha,mode=max,scope=all-in-one-nightly-${{ matrix.arch }} | |
| publish-all-in-one-nightly: | |
| name: Publish All-in-One Nightly Manifest | |
| needs: build-all-in-one-nightly | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Load Environment Variables from .env | |
| uses: xom9ikk/dotenv@v2 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
| password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
| - name: Setup Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Create multi-arch manifests | |
| run: | | |
| TAG="${{ env.IMAGE_NIGHTLY_TAG }}" | |
| for IMAGE in "${{ env.ALL_IN_ONE_IMAGE_NAME_DOCKERHUB }}" "${{ env.NEXT_ALL_IN_ONE_IMAGE_NAME_DOCKERHUB }}"; do | |
| docker buildx imagetools create \ | |
| -t "${IMAGE}:${TAG}" \ | |
| "${IMAGE}:${TAG}-amd64" \ | |
| "${IMAGE}:${TAG}-arm64" | |
| done | |
| # --------------------------------------------------------------------------- | |
| # Failure notification + OTel | |
| # --------------------------------------------------------------------------- | |
| slack-notify-failure: | |
| needs: | |
| [ | |
| publish-otel-collector-nightly, | |
| publish-app-nightly, | |
| publish-local-nightly, | |
| publish-all-in-one-nightly, | |
| ] | |
| runs-on: ubuntu-24.04 | |
| if: failure() && always() | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Get failed jobs | |
| id: get_failed_jobs | |
| uses: actions/github-script@v7 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const response = await github.rest.actions.listJobsForWorkflowRun({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| run_id: context.runId | |
| }); | |
| const failedJobs = response.data.jobs | |
| .filter(job => job.status === 'completed' && job.conclusion === 'failure') | |
| .map(job => job.name) | |
| .join(', '); | |
| core.setOutput('failed_jobs', failedJobs); | |
| - name: Slack Notification | |
| uses: 8398a7/action-slack@v3 | |
| with: | |
| status: custom | |
| fields: repo,workflow,commit,author | |
| custom_payload: | | |
| { | |
| "text": "Release Nightly Failed", | |
| "attachments": [{ | |
| "color": "danger", | |
| "fields": [ | |
| { | |
| "title": "Failed Build", | |
| "value": "${{ steps.get_failed_jobs.outputs.failed_jobs }}", | |
| "short": false | |
| }, | |
| { | |
| "title": "Commit", | |
| "value": "<https://github.com/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>", | |
| "short": false | |
| }, | |
| { | |
| "title": "Author", | |
| "value": "${{ github.actor }}", | |
| "short": true | |
| } | |
| ] | |
| }] | |
| } | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_ENG_NOTIFS }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| otel-cicd-action: | |
| if: always() | |
| name: OpenTelemetry Export Trace | |
| runs-on: ubuntu-latest | |
| needs: | |
| [ | |
| publish-otel-collector-nightly, | |
| publish-app-nightly, | |
| publish-local-nightly, | |
| publish-all-in-one-nightly, | |
| slack-notify-failure, | |
| ] | |
| steps: | |
| - name: Export workflow | |
| uses: corentinmusard/otel-cicd-action@v4 | |
| with: | |
| otlpEndpoint: ${{ secrets.OTLP_ENDPOINT }}/v1/traces | |
| otlpHeaders: ${{ secrets.OTLP_HEADERS }} | |
| otelServiceName: 'release-nightly-hyperdx-oss-workflow' | |
| githubToken: ${{ secrets.GITHUB_TOKEN }} |