-
Notifications
You must be signed in to change notification settings - Fork 182
62 lines (57 loc) · 2.61 KB
/
Copy pathcommit-metadata.yml
File metadata and controls
62 lines (57 loc) · 2.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Uploads commit metadata (an empty ingest envelope -- no benchmark records) on
# every push to develop, to the v4 Postgres, so the `commits` dim stays
# populated even when no benchmark ran.
name: Commit metadata
on:
push:
branches: [develop]
workflow_dispatch: { }
permissions:
id-token: write # enables AWS-GitHub OIDC for the v4 ingest step
contents: read
jobs:
commit-metadata:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
with:
fetch-depth: 2
# v4 (Postgres) ingest -- REQUIRED (see bench.yml rationale). Empty records:
# post-ingest.py --postgres upserts the commit row only. Gated on the
# ingest-role ARN var (the assume-role input that MUST exist for OIDC to
# succeed).
#
# `sync: false` -- the ingest runs `uv run --no-project --with`, which needs only
# the uv binary, never the synced workspace (see bench.yml rationale).
- name: Install uv for v4 ingest
if: vars.GH_BENCH_INGEST_ROLE_ARN != ''
uses: spiraldb/actions/.github/actions/setup-uv@a746510eafaa926484c354541cfc49b2ec06cc63 # 0.18.6
with:
sync: false
- name: Configure AWS credentials for v4 ingest (OIDC)
if: vars.GH_BENCH_INGEST_ROLE_ARN != ''
uses: aws-actions/configure-aws-credentials@e7f100cf4c008499ea8adda475de1042d6975c7b # v6
with:
role-to-assume: ${{ vars.GH_BENCH_INGEST_ROLE_ARN }}
aws-region: ${{ vars.RDS_BENCH_REGION }}
- name: Ingest commit metadata to v4 Postgres
if: vars.GH_BENCH_INGEST_ROLE_ARN != ''
shell: bash
env:
RDS_BENCH_INSTANCE_ENDPOINT: ${{ vars.RDS_BENCH_INSTANCE_ENDPOINT }}
RDS_BENCH_DB_NAME: ${{ vars.RDS_BENCH_DB_NAME }}
AWS_REGION: ${{ vars.RDS_BENCH_REGION }}
BENCH_SITE_BASE_URL: ${{ vars.BENCH_SITE_BASE_URL }}
BENCH_REVALIDATE_TOKEN: ${{ secrets.BENCH_REVALIDATE_TOKEN }}
run: |
set -Eeuo pipefail
echo -n > empty.jsonl
curl -fsSL https://truststore.pki.rds.amazonaws.com/global/global-bundle.pem \
-o "${RUNNER_TEMP}/rds-global-bundle.pem"
DSN="postgresql://bench_ingest@${RDS_BENCH_INSTANCE_ENDPOINT}:5432/${RDS_BENCH_DB_NAME}?sslmode=verify-full&sslrootcert=${RUNNER_TEMP}/rds-global-bundle.pem"
uv run --no-project --with 'psycopg[binary]' --with boto3 --with xxhash \
scripts/post-ingest.py empty.jsonl \
--postgres "${DSN}" \
--commit-sha "${{ github.sha }}" \
--region "${AWS_REGION}"