@@ -38,41 +38,43 @@ include options.mk
38
38
-include local.mk # Prefix with hyphen to tolerate absence of file.
39
39
40
40
# Docker Compose YAML files to define services and their volumes.
41
+ # This environment variable tells `docker-compose` which files to load definitions
42
+ # of services, volumes, and networks from.
41
43
# Depending on the value of FS_SYNC_STRATEGY, we use a slightly different set of
42
44
# files, enabling use of different strategies to synchronize files between the host and
43
45
# the containers.
44
46
# Some services are only available for certain values of FS_SYNC_STRATEGY.
45
47
# For example, the LMS/Studio asset watchers are only available for local-mounts and nfs,
46
48
# and XQueue and the Analytics Pipeline are only available for local-mounts.
47
49
50
+ # Compose files are separated by a colon.
51
+ COMPOSE_PATH_SEPARATOR := :
52
+
48
53
ifeq ($(FS_SYNC_STRATEGY ) ,local-mounts)
49
- DOCKER_COMPOSE_FILES := \
50
- -f docker-compose-host.yml \
51
- -f docker-compose-themes.yml \
52
- -f docker-compose-watchers.yml \
53
- -f docker-compose-xqueue.yml \
54
- -f docker-compose-analytics-pipeline.yml \
55
- -f docker-compose-marketing-site.yml
54
+ COMPOSE_FILE := docker-compose-host.yml
55
+ COMPOSE_FILE := $(COMPOSE_FILE ) :docker-compose-themes.yml
56
+ COMPOSE_FILE := $(COMPOSE_FILE ) :docker-compose-watchers.yml
57
+ COMPOSE_FILE := $(COMPOSE_FILE ) :docker-compose-xqueue.yml
58
+ COMPOSE_FILE := $(COMPOSE_FILE ) :docker-compose-analytics-pipeline.yml
59
+ COMPOSE_FILE := $(COMPOSE_FILE ) :docker-compose-marketing-site.yml
56
60
endif
57
61
58
62
ifeq ($(FS_SYNC_STRATEGY ) ,nfs)
59
- DOCKER_COMPOSE_FILES := \
60
- -f docker-compose-host-nfs.yml \
61
- -f docker-compose-themes-nfs.yml \
62
- -f docker-compose-watchers-nfs.yml
63
+ COMPOSE_FILE := docker-compose-host-nfs.yml
64
+ COMPOSE_FILE := $(COMPOSE_FILE ) :docker-compose-themes-nfs.yml
65
+ COMPOSE_FILE := $(COMPOSE_FILE ) :docker-compose-watchers-nfs.yml
63
66
endif
64
67
65
68
ifeq ($(FS_SYNC_STRATEGY ) ,docker-sync)
66
- DOCKER_COMPOSE_FILES := \
67
- -f docker-compose-sync.yml
69
+ COMPOSE_FILE := docker-compose-sync.yml
68
70
endif
69
71
70
- ifndef DOCKER_COMPOSE_FILES
72
+ ifndef COMPOSE_FILE
71
73
$(error FS_SYNC_STRATEGY is set to $(FS_SYNC_STRATEGY ) . Must be one of : local-mounts, nfs, docker-sync)
72
74
endif
73
75
74
76
# All three filesystem synchronization strategy require the main docker-compose.yml file.
75
- DOCKER_COMPOSE_FILES := -f docker-compose.yml $( DOCKER_COMPOSE_FILES )
77
+ COMPOSE_FILE := docker-compose.yml: $( COMPOSE_FILE )
76
78
77
79
OS := $(shell uname)
78
80
@@ -112,10 +114,10 @@ upgrade: ## Upgrade requirements with pip-tools
112
114
pip-compile --upgrade -o requirements/base.txt requirements/base.in
113
115
114
116
dev.print-container.% : # # Get the ID of the running container for a given service. Run with ``make --silent`` for just ID.
115
- @echo $$(docker-compose $( DOCKER_COMPOSE_FILES ) ps --quiet $* )
117
+ @echo $$(docker-compose ps --quiet $* )
116
118
117
119
dev.ps : # # View list of created services and their statuses.
118
- docker-compose $( DOCKER_COMPOSE_FILES ) ps
120
+ docker-compose ps
119
121
120
122
dev.checkout : # # Check out "openedx-release/$OPENEDX_RELEASE" in each repo if set, "master" otherwise
121
123
./repo.sh checkout
@@ -154,21 +156,21 @@ dev.repo.reset: ## Attempts to reset the local repo checkouts to the master work
154
156
dev.pull : dev.pull.$(DEFAULT_SERVICES ) # # Pull Docker images required by default services.
155
157
156
158
dev.pull.without-deps.% : # # Pull latest Docker images for services (separated by plus-signs).
157
- docker-compose $( DOCKER_COMPOSE_FILES ) pull $$(echo $* | tr + " " )
159
+ docker-compose pull $$(echo $* | tr + " " )
158
160
159
161
dev.pull.% : # # Pull latest Docker images for services (separated by plus-signs) and all their dependencies.
160
- docker-compose $( DOCKER_COMPOSE_FILES ) pull --include-deps $$(echo $* | tr + " " )
162
+ docker-compose pull --include-deps $$(echo $* | tr + " " )
161
163
162
164
dev.up : dev.up.$(DEFAULT_SERVICES ) check-memory # # Bring up default services.
163
165
164
166
dev.up.% : | check-memory # # Bring up specific services (separated by plus-signs) and their dependencies with host volumes.
165
- docker-compose $( DOCKER_COMPOSE_FILES ) up -d $$(echo $* | tr + " " )
167
+ docker-compose up -d $$(echo $* | tr + " " )
166
168
ifeq ($(ALWAYS_CACHE_PROGRAMS ) ,true)
167
169
make dev.cache-programs
168
170
endif
169
171
170
172
dev.up.without-deps.% : # # Bring up specific services (separated by plus-signs) without dependencies.
171
- docker-compose $( DOCKER_COMPOSE_FILES ) up --d --no-deps $$(echo $* | tr + " " )
173
+ docker-compose up --d --no-deps $$(echo $* | tr + " " )
172
174
173
175
dev.up.with-programs : dev.up dev.cache-programs # # Bring up a all services and cache programs in LMS.
174
176
@@ -209,10 +211,10 @@ provision: | dev.provision ## This command will be deprecated in a future releas
209
211
210
212
dev.stop : # # Stop all services.
211
213
(test -d .docker-sync && docker-sync stop) || true # # Ignore failure here
212
- docker-compose $( DOCKER_COMPOSE_FILES ) stop
214
+ docker-compose stop
213
215
214
216
dev.stop.% : # # Stop specific services, separated by plus-signs.
215
- docker-compose $( DOCKER_COMPOSE_FILES ) stop $$(echo $* | tr + " " )
217
+ docker-compose stop $$(echo $* | tr + " " )
216
218
217
219
stop : dev.stop.$(DEFAULT_SERVICES )
218
220
@@ -224,31 +226,31 @@ stop.xqueue: dev.stop.xqueue+xqueue_consumer
224
226
225
227
dev.kill : # # Kill all services.
226
228
(test -d .docker-sync && docker-sync stop) || true # # Ignore failure here
227
- docker-compose $( DOCKER_COMPOSE_FILES ) stop
229
+ docker-compose stop
228
230
229
231
dev.kill.% : # # Kill specific services, separated by plus-signs.
230
- docker-compose $( DOCKER_COMPOSE_FILES ) kill $$(echo $* | tr + " " )
232
+ docker-compose kill $$(echo $* | tr + " " )
231
233
232
234
dev.rm-stopped : # # Remove stopped containers. Does not affect running containers.
233
- docker-compose $( DOCKER_COMPOSE_FILES ) rm --force
235
+ docker-compose rm --force
234
236
235
237
dev.down.% : # # Stop and remove specific services, separated by plus-signs.
236
- docker-compose $( DOCKER_COMPOSE_FILES ) rm --force --stop $$(echo $* | tr + " " )
238
+ docker-compose rm --force --stop $$(echo $* | tr + " " )
237
239
238
240
dev.down : # # Stop and remove all service containers and networks
239
241
(test -d .docker-sync && docker-sync clean) || true # # Ignore failure here
240
- docker-compose $( DOCKER_COMPOSE_FILES ) down
242
+ docker-compose down
241
243
242
244
down : dev.down
243
245
244
246
destroy : # # Remove all devstack-related containers, networks, and volumes
245
247
$(WINPTY ) bash ./destroy.sh
246
248
247
249
logs : # # View logs from containers running in detached mode
248
- docker-compose $( DOCKER_COMPOSE_FILES ) logs -f
250
+ docker-compose logs -f
249
251
250
252
% -logs : # # View the logs of the specified service container
251
- docker-compose $( DOCKER_COMPOSE_FILES ) logs -f --tail=500 $*
253
+ docker-compose logs -f --tail=500 $*
252
254
253
255
RED ="\033[0;31m"
254
256
YELLOW ="\033[0;33m"
@@ -418,7 +420,7 @@ dev.up.analytics_pipeline: dev.up.analyticspipeline ## Bring up analytics pipeli
418
420
pull.analytics_pipeline : dev.pull.analyticspipeline # # Update analytics pipeline docker images
419
421
420
422
analytics-pipeline-devstack-test : # # Run analytics pipeline tests in travis build
421
- docker-compose $( DOCKER_COMPOSE_FILES ) exec -u hadoop -T analyticspipeline 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'
423
+ docker-compose exec -u hadoop -T analyticspipeline 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'
422
424
423
425
stop.analytics_pipeline : dev.stop.namenode+datanode+resourcemanager+nodemanager+sparkmaster+sparkworker+vertica+analyticspipeline # # Stop all Analytics pipeline services.
424
426
0 commit comments