forked from kdubovikov/chopstick-serving
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
32 lines (25 loc) · 904 Bytes
/
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
#############
# Variables #
#############
DOCKERFILE_PATH=./Dockerfile
DATASET_PATH=./data/chopstick.csv
IMAGE_NAME=chopstick-classifier
# different ways of creating TensorFlow models require usage of different APIs
# to work with TensorFlow Serving. Supported values are estimator_api and tensorflow_api
ifndef API_TO_USE
API_TO_USE=estimator_api
endif
CLASSIFIER_SCRIPT=./$(API_TO_USE)/chopstick_classifier.py
# servables will be exported to this directory after model traning completes
SERVABLES_PATH=$(CURDIR)/serving
#############
# Tasks #
#############
clean:
rm -rf ./serving
build_image: $(DOCKERFILE_PATH)
docker build -f $(DOCKERFILE_PATH) -t $(IMAGE_NAME) .
train_classifier: $(DATASET_PATH) $(CLASSIFIER_SCRIPT)
python $(CLASSIFIER_SCRIPT) $(DATASET_PATH) --val-num=20
run_server: $(SERVABLES_PATH)
docker run -p8500:8500 -d --rm -v $(SERVABLES_PATH):/models $(IMAGE_NAME)