Skip to content

Commit

Permalink
Merge pull request #139 from parente/fix-dev-setup
Browse files Browse the repository at this point in the history
Correct docker dev setup
  • Loading branch information
Lull3rSkat3r committed Mar 30, 2016
2 parents 3d9a75d + 6028902 commit 7cdc563
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 6 deletions.
5 changes: 5 additions & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.

FROM jupyter/pyspark-notebook:9f4ed032bada
RUN pip install nose
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

.PHONY: bash clean dev help install sdist test

IMAGE:=jupyter/pyspark-notebook:918deae45315
IMAGE:=jupyter/kernel-gateway-dev

DOCKER_ARGS?=
define DOCKER
Expand Down Expand Up @@ -38,6 +38,9 @@ etc/api_examples/%: ## Start one of the notebook-http mode API examples on port
--KernelGatewayApp.api='notebook-http' \
--KernelGatewayApp.seed_uri=/srv/kernel_gateway/$@.ipynb $(ARGS)

image: ## Build the dev/test docker image
@docker build --rm -f Dockerfile.dev -t $(IMAGE) .

install: ## Test install of dist/*.whl and dist/*.tar.gz
$(DOCKER) $(IMAGE) bash -c "pip install dist/*.whl && \
jupyter kernelgateway --help && \
Expand Down
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ straightforward using these steps:
eval "$(docker-machine env dev)"
```

2. Clone the repo
2. Clone the repo.

```bash
# make a directory under ~ to put source
Expand All @@ -74,24 +74,29 @@ straightforward using these steps:
git clone https://github.com/jupyter/kernel_gateway.git
```

3. Test the installation
3. Build the Docker dev image.

```bash
make image
```

3. Run the unit tests.

```bash
make test-python3
make test-python2
```

4. Run the gateway server
4. Run the gateway server.

```bash
cd kernel_gateway
make dev
```

5. Access the gateway instances:
5. Access the gateway instance.

a. Run `docker-machine ls` and note the IP of the dev machine.

b. Visit http://THAT_IP:8888/api in your browser where `THAT_IP` is the IP
address returned from the previous step. (Note that the
route `/api/kernels` is not enabled by default for greater security. See
Expand Down
12 changes: 12 additions & 0 deletions docs/source/devinstall.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ eval "$(docker-machine env dev)"
```

### Clone the repo

Clone this repository in a local directory that docker can volume mount:

```bash
Expand All @@ -29,7 +30,16 @@ cd !$
git clone https://github.com/jupyter/kernel_gateway.git
```

### Build the development image

Build a Docker image containing additional dev libraries.

```bash
make image
```

### Run the tests

To run the tests:

```bash
Expand All @@ -38,6 +48,7 @@ make test-python2
```

### Run the gateway server

To run the gateway server:

```bash
Expand All @@ -46,6 +57,7 @@ make dev
```

### Access the gateway

To access the gateway instance:

1. Run `docker-machine ls` and note the IP of the dev machine.
Expand Down

0 comments on commit 7cdc563

Please sign in to comment.