-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathMakefile
81 lines (63 loc) · 1.86 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
help:
@cat Makefile
THREADS=
GPU?=0
HOST=$(shell hostname)
RESTART?=always
UID:=$(shell bash -c 'echo $$RANDOM')
LOCATION?=zec-us1.dwarfpool.com
PORT?=3335
ADDRESS?=t1QLFf7cemqpxPxFHL5tmtncbzUe7W7AqX8
DOCKER_FILE=Dockerfile
DOCKER?=nvidia-docker
TAG=nheqminer
NAME?=${HOST}_${UID}
define colorecho
@tput setaf $2
@echo $1
@tput sgr0
endef
ifneq ($THREADS,)
$THREADS:="-t ${THREADS}"
endif
NHEQ_FLAGS?=-l ${LOCATION}:${PORT} -u ${ADDRESS}.${NAME} -cd ${GPU} ${THREADS}
DOCKER_FLAGS=--restart ${RESTART} -i -d -h nheqminer --name ${NAME} unsalted/nheqminer
FLAGS?=$(NHEQ_FLAGS)
bash:
$(DOCKER) run -it -h nheqminer unsalted/$(TAG) bash
run:
$(DOCKER) run $(DOCKER_FLAGS) nheqminer $(NHEQ_FLAGS)
$(call colorecho,"\n\
Pool: ${LOCATION}\n\
Port: ${PORT}\n\
Address: ${ADDRESS}\n\
User: ${NAME}\n\
",6)
$(call colorecho, "Showing logs... exit with ctrl+c",7)
$(call colorecho, "Kill and delete machine with \`docker kill ${NAME} && docker rm ${NAME}\`\n",3)
docker logs -f ${NAME}
cpu:
DOCKER_FLAGS=--restart ${RESTART} -i -d -h nheqminer --name ${NAME} unsalted/nheqminer:cpu
docker run $(DOCKER_FLAGS) nheqminer $(NHEQ_FLAGS)
$(call colorecho,"\n\
Pool: ${LOCATION}\n\
Port: ${PORT}\n\
Address: ${ADDRESS}\n\
User: ${NAME}\n\
",6)
$(call colorecho, "Showing logs... exit with ctrl+c",7)
$(call colorecho, "Kill and delete machine with \`docker kill ${NAME} && docker rm ${NAME}\`\n",3)
docker logs -f ${NAME}
nheqminer:
$(DOCKER) run $(DOCKER_FLAGS) nheqminer ${FLAGS}
$(call colorecho,"\n\
Pool: ${LOCATION}\n\
Port: ${PORT}\n\
Address: ${ADDRESS}\n\
User: ${NAME}\n\
",6)
$(call colorecho, "Showing logs... exit with ctrl+c",7)
$(call colorecho, "Kill and delete machine with \`docker kill ${NAME} && docker rm ${NAME}\`\n",3)
docker logs -f ${NAME}
info:
$(DOCKER) run --rm -it -h nheqminer unsalted/$(TAG) nheqminer -ci