forked from MaxBittker/nyt-first-said
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (49 loc) · 1.87 KB
/
Makefile
File metadata and controls
58 lines (49 loc) · 1.87 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
TODAY=(date -24hours)
# Install helpers
install-textblob:
mkdir -p venv/share/nltk_data
NLTK_DATA=venv/share/nltk_data ./venv/bin/python -m textblob.download_corpora lite
# Lambda deployment
#
zip:
cd js && \
rm -f index.zip && \
zip \
-r index.zip \
*.js \
package.json \
node_modules \
storage/*.js \
utils/*.js \
utils/*.json \
transforms/*.js \
routes/*.js
# Depends on `aws` being installed. See README.md.
push-lambda: zip
aws lambda update-function-code \
--function-name $(fnName) \
--zip-file fileb://js/index.zip \
--region us-west-1
push-sentences-to-elastic:
fnName=nyt-sentences-to-elastic make push-lambda
create-elastic-lambda:
aws lambda create-function \
--function-name nyt-sentences-to-elastic \
--code S3Bucket=epub-pipeline-src,S3Key=index.zip \
--region us-west-1 \
--role arn:aws:iam::054978852993:role/service-role/epubFilterSentencesRole \
--runtime nodejs18.x \
--handler routes/sentences-to-elastic.handler
drop-sentence-to-trigger-lambda:
aws s3api delete-object --bucket nyt-said-sentences --key nyt-example-sentence.json
aws s3api put-object --bucket nyt-said-sentences --key nyt-example-sentence.json \
--body meta/examples/nyt-example-sentence.json --content-type application/json
build-bloom:
python -m tools.build-bloom-filter -f data/nospace-examplesWords20250910.json -o data/bloom_filter.bits
update-working-sites:
node js/tools/sync-sites-with-db.js data/target_sites.json
node js/tools/generate-launcher-action.js data/target_sites.json .github/workflows/working_launcher
node js/tools/generate-launcher-action.js data/target_sites.json .github/workflows/unproven_sites_launcher false "Unproven sites launcher"
list-files-dropped-in-last-day:
aws s3api list-objects-v2 --bucket nyt-said-sentences \
--query "Contents[?LastModified>='$(TODAY)T00:00:00+0'].Key"