Skip to content
This repository was archived by the owner on Aug 1, 2024. It is now read-only.

Commit ee83c2e

Browse files
committed
Added Support for Docker Sync
Docker Sync will alleviate some of the filesystem issues on OS X.
1 parent 47e1802 commit ee83c2e

File tree

6 files changed

+104
-11
lines changed

6 files changed

+104
-11
lines changed

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,11 @@ devstack.provision: ## Provision all services
2929
devstack.reset: ## Remove all service containers
3030
docker-compose down
3131

32-
devstack.start: ## Start all services
33-
docker-compose up
32+
devstack.start: ## Start all services (with host volumes)
33+
docker-compose -f docker-compose.yml -f docker-compose-host.yml up
34+
35+
devstack.start.sync: ## Start all services (with docker-sync)
36+
docker-sync-stack start
3437

3538
devstack.stop: ## Stop all services
3639
docker-compose stop

README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ configure Docker with a sufficient amount of resources. Our testing found that [
4242
$ make devstack.provision
4343
```
4444

45-
3. Start the services.
45+
3. Start the services. By default this command will use host directories for source code. This is known to be slow on
46+
macOS. macOS users should follow the steps below for Docker Sync to avoid this performance hit.
4647

4748
```
4849
$ make devstack.start
@@ -55,6 +56,25 @@ For example to access the Catalog/Course Discovery Service, you can run:
5556
$ make devstack.open.discovery
5657
```
5758

59+
### Docker Sync
60+
61+
Docker for Mac has known filesystem issues that significantly decrease performance. In order to mitigate these issues,
62+
we use [Docker Sync](https://github.com/EugenMayer/docker-sync/wiki) to synchronize file data from the host machine to
63+
the containers. Follow the steps below to setup Docker Sync.
64+
65+
1. Ensure all containers are stopped.
66+
```
67+
$ make devstack.stop
68+
```
69+
70+
2. Follow the installation instructions at https://github.com/EugenMayer/docker-sync/wiki to install Docker Sync.
71+
72+
3. Run Docker Sync and devstack.
73+
```
74+
$ make devstack.start.sync
75+
```
76+
77+
5878
## Usernames and Passwords
5979

6080
The provisioning script creates a Django superuser for every service.

docker-compose-host.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: "2.1"
2+
3+
services:
4+
credentials:
5+
volumes:
6+
- ../credentials:/edx/app/credentials/credentials
7+
discovery:
8+
volumes:
9+
- ../course-discovery:/edx/app/discovery/discovery
10+
ecommerce:
11+
volumes:
12+
- ../ecommerce:/edx/app/ecommerce/ecommerce
13+
edxapp:
14+
volumes:
15+
- ../edx-platform:/edx/app/edxapp/edx-platform

docker-compose-sync.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
version: "2.1"
2+
3+
services:
4+
credentials:
5+
volumes:
6+
- credentials-sync:/edx/app/credentials/credentials:rw
7+
discovery:
8+
volumes:
9+
- discovery-sync:/edx/app/discovery/discovery:rw
10+
ecommerce:
11+
volumes:
12+
- ecommerce-sync:/edx/app/ecommerce/ecommerce:rw
13+
edxapp:
14+
volumes:
15+
- edxapp-sync:/edx/app/edxapp/edx-platform:rw
16+
17+
volumes:
18+
credentials-sync:
19+
external: true
20+
discovery-sync:
21+
external: true
22+
ecommerce-sync:
23+
external: true
24+
edxapp-sync:
25+
external: true

docker-compose.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ services:
6666
image: edxops/credentials:devstack
6767
ports:
6868
- "18150:18150"
69-
volumes:
70-
- ../credentials:/edx/app/credentials/credentials
7169

7270
discovery:
7371
command: /edx/app/discovery/devstack.sh start
@@ -82,8 +80,6 @@ services:
8280
image: edxops/discovery:devstack
8381
ports:
8482
- "18381:18381"
85-
volumes:
86-
- ../course-discovery:/edx/app/discovery/discovery
8783

8884
ecommerce:
8985
command: /edx/app/ecommerce/devstack.sh start
@@ -97,8 +93,6 @@ services:
9793
image: edxops/ecommerce:devstack
9894
ports:
9995
- "18130:18130"
100-
volumes:
101-
- ../ecommerce:/edx/app/ecommerce/ecommerce
10296

10397
edxapp:
10498
command: /edx/app/edxapp/devstack.sh start
@@ -111,8 +105,6 @@ services:
111105
ports:
112106
- "18000:18000"
113107
- "18010:18010"
114-
volumes:
115-
- ../edx-platform:/edx/app/edxapp/edx-platform
116108

117109
volumes:
118110
elasticsearch_data:

docker-sync.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
version: "2"
2+
3+
options:
4+
compose-file-path: 'docker-compose.yml'
5+
compose-dev-file-path: 'docker-compose-sync.yml'
6+
7+
syncs:
8+
credentials-sync:
9+
src: '../credentials/'
10+
dest: '/edx/app/credentials/credentials'
11+
sync_args: '-v --copy-links --hard-links'
12+
sync_host_ip: 'localhost'
13+
sync_host_port: 10872
14+
sync_strategy: 'rsync'
15+
16+
discovery-sync:
17+
src: '../course-discovery/'
18+
dest: '/edx/app/discovery/discovery'
19+
sync_args: '-v --copy-links --hard-links'
20+
sync_host_ip: 'localhost'
21+
sync_host_port: 10873
22+
sync_strategy: 'rsync'
23+
24+
ecommerce-sync:
25+
src: '../ecommerce/'
26+
dest: '/edx/app/ecommerce/ecommerce'
27+
sync_args: '-v --copy-links --hard-links'
28+
sync_host_ip: 'localhost'
29+
sync_host_port: 10874
30+
sync_strategy: 'rsync'
31+
32+
edxapp-sync:
33+
src: '../edx-platform/'
34+
dest: '/edx/app/edxapp/edx-platform'
35+
sync_args: '-v --copy-links --hard-links'
36+
sync_host_ip: 'localhost'
37+
sync_host_port: 10875
38+
sync_strategy: 'rsync'

0 commit comments

Comments
 (0)