-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
133 lines (109 loc) · 2.68 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# We must allow others exactly use our script without modification
# Or its not replicable by others.
#
REGISTRY=docker.io
REPOSITORY=centerforopenneuroscience
IMAGE_NAME=abi-connectivity
IMAGE_TAG=0.0.1
FQDN_IMAGE=${REGISTRY}/${REPOSITORY}/${IMAGE_NAME}:${IMAGE_TAG}
# PATH for scratch directory storing intermidiate results etc;
# By default -- all data including intermediate results are under this folder (YODA!)
OCI_BINARY?=podman
RELEASE_VERSION?=9999
RESOLUTION?=100 # specified in microns
SING_BINARY?=singularity
PACKAGE_NAME=ABI-connectivity-data
DISTFILE_CACHE_CMD :=
check_defined = \
$(strip $(foreach 1,$1, \
$(call __check_defined,$1,$(strip $(value 2)))))
__check_defined = \
$(if $(value $1),, \
$(error Undefined $1$(if $2, ($2))))
ifeq ($(DISTFILE_CACHE_PATH),)
# If not set, don't add it as an option
else
DISTFILE_CACHE_CMD =-v $(DISTFILE_CACHE_PATH):/var/cache/distfiles
endif
.PHONY: bidsdata
bidsdata:
python code/abi_connectivity.py \
--version=${RELEASE_VERSION} \
--resolution=${RESOLUTION} \
--bids-only
.PHONY: bidsdata-oci
bidsdata-oci:
$(OCI_BINARY) run \
-it \
--rm \
-v ${PWD}:/root/src/ABI-connectivity \
--workdir /root/src/ABI-connectivity \
${FQDN_IMAGE} \
make bidsdata
.PHONY: sourcedata
sourcedata: clean
python code/abi_connectivity.py \
--version=${RELEASE_VERSION} \
--resolution=${RESOLUTION} \
--download-only
.PHONY: sourcedata-oci
sourcedata-oci: clean
$(OCI_BINARY) run \
-it \
--rm \
-v ${PWD}:/root/src/ABI-connectivity \
--workdir /root/src/ABI-connectivity \
${FQDN_IMAGE} \
make sourcedata
.PHONY: procdata
procdata:
python code/abi_connectivity.py \
--version=${RELEASE_VERSION} \
--resolution=${RESOLUTION} \
--process-only
.PHONY: procdata-oci
procdata-oci:
$(OCI_BINARY) run \
-it \
--rm \
-v ${PWD}:/root/src/ABI-connectivity \
--workdir /root/src/ABI-connectivity \
${FQDN_IMAGE} \
make procdata
.PHONY: data
data:
python code/abi_connectivity.py \
--version=${RELEASE_VERSION} \
--resolution=${RESOLUTION}
.PHONY: data-oci
data-oci:
$(OCI_BINARY) run \
-it \
--rm \
-v ${PWD}:/root/src/ABI-connectivity \
--workdir /root/src/ABI-connectivity \
${FQDN_IMAGE} \
make data
.PHONY: data-oci-interactive
data-oci-interactive: clean
$(OCI_BINARY) run \
-it \
--rm \
-v ${PWD}:/root/src/ABI-connectivity \
--workdir /root/src/ABI-connectivity \
${FQDN_IMAGE} \
/bin/bash
# Build data analysis container
.PHONY: oci-image
oci-image:
$(OCI_BINARY) build . $(DISTFILE_CACHE_CMD) \
-f code/Containerfile \
-t ${FQDN_IMAGE}
# Push containers
.PHONY: oci-push
oci-push:
$(OCI_BINARY) push ${FQDN_IMAGE}
# Push containers
.PHONY: clean
clean:
@rm -rf sourcedata/*