diff --git a/docker-compose.yml b/docker-compose.yml index 2e6a7ea5..71ffa068 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -717,9 +717,31 @@ services: volumes: - ${DATA_PATH_HOST}/portainer_data:/data - /var/run/docker.sock:/var/run/docker.sock + extra_hosts: + - "dockerhost:${DOCKER_HOST_IP}" ports: - 9010:9000 +### IPython ######################################### + ipython-controller: + build: + context: ./ipython + dockerfile: Dockerfile.controller + networks: + - backend + extra_hosts: + - "laradock-ipython:${LARADOCK_IPYTHON_CONTROLLER_IP}" + ports: + - "33327-33338:33327-33338" + ipython-engine: + build: + context: ./ipython + dockerfile: Dockerfile.engine + networks: + - backend + extra_hosts: + - "laradock-ipython:${LARADOCK_IPYTHON_CONTROLLER_IP}" + ### Docker-in-Docker ################################################ docker-in-docker: image: docker:dind diff --git a/env-example b/env-example index 25ebcb7e..f9325ce8 100644 --- a/env-example +++ b/env-example @@ -360,6 +360,9 @@ SOLR_VERSION=5.5 SOLR_PORT=8983 SOLR_DATAIMPORTHANDLER_MYSQL=false +### IPYTHON ################################################## +LARADOCK_IPYTHON_CONTROLLER_IP=127.0.0.1 + ### NETDATA ############################################### NETDATA_PORT=19999 diff --git a/ipython/Dockerfile.controller b/ipython/Dockerfile.controller new file mode 100644 index 00000000..3acb62d9 --- /dev/null +++ b/ipython/Dockerfile.controller @@ -0,0 +1,17 @@ +FROM python:3.5-alpine + +LABEL maintainer="ahkui " + +USER root + +RUN apk add --no-cache build-base + +RUN python -m pip --quiet --no-cache-dir install \ + ipyparallel + +RUN ipython profile create --parallel --profile=default + +COPY ipcontroller-client.json /root/.ipython/profile_default/security/ipcontroller-client.json +COPY ipcontroller-engine.json /root/.ipython/profile_default/security/ipcontroller-engine.json + +CMD ["sh","-c","ipcontroller --ip=* --reuse"] \ No newline at end of file diff --git a/ipython/Dockerfile.engine b/ipython/Dockerfile.engine new file mode 100644 index 00000000..5f709b61 --- /dev/null +++ b/ipython/Dockerfile.engine @@ -0,0 +1,23 @@ +FROM python:3.5-alpine + +LABEL maintainer="ahkui " + +USER root + +RUN apk add --no-cache build-base + +RUN python -m pip --quiet --no-cache-dir install \ + ipyparallel \ + numpy \ + pandas \ + pymongo \ + redis \ + requests \ + bs4 + +RUN ipython profile create --parallel --profile=default + +COPY ipcontroller-client.json /root/.ipython/profile_default/security/ipcontroller-client.json +COPY ipcontroller-engine.json /root/.ipython/profile_default/security/ipcontroller-engine.json + +CMD ["sh","-c","ipcluster engines"] diff --git a/ipython/ipcontroller-client.json b/ipython/ipcontroller-client.json new file mode 100644 index 00000000..987cb511 --- /dev/null +++ b/ipython/ipcontroller-client.json @@ -0,0 +1,16 @@ +{ + "key": "868074dd-060311910ab3d6991611bccf", + "signature_scheme": "hmac-sha256", + "unpack": "json", + "pack": "json", + "ssh": "", + "task_scheme": "leastload", + "interface": "tcp://*", + "location": "laradock-ipython", + "notification": 33338, + "iopub": 33337, + "control": 33336, + "mux": 33335, + "task": 33334, + "registration": 33333 +} \ No newline at end of file diff --git a/ipython/ipcontroller-engine.json b/ipython/ipcontroller-engine.json new file mode 100644 index 00000000..d3c0911f --- /dev/null +++ b/ipython/ipcontroller-engine.json @@ -0,0 +1,16 @@ +{ + "key": "868074dd-060311910ab3d6991611bccf", + "signature_scheme": "hmac-sha256", + "unpack": "json", + "pack": "json", + "ssh": "", + "interface": "tcp://*", + "location": "laradock-ipython", + "iopub": 33327, + "hb_ping": 33328, + "hb_pong": 33329, + "control": 33330, + "mux": 33331, + "task": 33332, + "registration": 33333 +} \ No newline at end of file