-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
54 lines (40 loc) · 1.54 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
SHELL := /bin/zsh
# Minimum versions
MINIMUM_PODMAN_VERSION = 4.0.0
MINIMUM_DOCKER_VERSION = 20.10.0
# Version comparsion func
version_ge = $(shell [ "$(printf '%s\n' $(1) $(2) | sort -V | head -n1)" != "$(1)" ] && echo true)
# Check Podman installed
PODMAN_PATH := $(shell command -v podman 2>/dev/null)
PODMAN_VERSION := $(shell podman --version 2>/dev/null | awk '{print $$3}')
# Check Docker installed
DOCKER_PATH := $(shell command -v docker 2>/dev/null)
DOCKER_VERSION := $(shell docker --version 2>/dev/null | awk '{print $$3}' | tr -d ,)
# Default CLI
CONTAINER_CLI =
ifeq ($(PODMAN_PATH),)
ifeq ($(DOCKER_PATH),)
$(error "Neither Podman nor Docker found!")
else ifeq ($(call version_ge,$(MINIMUM_DOCKER_VERSION),$(DOCKER_VERSION)),true)
CONTAINER_CLI = docker
else
$(error "Docker version $(DOCKER_VERSION) is too old! Minimum required: $(MINIMUM_DOCKER_VERSION)")
endif
else ifeq ($(call version_ge,$(MINIMUM_PODMAN_VERSION),$(PODMAN_VERSION)),true)
CONTAINER_CLI = podman
else
$(error "Podman version $(PODMAN_VERSION) is too old! Minimum required: $(MINIMUM_PODMAN_VERSION)")
endif
build:
COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 $(CONTAINER_CLI) compose --profile=whisper-asr build
run:
$(CONTAINER_CLI) compose up -d
run-local-whisper-cpu:
$(CONTAINER_CLI) compose --profile cpu up -d
run-local-whisper-gpu:
$(CONTAINER_CLI) compose --profile gpu up -d
rasa-train:
$(CONTAINER_CLI) compose exec rasa rasa train
$(CONTAINER_CLI) compose restart rasa
destroy:
$(CONTAINER_CLI) compose --profile cpu --profile gpu down