28
28
xqueue_consumer-restart xqueue_consumer-shell xqueue-logs \
29
29
xqueue-restart xqueue-shell
30
30
31
+ # Docker Compose files that define services.
32
+ MAIN_COMPOSE_FILE =-f docker-compose.yml
33
+ XQUEUE_COMPOSE_FILE =-f docker-compose-xqueue.yml
34
+ WATCHERS_COMPOSE_FILE =-f docker-compose-watchers.yml
35
+ WATCHERS_COMPOSE_FILE_FOR_NFS =-f docker-compose-watchers-nfs.yml
36
+ ANALYTICS_COMPOSE_FILE =-f docker-compose-analytics-pipeline.yml
37
+ MARKETING_COMPOSE_FILE =-f docker-compose-marketing-site.yml
38
+
39
+ # Supporting Docker Compose files to enable volume mounting (which allows us to use
40
+ # source code from our host machine) as well as theming.
41
+ SUPPORTING_COMPOSE_FILES =-f docker-compose-host.yml -f docker-compose-themes.yml
42
+ SUPPORTING_COMPOSE_FILES_FOR_NFS =-f docker-compose-host-nfs.yml -f docker-compose-themes-nfs.yml
43
+ SUPPORTING_COMPOSE_FILES_FOR_SYNC =-f docker-compose-sync.yml
44
+
45
+ # "Suites" of Docker Compose files that can be used together to run different
46
+ # sets of services.
47
+ STANDARD_COMPOSE_SUITE =$(MAIN_COMPOSE_FILE ) $(SUPPORTING_COMPOSE_FILES )
48
+ STANDARD_COMPOSE_SUITE_FOR_NFS =$(MAIN_COMPOSE_FILE ) $(SUPPORTING_COMPOSE_FILES_FOR_NFS )
49
+ STANDARD_COMPOSE_SUITE_FOR_SYNC =$(MAIN_COMPOSE_FILE ) $(SUPPORTING_COMPOSE_FILES_FOR_SYNC )
50
+ XQUEUE_COMPOSE_SUITE =$(MAIN_COMPOSE_FILE ) $(XQUEUE_COMPOSE_FILE ) $(SUPPORTING_COMPOSE_FILES )
51
+ ANALYTICS_COMPOSE_SUITE =$(STANDARD_COMPOSE_SUITE ) $(ANALYTICS_COMPOSE_FILE )
52
+
53
+ # All Docker Compose YAML files that contain service definitions.
54
+ # Useful for Makefile targets like `dev.pull` and `down`
55
+ ALL_SERVICE_COMPOSE_FILES =\
56
+ $(MAIN_COMPOSE_FILE ) \
57
+ $(XQUEUE_COMPOSE_FILE ) \
58
+ $(WATCHERS_COMPOSE_FILE ) \
59
+ $(ANALYTICS_COMPOSE_FILE ) \
60
+ $(MARKETING_COMPOSE_FILE )
61
+
62
+ # All Docker Compose files (except those for NFS and Docker Sync).
63
+ FULL_COMPOSE_SUITE =$(ALL_SERVICE_COMPOSE_FILES ) $(SUPPORTING_COMPOSE_FILES )
64
+
31
65
# Include options (configurable through options.local.mk)
32
66
include options.mk
33
67
export
@@ -76,10 +110,10 @@ dev.clone.ssh: ## Clone service repos using SSH method to the parent directory
76
110
./repo.sh clone_ssh
77
111
78
112
dev.provision.services : # # Provision all services with local mounted directories
79
- DOCKER_COMPOSE_FILES=" $( STANDARD_COMPOSE_FILES ) " $(WINPTY ) bash ./provision.sh
113
+ DOCKER_COMPOSE_FILES=" $( STANDARD_COMPOSE_SUITE ) " $(WINPTY ) bash ./provision.sh
80
114
81
115
dev.provision.services.% : # # Provision specified services with local mounted directories, separated by plus signs
82
- DOCKER_COMPOSE_FILES=" $( STANDARD_COMPOSE_FILES ) " $(WINPTY ) bash ./provision.sh $*
116
+ DOCKER_COMPOSE_FILES=" $( STANDARD_COMPOSE_SUITE ) " $(WINPTY ) bash ./provision.sh $*
83
117
84
118
dev.provision : | check-memory dev.clone.ssh dev.provision.services stop # # Provision dev environment with all services stopped
85
119
@@ -89,7 +123,7 @@ dev.cache-programs: ## Copy programs from Discovery to Memcached for use in LMS.
89
123
dev.provision.xqueue : | check-memory dev.provision.xqueue.run stop stop.xqueue # Provision XQueue; run after other services are provisioned
90
124
91
125
dev.provision.xqueue.run :
92
- DOCKER_COMPOSE_FILES=" -f docker-compose.yml -f docker-compose-xqueue.yml " $(WINPTY ) bash ./provision-xqueue.sh
126
+ DOCKER_COMPOSE_FILES=" $( MAIN_COMPOSE_FILE ) $( XQUEUE_COMPOSE_FILE ) " $(WINPTY ) bash ./provision-xqueue.sh
93
127
94
128
dev.reset : | down dev.repo.reset pull dev.up static update-db # # Attempts to reset the local devstack to the master working state
95
129
@@ -106,16 +140,16 @@ dev.pull-without-deps.%: ## Pull latest Docker images for services (separated by
106
140
ARG=$* docker-compose $(ALL_SERVICE_COMPOSE_FILES ) pull $$(echo $* | tr + " " )
107
141
108
142
dev.pull.% : # # Pull latest Docker images for services (separated by plus-signs) and all their dependencies.
109
- docker-compose pull --include-deps $$(echo $* | tr + " " )
143
+ docker-compose $( ALL_SERVICE_COMPOSE_FILES ) pull --include-deps $$(echo $* | tr + " " )
110
144
111
145
dev.up : | check-memory # # Bring up all services with host volumes
112
- bash -c ' docker-compose $(STANDARD_COMPOSE_FILES ) up -d'
146
+ bash -c ' docker-compose $(STANDARD_COMPOSE_SUITE ) up -d'
113
147
ifeq ($(ALWAYS_CACHE_PROGRAMS ) ,true)
114
148
make dev.cache-programs
115
149
endif
116
150
117
151
dev.up.% : | check-memory # # Bring up specific services (separated by plus-signs) and their dependencies with host volumes.
118
- bash -c ' docker-compose $(STANDARD_COMPOSE_FILES ) up -d $$(echo $* | tr + " ")'
152
+ bash -c ' docker-compose $(STANDARD_COMPOSE_SUITE ) up -d $$(echo $* | tr + " ")'
119
153
ifeq ($(ALWAYS_CACHE_PROGRAMS ) ,true)
120
154
make dev.cache-programs
121
155
endif
@@ -127,29 +161,29 @@ dev.up.with-programs.%: ## Bring up a service and its dependencies and cache pro
127
161
make dev.cache-programs
128
162
129
163
dev.up.watchers : | check-memory # # Bring up asset watcher containers
130
- bash -c ' docker-compose -f docker-compose-watchers.yml up -d'
164
+ bash -c ' docker-compose $(WATCHERS_COMPOSE_FILE) up -d'
131
165
132
166
dev.nfs.setup : # # set's up an nfs server on the /Users folder, allowing nfs mounting on docker
133
167
./setup_native_nfs_docker_osx.sh
134
168
135
169
dev.nfs.up.watchers : | check-memory # # Bring up asset watcher containers
136
- docker-compose -f docker-compose-watchers-nfs.yml up -d
170
+ docker-compose $( WATCHERS_COMPOSE_FILE_FOR_NFS ) up -d
137
171
138
172
dev.nfs.up : | check-memory # # Bring up all services with host volumes
139
- docker-compose $(NFS_COMPOSE_FILES ) up -d
173
+ docker-compose $(STANDARD_COMPOSE_SUITE_FOR_NFS ) up -d
140
174
141
175
dev.nfs.up.all : | dev.nfs.up dev.nfs.up.watchers # # Bring up all services with host volumes, including watchers
142
176
143
177
dev.nfs.provision : | check-memory dev.clone dev.nfs.provision.services stop # # Provision dev environment with all services stopped
144
178
145
179
dev.nfs.provision.services : # # Provision all services with local mounted directories
146
- DOCKER_COMPOSE_FILES=" $( NFS_COMPOSE_FILES ) " ./provision.sh
180
+ DOCKER_COMPOSE_FILES=" $( STANDARD_COMPOSE_SUITE_FOR_NFS ) " ./provision.sh
147
181
148
182
dev.nfs.provision.services.% : # # Provision specified services with local mounted directories, separated by plus signs
149
- DOCKER_COMPOSE_FILES=" $( NFS_COMPOSE_FILES ) " ./provision.sh $*
183
+ DOCKER_COMPOSE_FILES=" $( STANDARD_COMPOSE_SUITE_FOR_NFS ) " ./provision.sh $*
150
184
151
185
dev.up.xqueue : | check-memory # # Bring up xqueue, assumes you already have lms running
152
- bash -c ' docker-compose -f docker-compose.yml -f docker-compose-xqueue.yml -f docker-compose-host.yml -f docker-compose-themes.yml up -d'
186
+ bash -c ' docker-compose $(XQUEUE_COMPOSE_SUITE) up -d'
153
187
154
188
dev.up.all : | dev.up dev.up.watchers # # Bring up all services with host volumes, including watchers
155
189
@@ -162,7 +196,7 @@ dev.sync.requirements: ## Install requirements
162
196
gem install docker-sync
163
197
164
198
dev.sync.up : dev.sync.daemon.start # # Bring up all services with docker-sync enabled
165
- docker-compose -f docker-compose.yml -f docker-compose-sync.yml up -d
199
+ docker-compose $( STANDARD_COMPOSE_SUITE_FOR_SYNC ) up -d
166
200
167
201
provision : | dev.provision # # This command will be deprecated in a future release, use dev.provision
168
202
echo " \033[0;31mThis command will be deprecated in a future release, use dev.provision\033[0m"
@@ -172,31 +206,31 @@ stop: ## Stop all services
172
206
docker-compose stop
173
207
174
208
stop.watchers : # # Stop asset watchers
175
- docker-compose -f docker-compose-watchers.yml stop
209
+ docker-compose $( WATCHERS_COMPOSE_FILE ) stop
176
210
177
211
stop.all : | stop.analytics_pipeline stop stop.watchers # # Stop all containers, including asset watchers
178
212
179
213
stop.xqueue : # # Stop the XQueue service container
180
- docker-compose -f docker-compose-xqueue.yml stop
214
+ docker-compose $( XQUEUE_COMPOSE_FILE ) stop
181
215
182
216
down : # # Remove all service containers and networks
183
217
(test -d .docker-sync && docker-sync clean) || true # # Ignore failure here
184
- docker-compose -f docker-compose.yml -f docker-compose-watchers.yml -f docker-compose-xqueue.yml -f docker-compose-analytics-pipeline.yml down
218
+ docker-compose $( ALL_SERVICE_COMPOSE_FILES ) down
185
219
186
220
destroy : # # Remove all devstack-related containers, networks, and volumes
187
221
$(WINPTY ) bash ./destroy.sh
188
222
189
223
logs : # # View logs from containers running in detached mode
190
- docker-compose -f docker-compose.yml -f docker-compose-analytics-pipeline.yml logs -f
224
+ docker-compose $( ALL_SERVICE_COMPOSE_FILES ) logs -f
191
225
192
226
% -logs : # # View the logs of the specified service container
193
- docker-compose -f docker-compose.yml -f docker-compose-analytics-pipeline.yml logs -f --tail=500 $*
227
+ docker-compose $( ALL_SERVICE_COMPOSE_FILES ) logs -f --tail=500 $*
194
228
195
229
xqueue-logs : # # View logs from containers running in detached mode
196
- docker-compose -f docker-compose-xqueue.yml logs -f xqueue
230
+ docker-compose $( XQUEUE_COMPOSE_FILE ) logs -f xqueue
197
231
198
232
xqueue_consumer-logs : # # View logs from containers running in detached mode
199
- docker-compose -f docker-compose-xqueue.yml logs -f xqueue_consumer
233
+ docker-compose $( XQUEUE_COMPOSE_FILE ) logs -f xqueue_consumer
200
234
201
235
RED ="\033[0;31m"
202
236
YELLOW ="\033[0;33m"
@@ -234,7 +268,7 @@ pull: dev.pull
234
268
@echo -n $(NO_COLOR )
235
269
236
270
pull.xqueue : # # Update XQueue Docker images
237
- docker-compose -f docker-compose-xqueue.yml pull
271
+ docker-compose $( XQUEUE_COMPOSE_FILE ) pull
238
272
239
273
validate : # # Validate the devstack configuration
240
274
docker-compose config
@@ -359,28 +393,27 @@ mongo-shell: ## Run a shell on the mongo container
359
393
360
394
# ## analytics pipeline commands
361
395
362
- ANALYTICS_COMPOSE_FILES =$(STANDARD_COMPOSE_FILES ) -f docker-compose-analytics-pipeline.yml
363
396
364
397
dev.provision.analytics_pipeline : | check-memory dev.provision.analytics_pipeline.run stop.analytics_pipeline stop # # Provision analyticstack dev environment with all services stopped
365
398
echo " Ran dev.provision.analytics_pipeline"
366
399
367
400
dev.provision.analytics_pipeline.run :
368
- DOCKER_COMPOSE_FILES=" $( ANALYTICS_COMPOSE_FILES ) " ./provision-analytics-pipeline.sh
401
+ DOCKER_COMPOSE_FILES=" $( ANALYTICS_COMPOSE_SUITE ) " ./provision-analytics-pipeline.sh
369
402
370
403
analytics-pipeline-shell : # # Run a shell on the analytics pipeline container
371
404
docker exec -it edx.devstack.analytics_pipeline env TERM=$(TERM ) /edx/app/analytics_pipeline/devstack.sh open
372
405
373
406
dev.up.analytics_pipeline : | check-memory # # Bring up analytics pipeline services
374
- bash -c ' docker-compose $(ANALYTICS_COMPOSE_FILES ) up -d analyticspipeline'
407
+ bash -c ' docker-compose $(ANALYTICS_COMPOSE_SUITE ) up -d analyticspipeline'
375
408
376
409
pull.analytics_pipeline : # # Update analytics pipeline docker images
377
- docker-compose -f docker-compose.yml -f docker-compose-analytics-pipeline.yml pull
410
+ docker-compose $( ANALYTICS_COMPOSE_SUITE ) pull
378
411
379
412
analytics-pipeline-devstack-test : # # Run analytics pipeline tests in travis build
380
413
docker exec -u hadoop -i edx.devstack.analytics_pipeline bash -c ' sudo chown -R hadoop:hadoop /edx/app/analytics_pipeline && source /edx/app/hadoop/.bashrc && make develop-local && make docker-test-acceptance-local ONLY_TESTS=edx.analytics.tasks.tests.acceptance.test_internal_reporting_database && make docker-test-acceptance-local ONLY_TESTS=edx.analytics.tasks.tests.acceptance.test_user_activity'
381
414
382
415
stop.analytics_pipeline : # # Stop analytics pipeline services
383
- docker-compose -f docker-compose.yml -f docker-compose-analytics-pipeline.yml stop
416
+ docker-compose $( ANALYTICS_COMPOSE_SUITE ) stop
384
417
docker-compose up -d mysql # # restart mysql as other containers need it
385
418
386
419
hadoop-application-logs-% : # # View hadoop logs by application Id
@@ -407,3 +440,5 @@ stats: ## Get per-container CPU and memory utilization data
407
440
feature-toggle-state : # # Gather the state of feature toggles configured for various IDAs
408
441
$(WINPTY ) bash ./gather-feature-toggle-state.sh
409
442
443
+ selfcheck : # # check that the Makefile is well-formed
444
+ @echo " The Makefile is well-formed."
0 commit comments