-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile
56 lines (45 loc) · 1.05 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
include .env
export USER_ID := $(shell id -u)
export USER_NAME := $(shell whoami)
export PROJECT_DIR := $(shell pwd)
export COMPOSE_CMD := docker-compose -f docker-compose.yaml -p ${PROJECT_NAME}_${USER_NAME}
export PKG_DIR := pkg
# Enable running e3k on machines with no GPU
ifeq (${GPU_IDS}, none)
export RUNTIME := runc
else
export RUNTIME := nvidia
endif
# Enable pulling in dependencies in private repos
ifneq (${PRIVATE_DEPS}, none)
clone_private_deps := for item in ${PRIVATE_DEPS}; do \
git clone $$item ${PKG_DIR}/$$item; \
echo $$item; \
done
else
clone_private_deps := echo "Nothing to clone"
endif
.PHONY: build
build:
mkdir -p ${PKG_DIR}
$(call clone_private_deps)
$(COMPOSE_CMD) build
rm -rf ${PKG_DIR}
.PHONY: logs
logs:
${COMPOSE_CMD} logs
.PHONY: up
up:
$(COMPOSE_CMD) up --detach
.PHONY: down
down:
$(COMPOSE_CMD) down
.PHONY: repl
repl:
${COMPOSE_CMD} exec repl python3 $(run)
.PHONY: ipython
ipython:
${COMPOSE_CMD} exec repl ipython $(run)
.PHONY: shell
shell:
${COMPOSE_CMD} exec repl bash