Skip to content

Commit b06b33e

Browse files
authored
Deprecate 'make pull', add 'make dev.pull.<service>' (openedx-unsupported#449)
Running 'make pull' is rarely required, as it pulls ALL images. Few devs need every single devstack Docker image. Discourage its use by "soft-deprecating" it, directing devs to new dev.pull.<serivce> instead, which pulls only a service and its dependencies' images. Add bare 'make dev.pull' to retain 'make pull' functionality when necessary.
1 parent f4c328a commit b06b33e

5 files changed

Lines changed: 56 additions & 13 deletions

File tree

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ before_install:
3333

3434
- make requirements
3535
- make dev.clone
36-
- if [[ $DEVSTACK == 'lms' ]]; then make pull; fi
36+
- if [[ $DEVSTACK == 'lms' ]]; then make dev.pull; fi
3737
- if [[ $DEVSTACK == 'analytics_pipeline' ]]; then make dev.up.analytics_pipeline; fi
3838

3939
script:

Makefile

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ dev.status: ## Prints the status of all git repositories
7171
dev.repo.reset: ## Attempts to reset the local repo checkouts to the master working state
7272
$(WINPTY) bash ./repo.sh reset
7373

74+
dev.pull: ## Pull *all* required Docker images. Consider `make dev.pull.<service>` instead.
75+
docker-compose pull
76+
77+
dev.pull.%: ## Pull latest Docker images for a given service and all its dependencies
78+
docker-compose pull --include-deps $*
79+
7480
dev.up: | check-memory ## Bring up all services with host volumes
7581
bash -c 'docker-compose -f docker-compose.yml -f docker-compose-host.yml -f docker-compose-themes.yml up -d'
7682
@# Comment out this next line if you want to save some time and don't care about catalog programs
@@ -134,8 +140,40 @@ xqueue-logs: ## View logs from containers running in detached mode
134140
xqueue_consumer-logs: ## View logs from containers running in detached mode
135141
docker-compose -f docker-compose-xqueue.yml logs -f xqueue_consumer
136142

137-
pull: ## Update Docker images
138-
docker-compose pull
143+
RED="\033[0;31m"
144+
YELLOW="\033[0;33m"
145+
GREY="\033[1;90m"
146+
NO_COLOR="\033[0m"
147+
148+
pull: dev.pull
149+
@echo -n $(RED)
150+
@echo "******************* PLEASE NOTE ********************************"
151+
@echo -n $(YELLOW)
152+
@echo "The 'make pull' command is deprecated."
153+
@echo "Please use 'make dev.pull.<service>'."
154+
@echo "It will pull all the images that the given serivce depends upon."
155+
@echo "Example: "
156+
@echo "----------------------------------"
157+
@echo -n $(GREY)
158+
@echo "~/devstack$$ make dev.pull.lms"
159+
@echo " Pulling chrome ... done"
160+
@echo " Pulling firefox ... done"
161+
@echo " Pulling memcached ... done"
162+
@echo " Pulling mongo ... done"
163+
@echo " Pulling mysql ... done"
164+
@echo " Pulling elasticsearch ... done"
165+
@echo " Pulling discovery ... done"
166+
@echo " Pulling forum ... done"
167+
@echo " Pulling devpi ... done"
168+
@echo " Pulling lms ... done"
169+
@echo "~/devstack$$"
170+
@echo -n $(YELLOW)
171+
@echo "----------------------------------"
172+
@echo "If you must pull all images, such as for initial"
173+
@echo "provisioning, run 'make dev.pull'."
174+
@echo -n $(RED)
175+
@echo "****************************************************************"
176+
@echo -n $(NO_COLOR)
139177

140178
pull.xqueue: ## Update XQueue Docker images
141179
docker-compose -f docker-compose-xqueue.yml pull

README.rst

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ below, run the following sequence of commands if you want to use the most up-to-
6464
.. code:: sh
6565
6666
make down
67-
make pull
67+
make dev.pull
6868
make dev.up
6969
7070
This will stop any running devstack containers, pull the latest images, and then start all of the devstack containers.
@@ -106,7 +106,7 @@ a minimum of 2 CPUs and 8GB of memory does work.
106106

107107
.. code:: sh
108108
109-
make pull
109+
make dev.pull
110110
111111
4. Run the provision command, if you haven't already, to configure the various
112112
services with superusers (for development without the auth service) and
@@ -230,7 +230,7 @@ analyticstack ( e.g. lms, studio etc ) consider setting higher memory.
230230

231231
.. code:: sh
232232
233-
make pull
233+
make dev.pull
234234
make pull.analytics_pipeline
235235
236236
3. Run the provision command to configure the analyticstack.
@@ -343,6 +343,11 @@ Credentials, etc:
343343
344344
make dev.up.lms
345345
346+
Similarly, ``make dev.pull`` can take a long time, as it pulls all services' images,
347+
whether or not you need them.
348+
To instead only pull images required by your service and its dependencies,
349+
run ``make dev.pull.<service>``.
350+
346351
Sometimes you may need to restart a particular application server. To do so,
347352
simply use the ``docker-compose restart`` command:
348353

@@ -447,7 +452,7 @@ How do I run the images for a named Open edX release?
447452
2. Use ``make dev.checkout`` to check out the correct branch in the local
448453
checkout of each service repository once you've set the ``OPENEDX_RELEASE``
449454
environment variable above.
450-
3. ``make pull`` to get the correct images.
455+
3. ``make dev.pull`` to get the correct images.
451456

452457
All ``make`` target and ``docker-compose`` calls should now use the correct
453458
images until you change or unset ``OPENEDX_RELEASE`` again. To work on the
@@ -552,7 +557,7 @@ starts, you have a few options:
552557

553558
* Merge your updated requirements files and wait for a new `edxops Docker image`_
554559
for that service to be built and uploaded to `Docker Hub`_. You can
555-
then download and use the updated image (for example, via ``make pull``).
560+
then download and use the updated image (for example, via ``make dev.pull.<service>``).
556561
The discovery and edxapp images are built automatically via a Jenkins job. All other
557562
images are currently built as needed by edX employees, but will soon be built
558563
automatically on a regular basis. See `How do I build images?`_
@@ -629,7 +634,7 @@ database migrations and package updates.
629634
When switching to a branch which differs greatly from the one you've been
630635
working on (especially if the new branch is more recent), you may wish to
631636
halt the existing containers via ``make down``, pull the latest Docker
632-
images via ``make pull``, and then re-run ``make dev.provision`` or
637+
images via ``make dev.pull.<service>``, and then re-run ``make dev.provision`` or
633638
``make dev.sync.provision`` in order to recreate up-to-date databases,
634639
static assets, etc.
635640

@@ -817,7 +822,7 @@ directory:
817822

818823
.. code:: sh
819824
820-
make pull
825+
make dev.pull
821826
822827
Pull the latest Docker Compose configuration and provisioning scripts by running
823828
the following command from the devstack directory:
@@ -926,7 +931,7 @@ No space left on device
926931
If you see the error ``no space left on device`` on a Mac, Docker has run
927932
out of space in its Docker.qcow2 file.
928933

929-
Here is an example error while running ``make pull``:
934+
Here is an example error while running ``make dev.pull``:
930935

931936
.. code:: sh
932937

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ build_script:
2626
- md X:\devstack
2727
- "\"%ProgramFiles%/Git/bin/bash.exe\" -c \"make dev.clone\""
2828
# Stop here until we get provisioning to finish reliably
29-
#- "\"%ProgramFiles%/Git/bin/bash.exe\" -c \"make pull\""
29+
#- "\"%ProgramFiles%/Git/bin/bash.exe\" -c \"make dev.pull\""
3030

3131
test_script:
3232
- "\"%ProgramFiles%/Git/bin/bash.exe\" -c \"make help\""

scripts/Jenkinsfiles/snapshot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pipeline {
1616
dir('devstack') {
1717
sh 'make requirements'
1818
sh 'make dev.clone'
19-
sh 'make pull'
19+
sh 'make dev.pull'
2020
sh 'make dev.provision'
2121
sh 'python scripts/snapshot.py ../devstack_snapshot'
2222
}

0 commit comments

Comments
 (0)