-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathjustfile
More file actions
165 lines (136 loc) · 4 KB
/
Copy pathjustfile
File metadata and controls
165 lines (136 loc) · 4 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
set dotenv-load
# List commands, default
default:
just --list
# Download new markets to cache
[working-directory: 'download']
download *args:
cargo run -qr -- {{args}}
# Run download tests
[working-directory: 'download']
download-test:
cargo test -q
# Extract markets from cache
[working-directory: 'extract']
extract *args:
cargo run -qr -- {{args}}
# Run extract tests
[working-directory: 'extract']
extract-test:
cargo test -q
# Grade markets
[working-directory: 'grader']
grade *args:
cargo run -qr -- {{args}}
# Run grader tests
[working-directory: 'grader']
grade-test:
cargo test -q
# Start the database containers
db-up:
docker compose up -d
# Stop the database containers
db-down:
docker compose down
# Get the database containers logs
db-logs:
docker compose logs -f
# Get a shell into the database
db-shell:
docker exec -it $POSTGRES_CONTAINER_NAME psql \
--username=$POSTGRES_USER \
--dbname=$POSTGRES_DB
# Run a SQL file on the database
db-run-sql file:
docker exec -i $POSTGRES_CONTAINER_NAME psql \
--username=$POSTGRES_USER \
--dbname=$POSTGRES_DB \
< {{file}}
# Get the database schema
db-get-schema:
docker exec -i $POSTGRES_CONTAINER_NAME pg_dump \
--username=$POSTGRES_USER \
--dbname=$POSTGRES_DB \
--schema-only
# Load the default database schema
db-load-schema:
just db-run-sql schema/01-roles.sql
just db-run-sql schema/02-schema.sql
just db-run-sql schema/03-views.sql
just db-run-sql schema/04-vector-tables.sql
just db-run-sql schema/05-vector-queries.sql
just db-run-sql schema/06-feedback.sql
just db-run-sql schema/10-platforms.sql
just db-run-sql schema/11-categories.sql
# Run a manual database backup
db-backup:
docker exec pgbackups /backup.sh
# Get DB items from an endpoint
db-curl *endpoint:
curl -sf \
-X GET "${PGRST_URL}/{{endpoint}}" \
-H "Authorization: Bearer ${PGRST_APIKEY}" | jq
# Refresh all database views
db-refresh-all:
curl -sf \
-X POST "${PGRST_URL}/rpc/refresh_all_materialized_views" \
-H "Authorization: Bearer ${PGRST_APIKEY}" | jq
# Refresh the quick database views
db-refresh-quick:
curl -sf \
-X POST "${PGRST_URL}/rpc/refresh_quick_materialized_views" \
-H "Authorization: Bearer ${PGRST_APIKEY}" | jq
# Start the main site dev server
[working-directory: 'site']
site-dev:
NODE_OPTIONS="--max-old-space-size=64000" \
npx astro dev
# Check the main site for errors
[working-directory: 'site']
site-test:
npx astro check --silent
# Reset site cache
site-cache-reset:
mkdir -p site/cache/archive
mv site/cache/*.json site/cache/archive
# Build the main site
[working-directory: 'site']
site-build *args:
NODE_OPTIONS="--max-old-space-size=64000" \
npx astro build {{args}}
# Push the site to dev with rclone
site-push-dev:
rclone sync site/dist $RCLONE_DEV_TARGET --progress
# Push the site to prod with rclone
[confirm]
site-push-prod:
rclone sync site/dist $RCLONE_PROD_TARGET --progress
# Build the main site and deploy
deploy: site-test site-build site-push-dev site-push-prod
# Start the grouper dev server
[working-directory: 'grouper']
group:
PUBLIC_PGRST_URL=${PGRST_URL} \
PUBLIC_PGRST_APIKEY=${PGRST_APIKEY} \
PUBLIC_OLLAMA_URL=${OLLAMA_URL} \
PUBLIC_OLLAMA_MODEL=${OLLAMA_MODEL} \
npx astro dev
# Check the grouper site for errors
[working-directory: 'grouper']
group-test:
npx astro check --silent
# Generate embeddings
embeddings *args:
uv run scripts/update-embeddings.py {{args}}
# Run nightly process
nightly: download-test extract-test grade-test group-test site-test
#just download --log-level warn --resolved-since-days-ago 10 --reset-cache
#just download --log-level warn --resolved-since-days-ago 10
#just extract --log-level warn
#just db-refresh-quick
#uv run scripts/fix-criterion-probs.py
#just grade --log-level warn
#TQDM_MININTERVAL=100 just embeddings
#just site-cache-reset
#just site-build --silent
#just site-push-dev