-
Notifications
You must be signed in to change notification settings - Fork 91
/
Makefile
57 lines (45 loc) · 1.94 KB
/
Makefile
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
.PHONY: build clean clean-gke fixes gke help pip-compile pip-install-local stop test up
help:
@echo "Welcome to the Telemetry Airflow\n"
@echo "The list of commands for local development:\n"
@echo " build Builds the docker images for the docker-compose setup"
@echo " clean Stops and removes all docker containers"
@echo " fixes Applies Black and Ruff fixes to Python files"
@echo " pip-compile Compile dependencies from 'requirements.in' into 'requirements.txt'"
@echo " pip-install-local Install pip project requirements to your local environment"
@echo " test Runs pytest"
@echo " up Runs the whole stack, served under http://localhost:8080/"
@echo " gke Create a sandbox gke cluster for testing"
@echo " clean-gke Delete the sandbox gke cluster"
@echo " stop Stops the docker containers"
build:
docker-compose build
pip-compile:
pip-compile --strip-extras --no-annotate requirements.in
pip-compile --strip-extras --no-annotate requirements-dev.in
fixes:
ruff check . --fix
ruff format .
clean: stop
docker-compose down --volumes
docker-compose rm -f
rm -rf logs/*
if [ -f airflow-worker.pid ]; then rm airflow-worker.pid; fi
pip-install-local:
pip install -r requirements.txt -r requirements-dev.txt
pip install -r requirements-override.txt --upgrade
stop:
docker-compose down
docker-compose stop
up:
grep -qF 'AIRFLOW_UID=' .env || echo "AIRFLOW_UID=$$(id -u)" >> .env
grep -qF 'FERNET_KEY=' .env || echo "FERNET_KEY=$$(python3 -c "from cryptography.fernet import Fernet; fernet_key = Fernet.generate_key(); print(fernet_key.decode())")" >> .env
docker-compose up --wait
docker-compose exec airflow-webserver airflow variables import dev_variables.json
docker-compose exec airflow-webserver airflow connections import dev_connections.json
gke:
bin/start_gke
clean-gke:
bin/stop_gke
test:
python -m pytest tests/