Skip to content

Commit ab0613c

Browse files
committed
add optional argument for m1
1 parent 33dabc6 commit ab0613c

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

dev/local/Makefile

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,15 @@
3737
# test= Only runs tests in the directories provided here, e.g.
3838
# repos/delphi/delphi-epidata/tests/acquisition/covidcast
3939
# sql= Overrides the default SQL connection string.
40-
40+
# m1=1 Mandatory if your local system uses Apple M1 chip
4141

4242
# Set optional argument defaults
43+
ifdef m1
44+
override m1 =--platform linux/amd64
45+
endif
46+
4347
ifdef pdb
44-
override pdb=--pdb
48+
override =--pdb
4549
else
4650
pdb=
4751
endif
@@ -81,13 +85,13 @@ web:
8185
@# Build the web_epidata image
8286
@cd repos/delphi/delphi-epidata;\
8387
docker build -t delphi_web_epidata\
84-
--platform linux/amd64\
88+
$(m1) \
8589
-f ./devops/Dockerfile .;\
8690
cd -
8791

8892
@# Run the web server
8993
@docker run --rm -p 127.0.0.1:10080:80 \
90-
--platform linux/amd64\
94+
$(m1) \
9195
--env "SQLALCHEMY_DATABASE_URI=$(sqlalchemy_uri)" \
9296
--env "FLASK_SECRET=abc" --env "FLASK_PREFIX=/epidata" --env "LOG_DEBUG" \
9397
--network delphi-net --name delphi_web_epidata \
@@ -105,12 +109,12 @@ db:
105109

106110
@# Build the database_epidata image
107111
@docker build -t delphi_database_epidata \
108-
--platform linux/amd64\
112+
$(m1) \
109113
-f repos/delphi/delphi-epidata/dev/docker/database/epidata/Dockerfile .
110114

111115
@# Run the database
112116
@docker run --rm -p 127.0.0.1:13306:3306 \
113-
--platform linux/amd64\
117+
$(m1) \
114118
--network delphi-net --name delphi_database_epidata \
115119
--cap-add=sys_nice \
116120
delphi_database_epidata >$(LOG_DB) 2>&1 &
@@ -125,7 +129,7 @@ db:
125129
.PHONY=py
126130
py:
127131
@docker build -t delphi_web_python \
128-
--platform linux/amd64\
132+
$(m1) \
129133
-f repos/delphi/delphi-epidata/dev/docker/python/Dockerfile .
130134

131135
.PHONY=all
@@ -134,7 +138,7 @@ all: db web py
134138
.PHONY=test
135139
test:
136140
@docker run -i --rm --network delphi-net \
137-
--platform linux/amd64\
141+
$(m1) \
138142
--mount type=bind,source=$(CWD)repos/delphi/delphi-epidata,target=/usr/src/app/repos/delphi/delphi-epidata,readonly \
139143
--mount type=bind,source=$(CWD)repos/delphi/delphi-epidata/src,target=/usr/src/app/delphi/epidata,readonly \
140144
--env "SQLALCHEMY_DATABASE_URI=$(sqlalchemy_uri)" \
@@ -144,7 +148,7 @@ test:
144148
.PHONY=bash
145149
bash:
146150
@docker run -it --rm --network delphi-net \
147-
--platform linux/amd64\
151+
$(m1) \
148152
--mount type=bind,source=$(CWD)repos/delphi/delphi-epidata,target=/usr/src/app/repos/delphi/delphi-epidata,readonly \
149153
--mount type=bind,source=$(CWD)repos/delphi/delphi-epidata/src,target=/usr/src/app/delphi/epidata,readonly \
150154
--env "SQLALCHEMY_DATABASE_URI=$(sqlalchemy_uri)" \

0 commit comments

Comments
 (0)