Skip to content

Commit 625f7ff

Browse files
expanded-analytics
Summary: - `postgres` analytics dev and test pattern. - Harden analytics against regressions.
1 parent 4cb9ea0 commit 625f7ff

File tree

4 files changed

+49
-0
lines changed

4 files changed

+49
-0
lines changed

cicd/vol/stackql-data/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore

cicd/vol/vendor-secrets/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore

docker-compose-live.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
version: "3.9"
2+
3+
services:
4+
postgres_stackql:
5+
image: postgres:14.5-bullseye
6+
hostname: postgres_stackql
7+
volumes:
8+
- ./cicd/vol/postgres/setup:/docker-entrypoint-initdb.d:ro
9+
environment:
10+
- POSTGRES_PASSWORD=stackql
11+
ports:
12+
- "7632:5432/tcp"
13+
stackql:
14+
# Update image tag as needed
15+
image: stackql/stackql:latest
16+
hostname: stackql
17+
restart: no
18+
volumes:
19+
- ./cicd/vol/vendor-secrets:/opt/stackql/vendor-secrets:ro
20+
- ./cicd/vol/stackql-data:/opt/stackql/.stackql:rw
21+
ports:
22+
- "8632:8432/tcp"
23+
command:
24+
- bash
25+
- -c
26+
- |
27+
while ! nc -z postgres_stackql 5432; do sleep 1; done;
28+
source /opt/stackql/vendor-secrets/secrets.sh
29+
stackql srv \
30+
--http.log.enabled=true \
31+
--pgsrv.port=8432 \
32+
--pgsrv.address=0.0.0.0 \
33+
--export.alias=stackql_export \
34+
--auth='{ "github": { "credentialsenvvar": "STACKQL_GITHUB_TOKEN", "type": "api_key", "valuePrefix": "Bearer " }, "googleadmin": { "type": "service_account", "credentialsenvvar": "GOOGLEADMIN_CREDENTIALS" } }' \
35+
--sqlBackend='{ "dbEngine": "postgres_tcp", "sqlDialect": "postgres", "dsn": "postgres://stackql:stackql@postgres_stackql:5432" }'

docs/analytics.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
3+
# Analytics with stackql
4+
5+
The canonical pattern is a postgres backend. To meaningfully develop analytics capability, **real** authenticated access to providers plus a postgres backend is needed. Therefore for local development:
6+
7+
- Ensure that all env var secrets are exported from the `.gitignore`d file `cicd/vol/vendor-secrets/secrets.sh`.
8+
- Run and kill development containers with `docker compose -f docker-compose-live.yml down --volumes` / `docker compose -f docker-compose-live.yml up --force-recreate`.
9+
- Connect and develop queries with `psql "postgresql://stackql:[email protected]:8632/stackql"`.
10+

0 commit comments

Comments
 (0)