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

Commit

Permalink
Added Support for Docker Sync
Browse files Browse the repository at this point in the history
Docker Sync will alleviate some of the filesystem issues on OS X.
  • Loading branch information
clintonb committed Mar 16, 2017
1 parent 47e1802 commit ee83c2e
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 11 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ devstack.provision: ## Provision all services
devstack.reset: ## Remove all service containers
docker-compose down

devstack.start: ## Start all services
docker-compose up
devstack.start: ## Start all services (with host volumes)
docker-compose -f docker-compose.yml -f docker-compose-host.yml up

devstack.start.sync: ## Start all services (with docker-sync)
docker-sync-stack start

devstack.stop: ## Stop all services
docker-compose stop
Expand Down
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ configure Docker with a sufficient amount of resources. Our testing found that [
$ make devstack.provision
```

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

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

### Docker Sync

Docker for Mac has known filesystem issues that significantly decrease performance. In order to mitigate these issues,
we use [Docker Sync](https://github.com/EugenMayer/docker-sync/wiki) to synchronize file data from the host machine to
the containers. Follow the steps below to setup Docker Sync.

1. Ensure all containers are stopped.
```
$ make devstack.stop
```

2. Follow the installation instructions at https://github.com/EugenMayer/docker-sync/wiki to install Docker Sync.

3. Run Docker Sync and devstack.
```
$ make devstack.start.sync
```


## Usernames and Passwords

The provisioning script creates a Django superuser for every service.
Expand Down
15 changes: 15 additions & 0 deletions docker-compose-host.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: "2.1"

services:
credentials:
volumes:
- ../credentials:/edx/app/credentials/credentials
discovery:
volumes:
- ../course-discovery:/edx/app/discovery/discovery
ecommerce:
volumes:
- ../ecommerce:/edx/app/ecommerce/ecommerce
edxapp:
volumes:
- ../edx-platform:/edx/app/edxapp/edx-platform
25 changes: 25 additions & 0 deletions docker-compose-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: "2.1"

services:
credentials:
volumes:
- credentials-sync:/edx/app/credentials/credentials:rw
discovery:
volumes:
- discovery-sync:/edx/app/discovery/discovery:rw
ecommerce:
volumes:
- ecommerce-sync:/edx/app/ecommerce/ecommerce:rw
edxapp:
volumes:
- edxapp-sync:/edx/app/edxapp/edx-platform:rw

volumes:
credentials-sync:
external: true
discovery-sync:
external: true
ecommerce-sync:
external: true
edxapp-sync:
external: true
8 changes: 0 additions & 8 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ services:
image: edxops/credentials:devstack
ports:
- "18150:18150"
volumes:
- ../credentials:/edx/app/credentials/credentials

discovery:
command: /edx/app/discovery/devstack.sh start
Expand All @@ -82,8 +80,6 @@ services:
image: edxops/discovery:devstack
ports:
- "18381:18381"
volumes:
- ../course-discovery:/edx/app/discovery/discovery

ecommerce:
command: /edx/app/ecommerce/devstack.sh start
Expand All @@ -97,8 +93,6 @@ services:
image: edxops/ecommerce:devstack
ports:
- "18130:18130"
volumes:
- ../ecommerce:/edx/app/ecommerce/ecommerce

edxapp:
command: /edx/app/edxapp/devstack.sh start
Expand All @@ -111,8 +105,6 @@ services:
ports:
- "18000:18000"
- "18010:18010"
volumes:
- ../edx-platform:/edx/app/edxapp/edx-platform

volumes:
elasticsearch_data:
Expand Down
38 changes: 38 additions & 0 deletions docker-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
version: "2"

options:
compose-file-path: 'docker-compose.yml'
compose-dev-file-path: 'docker-compose-sync.yml'

syncs:
credentials-sync:
src: '../credentials/'
dest: '/edx/app/credentials/credentials'
sync_args: '-v --copy-links --hard-links'
sync_host_ip: 'localhost'
sync_host_port: 10872
sync_strategy: 'rsync'

discovery-sync:
src: '../course-discovery/'
dest: '/edx/app/discovery/discovery'
sync_args: '-v --copy-links --hard-links'
sync_host_ip: 'localhost'
sync_host_port: 10873
sync_strategy: 'rsync'

ecommerce-sync:
src: '../ecommerce/'
dest: '/edx/app/ecommerce/ecommerce'
sync_args: '-v --copy-links --hard-links'
sync_host_ip: 'localhost'
sync_host_port: 10874
sync_strategy: 'rsync'

edxapp-sync:
src: '../edx-platform/'
dest: '/edx/app/edxapp/edx-platform'
sync_args: '-v --copy-links --hard-links'
sync_host_ip: 'localhost'
sync_host_port: 10875
sync_strategy: 'rsync'

0 comments on commit ee83c2e

Please sign in to comment.