-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
55 lines (43 loc) · 1.59 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
WORKDIR := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
NAME := serving-runtime-base
REGISTRY :=
REPOSITORY := infaas
.DEFAULT_GOAL := build
TAG := $(lastword $(subst /, ,$(shell git rev-parse --abbrev-ref HEAD)))
M2 := '$(HOME)/.m2'
H5_CONVERTER := h5_converter/dist/h5_converter
MAVEN_PROFILE=full
.PHONY: docker-base
docker-base:
docker build --target base -t $(NAME) -f dockerfiles/$(MAVEN_PROFILE).Dockerfile .
.PHONY: docker-test
docker-test: docker-base
docker run --rm -v $(WORKDIR):/usr/src/app -v $(M2):/root/.m2 $(NAME) make test H5_CONVERTER=/usr/src/bin/h5_converter
.PHONY: docker-test
docker-build: docker-base
docker run --rm -v $(WORKDIR):/usr/src/app -v $(M2):/root/.m2 $(NAME) make build H5_CONVERTER=/usr/src/bin/h5_converter
.PHONY: docker-build-api
docker-build-api:
docker build --build-arg MAVEN_PROFILE=$(MAVEN_PROFILE) -t $(NAME) -f dockerfiles/$(MAVEN_PROFILE).Dockerfile .
.PHONY: docker-push-api
docker-push-api:
docker tag $(NAME) $(REGISTRY)/$(REPOSITORY)/$(NAME):$(TAG)
docker push $(REGISTRY)/$(REPOSITORY)/$(NAME):$(TAG)
.PHONY: build
build:
mvn package -DskipTests -B -P$(MAVEN_PROFILE)
.PHONY: test
test:
mvn -B verify -DtrimStackTrace=false -Devaluator.tensorflow.h5_converter.path=$(H5_CONVERTER) -P$(MAVEN_PROFILE)
.PHONY: deploy
deploy:
mvn -B deploy -DskipTests -P$(MAVEN_PROFILE)
.PHONY: initialize-tensorflow
initialize-tensorflow:
make -C evaluator-tensorflow/h5_converter build
.PHONY: initialize-huggingface
initialize-huggingface:
make -C evaluator-huggingface/huggingface-tokenizer-jni
.PHONY: initialize-torch
initialize-torch:
make -C evaluator-torch