-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
105 lines (82 loc) · 4.9 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
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
SHELL=/bin/zsh
.SILENT: help
.SILENT: test_actions_booking_service
help:
echo "Commands:"
echo "- train"
echo "- test"
echo "- dryrun"
tensorboard:
./tensorboard.sh
testrasachatbot:
docker exec ailab zsh -c 'TIMESTAMP="$(shell date +%Y%m%d\[\]%H%M%S)" && cd /workspace/rasachatbot/botserver-app && rasa test core --out="results/$$TIMESTAMP"'
trainrasachatbot:
make archive_trainrasachabot
docker exec ailab zsh -c 'cd /workspace/rasachatbot/botserver-app && rasa train --augmentation 0 -v'
trainjobchatbot:
make archive_trainrasachabot
docker exec ailab sh -c 'cd /workspace/rasachatbot/botserver-app && rasa train --augmentation 0 -v --data data2 --out models2 -d domain-job.yml -c config-job.yml'
tensorboard_dir := botserver-app/tensorboard/current
log_dir = botserver-app/tensorboard/$(shell cd botserver-app/models/ && ls -td *.tar.gz | head -1)/
archive_trainrasachabot:
test -d $(tensorboard_dir) && mv $(tensorboard_dir) $(log_dir) || echo 'Do not need to move current dir.'
mkdir -p $(tensorboard_dir) && chmod 777 $(tensorboard_dir)
restartcontainers:
docker restart rasachatbot-rasa-x-1 && docker restart rasachatbot-action-server-1
train: trainrasachatbot restartcontainers
core:
docker exec ailab zsh -c 'cd /workspace/rasachatbot/botserver-app && rasa train core --augmentation 0 -v'
dryrun:
docker exec ailab zsh -c 'cd /workspace/rasachatbot/botserver-app && rasa train --dry-run'
test:
cd botserver-app && python3 test_runner.py --model=$(model) --testfile=$(testfile) --endpoint=$(endpoint)
testall:
-rm -f botserver-app/tests/reports/current/*
make test testfile=query_hotel_room_01_schema model=$(M) endpoint=$(endpoint)
make test testfile=query_hotel_room_02_sorting model=$(M) endpoint=$(endpoint)
make test testfile=query_hotel_room_03_chitchat_revisebkinfo model=$(M) endpoint=$(endpoint)
make test testfile=query_hotel_room_04_revise_invalid_bkinfo model=$(M) endpoint=$(endpoint)
make test testfile=query_hotel_room_05_donecollecting_revisebkinfo model=$(M) endpoint=$(endpoint)
make test testfile=query_hotel_room_06_jumpin_information_collecting model=$(M) endpoint=$(endpoint)
make test testfile=query_hotel_room_07_chitchat_faq model=$(M) endpoint=$(endpoint)
make test testfile=query_hotel_room_08_chitchat_smalltalk model=$(M) endpoint=$(endpoint)
make test testfile=query_hotel_room_09_chitchat_outofscope model=$(M) endpoint=$(endpoint)
make test testfile=query_hotel_room_10_chitchat_nlufallback model=$(M) endpoint=$(endpoint)
make test testfile=query_hotel_room_11_terminate_booking model=$(M) endpoint=$(endpoint)
make test testfile=query_hotel_room_12_execution_rejectedof_bkinfo_form model=$(M) endpoint=$(endpoint)
make test testfile=query_hotel_room_13_bkinfo_area_nlu model=$(M) endpoint=$(endpoint)
make test testfile=query_hotel_room_14_bkinfo_price_nlu model=$(M) endpoint=$(endpoint)
make test testfile=query_hotel_room_15_bkinfo_bed_type model=$(M) endpoint=$(endpoint)
copyaddons:
docker cp botserver-app/addons rasachatbot-rasa-production-1:/app
test_actions_fsm_botmemo_booking_progress:
docker exec rasachatbot-action-server-1 bash -c 'python -c "from actions.fsm_botmemo_booking_progress import __test__; __test__();"'
test_actions_duckling_service:
docker exec rasachatbot-action-server-1 bash -c 'export TEST_FUNC=$(uit) && python -c "$$(grep --regexp=__pytest__ -A 1 actions/duckling_service.py | tail -n 1)"'
test_actions_booking_service:
docker exec rasachatbot-action-server-1 bash -c 'export TEST_FUNC=$(uit) && python -c "$$(grep --regexp=__pytest__ -A 1 actions/booking_service.py | tail -n 1)"'
unittest_action_server:
docker exec rasachatbot-action-server-1 bash -c 'export TEST_FUNC=$(uit) && python -c "$$(grep --regexp=__pytest__ -A 1 actions/$(filepath) | tail -n 1)"'
install_ssl_certificate:
docker exec rasachatbot-nginx-1 bash -c '/etc/certbot/acme.sh --issue -d dsysang.site --nginx /etc/nginx/conf.d/rasax.nginx --home /etc/certbot/ --server buypass'
docker exec rasachatbot-nginx-1 bash -c '/etc/certbot/acme.sh --install-cert -d dsysang.site --fullchain-file /etc/certs/fullchain.pem --key-file /etc/certs/privkey.pem --home /etc/certbot/'
# files := file1 file2
# some_file: $(files)
# echo "Look at this variable: " $(files)
# touch some_file
# file1:
# touch file1
# file2:
# touch file2
patch_chatwoot:
docker cp incoming_message_service.rb rasachatbot-sidekiq-1:/app/app/services/telegram/incoming_message_service.rb
docker cp telegram.rb rasachatbot-sidekiq-1:/app/app/models/channel/telegram.rb
docker cp incoming_message_base_service.rb rasachatbot-sidekiq-1:/app/app/services/whatsapp/incoming_message_base_service.rb
docker cp whatsapp_cloud_service.rb rasachatbot-sidekiq-1:/app/app/services/whatsapp/providers/whatsapp_cloud_service.rb
sidekig:
make patch_chatwoot
docker restart rasachatbot-sidekiq-1
docker logs --tail=100 -f rasachatbot-sidekiq-1
mvmodels2:
mv botserver-app/models2/${model} botserver-app/models
docker restart rasachatbot-rasa-x-1