-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
71 lines (60 loc) · 2.03 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
.PHONY: all bot kafka druid superset format lint setup help
all: help
########################
# Execution
########################
bot:
docker compose -f docker-compose-bot.yml up
kafka:
docker compose -f docker-compose-kafka.yml up
druid:
docker compose -f docker-compose-druid.yml up
superset:
docker compose -f superset/docker-compose.yml up
########################
# Linting and Formatting
########################
format:
poetry run black .
poetry run isort .
lint:
poetry run black . --check
poetry run flake8 .
poetry run mypy .
#########################
# Set Up
#########################
setup:
@echo 'Creating .env file'
touch .env
@echo "DISCORD_BOT_TOKEN=" >> .env
@echo "BOT_BACKEND_DATABASE_USERNAME=postgres" >> .env
@echo "BOT_BACKEND_DATABASE_PASSWORD=postgres" >> .env
@echo "BOT_BACKEND_DATABASE_HOST=bot_backend_database" >> .env
@echo "BOT_BACKEND_DATABASE_PORT=5432" >> .env
@echo "BOT_BACKEND_DATABASE_NAME=discord" >> .env
@echo 'Please fill in Discord Bot Token manually after setup'
@echo 'Download HuggingFace Language Model...'
docker build -t discord/model_init -f ./docker/Dockerfile_model_init ./docker
docker run -d --rm --name discord-model-init discord/model_init
docker cp discord-model-init:/build/llm_model ./src/discord_ai_bot/
docker stop discord-model-init
docker rmi discord/model_init
@echo 'Cloning Superset Repo...'
git clone https://github.com/apache/superset.git
touch ./superset/docker/requirements-local.txt
@echo "pydruid" >> ./superset/docker/requirements-local.txt
docker network create -d bridge discord_ai_bot_network
#########################
# Help
#########################
help:
@echo '============================================='
@echo 'make bot instantiate discord bot'
@echo 'make kafka instantiate kafka'
@echo 'make druid instantiate druid'
@echo 'make superset instantiate superset'
@echo 'make format run code formatter'
@echo 'make lint run code linter'
@echo 'make setup set up the environment'
@echo '============================================='