IMG_TAG := $(shell date +%Y%m%d-%H%M%S)-$(shell git rev-parse --short HEAD)
IMG_NAME := registry.cn-shenzhen.aliyuncs.com/emblem/infer:$(IMG_TAG)

default: build push

build:
	docker build -t $(IMG_NAME) .

push:
	docker push $(IMG_NAME)

deploy: build push
	kubectl --kubeconfig=../deploy/kubeconfig.themblem -n emblem set image deployment/infer infer=$(IMG_NAME)
	kubectl --kubeconfig=../deploy/kubeconfig.themblem -n emblem rollout status --timeout=300s deployment/infer

train:
	./train.py
