-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
101 lines (79 loc) · 2.81 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
ACCOUNT := noelmni
SERVICE := deep-fcd
IMAGE := $(ACCOUNT)/$(SERVICE) # noelmni/deep-fcd
TAG := latest
UID := 2551
GID := 618
CASE_ID := sub-00055
TMPDIR := /host/hamlet/local_raid/data/ravnoor/sandbox
PRED_DIR := /host/hamlet/local_raid/data/ravnoor/sandbox/pytests
BRAIN_MASKING := 1
PREPROCESS := 1
.PHONY: all clean
build:
docker build -t $(ACCOUNT)/$(SERVICE):$(TAG) .
clean-build:
docker build -t $(ACCOUNT)/$(SERVICE):$(TAG) . --no-cache
test-pipeline:
./app/inference.py $(CASE_ID) t1.nii.gz flair.nii.gz $(TMPDIR) cuda0 $(BRAIN_MASKING) $(PREPROCESS)
memray-profiling:
python3 -m memray run ./app/inference.py $(CASE_ID) t1_brain.nii.gz t2_brain.nii.gz $(TMPDIR) cuda0 0 0
memray-profiling-cpu:
python3 -m memray run ./app/inference.py $(CASE_ID) t1_brain.nii.gz t2_brain.nii.gz $(TMPDIR) cpu 0 0
test-preprocess:
./app/preprocess.sh $(CASE_ID) t1.nii.gz flair.nii.gz $(TMPDIR) $(BRAIN_MASKING) $(PREPROCESS)
test-pipeline-docker:
docker run --rm -it --init \
--gpus=all \
--user="$(UID):$(GID)" \
--volume="$(TMPDIR):/tmp" \
$(ACCOUNT)/$(SERVICE):$(TAG) \
/app/inference.py $(CASE_ID) T1.nii.gz FLAIR.nii.gz /tmp cuda0 $(BRAIN_MASKING) $(PREPROCESS)
test-pipeline-docker_ci:
docker run --rm -it --init \
--gpus=all \
--user="$(UID):$(GID)" \
--volume="$(TMPDIR):/tmp" \
--env CI_TESTING=1 \
--env CI_TESTING_GT=/tmp/$(CASE_ID)/label_final_MD.nii.gz \
$(ACCOUNT)/$(SERVICE):$(TAG) \
/app/inference.py $(CASE_ID) T1.nii.gz FLAIR.nii.gz /tmp cuda0 $(BRAIN_MASKING) $(PREPROCESS)
test-pipeline-docker_testing:
docker run --rm -it --init \
--gpus=all \
--user="$(UID):$(GID)" \
--volume="$(PRED_DIR):/tmp" \
--env CI_TESTING=1 \
--env CI_TESTING_PATIENT_ID=$(CASE_ID) \
--env CI_TESTING_PRED_DIR=/tmp \
$(ACCOUNT)/$(SERVICE):$(TAG) \
bash /tests/run_tests.sh
test-reporting:
./app/utils/reporting.py $(CASE_ID) $(TMPDIR)/
install-jupyter-kernel:
python -m ipykernel install --user --name deepFCD
clean:
rm -rf $(TMPDIR)/$(CASE_ID)/{tmp,native,transforms}
rm -f $(TMPDIR)/$(CASE_ID)/{*_final,*denseCrf3d*,*_native,*_maskpred}.nii.gz
docker-clean:
docker run --rm -it --init \
--volume="$(TMPDIR):/tmp" \
busybox:latest \
rm -rf /tmp/$(CASE_ID)/{tmp,native,transforms,noel_deepFCD_dropoutMC} && \
rm -f /tmp/$(CASE_ID)/{*_final,*denseCrf3d*,*_native,*_maskpred}.nii.gz
prune:
docker image prune
runner-build:
docker-compose -f ci/runner.docker-compose.yml build
runner-ps:
docker-compose -f ci/runner.docker-compose.yml ps
runner-up:
docker-compose -f ci/runner.docker-compose.yml up --remove-orphans -d
runner-down:
docker-compose -f ci/runner.docker-compose.yml down
runner-logs:
docker-compose -f ci/runner.docker-compose.yml logs -f
runner-scale:
docker-compose -f ci/runner.docker-compose.yml up --scale runner=1 -d
runner-bash:
docker-compose -f ci/runner.docker-compose.yml exec -it runner bash