-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
88 lines (68 loc) · 2.16 KB
/
justfile
File metadata and controls
88 lines (68 loc) · 2.16 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
set dotenv-load
ns := "sqlmesh-python-models"
# Choose a task to run
default:
just --choose
# Format and lint
fix:
ruff format
ruff check --fix
uv run sqlmesh lint
# Install project tools
prereqs:
uv sync
wget "https://s3.amazonaws.com/mountpoint-s3-release/latest/{{arch()}}/mount-s3.deb"
sudo apt-get -y update && sudo apt-get install -y ./mount-s3.deb
rm ./mount-s3.deb
uv run quarto install tinytex
# curl -sL "https://yihui.org/tinytex/install-bin-unix.sh" | sh
minikube config set memory no-limit
minikube config set cpus no-limit
clean:
kubectl delete ns {{ns}}
# Show local/env secrets for injecting into other tools
@show-secrets:
jq -n 'env | {VARIABLE_NAME1, VARIABLE_NAME2}'
# Setup minikube
minikube:
which k9s || just prereqs
kubectl get nodes || minikube status || minikube start # if kube configured use that cluster, otherwise start minikube
# Configures harvest-secret using kubectl
#install-harvest-secret:
# cat kustomize/secrets-template.yaml | NAME=harvest-secret SECRET_JSON=$(just show-secrets) envsubst | kubectl apply -n {{ns}} -f -
# Forward mysql from k8s cluster
#mysql-svc: minikube
# kubectl apply -k kustomize/minikube
# just install-harvest-secret
# ss -ltpn | grep 3306 || kubectl port-forward service/mysqldb 3306:3306 -n {{ns}} & sleep 1
# Generate test data
md:
# bash -c "source .venv/bin/activate"
bash -c "uv run data/make_data.py --spec data/test_data.yml --dest seeds/test_data_good.csv"
bash -c "uv run data/make_data.py --spec data/test_data.yml --dest seeds/test_data_bad.csv --add-dirt"
bash -c "uv run data/make_synth.py --nrow 1000000"
# Connect to the local postgres db
psql:
psql -h localhost -U peoplewa -d peoplewa
# SQLMesh ui for local dev
#dev: mysql-svc
dev:
uv run sqlmesh ui --port 8080
# Apply SQLMesh plan to DEV
pd:
uv run sqlmesh plan dev --auto-apply
# Run SQLMesh plan in DEV
rd:
uv run sqlmesh run dev
# Apply SQLMesh plan to PROD
pp:
uv run sqlmesh plan --auto-apply
# Run SQLMesh plan in PROD
rp:
uv run sqlmesh run
# Run all SQLMesh audits
audit:
uv run sqlmesh audit
# # View latest log
log:
bat --theme='ansi' $(ls -t logs/ | head -n 1 | sed 's/^/logs\//')