1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
services:
# need /ipython to be writable by the container user (1000)
# can't seem to start volumes with the right permissions
init-permissions:
image: alpine
volumes:
- ipython:/ipython
command: chown -Rv 1000:1000 /ipython
controller:
depends_on:
- init-permissions
# condition: service_completed_successfully
build: .
volumes:
- ipython:/ipython
environment:
IPYTHONDIR: /ipython
command: |
ipcontroller --location controller --ip 0.0.0.0 --nodb --HubFactory.broadcast_scheduler_depth=2
deploy:
restart_policy:
condition: on-failure
engines:
build: .
depends_on:
- controller
volumes_from:
- controller
environment:
IPYTHONDIR: /ipython
links:
- controller
command: |
ipcluster engines -n 16
deploy:
mode: replicated
replicas: 4
restart_policy:
condition: on-failure
client:
build: .
ports:
- "9999:8888"
links:
- controller
volumes_from:
- controller
volumes:
- .:/home/jovyan/example
environment:
IPYTHONDIR: /ipython
JUPYTER_CONFIG_DIR: /ipython/jupyter
volumes:
ipython: {}
|