feat(replay-vision): API validation + lens_result row column #53612
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
| # | |
| # Build and push LLM Analytics Temporal worker container image to AWS ECR. | |
| # | |
| # This image includes ML dependencies (transformers, ONNX Runtime, torch) for | |
| # sentiment classification that are too large for the shared PostHog image. | |
| # | |
| name: LLM Analytics Container Image CD | |
| on: | |
| push: | |
| branches: | |
| - master | |
| paths: | |
| - 'posthog/temporal/llm_analytics/**' | |
| - 'products/llm_analytics/**' | |
| - 'posthog/temporal/common/**' | |
| - 'posthog/management/commands/start_temporal_worker.py' | |
| - 'Dockerfile.llm-analytics' | |
| - '.github/workflows/cd-llm-analytics-image.yml' | |
| - 'pyproject.toml' | |
| - 'bin/temporal-django-worker' | |
| pull_request: | |
| types: [opened, synchronize, reopened, labeled] | |
| workflow_dispatch: | |
| jobs: | |
| posthog_llm_analytics_build: | |
| name: Build and push container image | |
| if: | | |
| github.repository == 'PostHog/posthog' && ( | |
| github.event_name == 'push' || | |
| github.event_name == 'workflow_dispatch' || | |
| contains(github.event.pull_request.labels.*.name, 'build-llm-analytics-image') | |
| ) | |
| runs-on: depot-ubuntu-latest | |
| timeout-minutes: 10 | |
| permissions: | |
| id-token: write | |
| contents: read | |
| steps: | |
| - name: Check out | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 2 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0 | |
| - name: Set up Depot CLI | |
| uses: depot/setup-action@15c09a5f77a0840ad4bce955686522a257853461 # v1.7.1 | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@ec61189d14ec14c8efccab744f656cffd0e33f37 # v6.1.0 | |
| with: | |
| role-to-assume: ${{ secrets.AWS_ECR_PUBLISH_IAM_ROLE }} | |
| aws-region: us-east-1 | |
| - name: Login to Amazon ECR | |
| id: aws-ecr | |
| uses: aws-actions/amazon-ecr-login@f2e9fc6c2b355c1890b65e6f6f0e2ac3e6e22f78 # v2.1.2 | |
| - name: Build and push container image | |
| id: build | |
| uses: depot/build-push-action@5f3b3c2e5a00f0093de47f657aeaefcedff27d18 # v1.17.0 | |
| with: | |
| project: c1f2m5s6zd | |
| file: ./Dockerfile.llm-analytics | |
| buildx-fallback: false | |
| push: true | |
| tags: ${{ github.ref == 'refs/heads/master' && format('{0}/posthog-llm-analytics:master,{0}/posthog-llm-analytics:{1}', steps.aws-ecr.outputs.registry, github.sha) || format('{0}/posthog-llm-analytics:{1}', steps.aws-ecr.outputs.registry, github.sha) }} | |
| platforms: linux/arm64,linux/amd64 | |
| build-args: COMMIT_HASH=${{ github.sha }} | |
| - name: Get deployer token | |
| if: github.ref == 'refs/heads/master' | |
| id: deployer | |
| uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1 | |
| with: | |
| client-id: ${{ secrets.GH_APP_CHARTS_DEPLOYER_APP_ID }} | |
| private-key: ${{ secrets.GH_APP_CHARTS_DEPLOYER_PRIVATE_KEY }} | |
| owner: PostHog | |
| repositories: charts | |
| - name: Get PR labels | |
| if: github.ref == 'refs/heads/master' | |
| id: labels | |
| uses: ./.github/actions/get-pr-labels | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Trigger LLM Analytics Temporal Worker deployment | |
| if: github.ref == 'refs/heads/master' | |
| uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4.0.1 | |
| with: | |
| token: ${{ steps.deployer.outputs.token }} | |
| repository: PostHog/charts | |
| event-type: commit_state_update | |
| client-payload: | | |
| { | |
| "values": { | |
| "image": { | |
| "sha": "${{ github.sha }}@${{ steps.build.outputs.digest }}" | |
| } | |
| }, | |
| "release": "temporal-worker-llm-analytics", | |
| "commit": ${{ toJson(github.event.head_commit) }}, | |
| "repository": ${{ toJson(github.repository) }}, | |
| "labels": ${{ steps.labels.outputs.labels }}, | |
| "timestamp": "${{ github.event.head_commit.timestamp }}" | |
| } |