Skip to content
This repository has been archived by the owner on Mar 25, 2019. It is now read-only.

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
fabio fumarola committed Oct 2, 2017
1 parent ccf8b68 commit f7df12a
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 85 deletions.
1 change: 1 addition & 0 deletions jupyterhub/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
db
55 changes: 0 additions & 55 deletions jupyterhub/README

This file was deleted.

65 changes: 65 additions & 0 deletions jupyterhub/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Docker image: Jupyterhub + ldap integration + postgres + sparkmagic

To run docker:

```bash
git clone

cd jupyterhub

./build.sh # Built jupyterhub docker image

docker-compose up -d # Start jupyterhub docker container

./init.sh # Init container config
```

Configuration detail:

On docker you can find jupyterhub config file

```bash
jupyterhub/jupyterhubconfig/jupyterhub_config.py
```

If you need to add admin user you must edit "jupyterhub_config.py" and add admin in this section:

```properties
c.authenticator.admin_users = {'admin','raffaele','lorenzo'}
```

LDAP parameters:

```properties
# ldap Server config
c.LDAPAuthenticator.server_address = 'server ip'
c.LDAPAuthenticator.use_ssl = True
c.LDAPAuthenticator.server_port = 636
c.LDAPAuthenticator.bind_dn_template = 'uid={username},cn=users,cn=accounts,dc=test,dc=example,dc=com'
```

-------------------

If you need to change default sparkmagic config.json you need to edit file `jupyterhub/sparkmagicconfig/.sparkmagic/config.json`.



If you need to grand user privileges to jupyterhub "standard users" you must edit file `jupyterhub/ubuntuconfig/adduser.conf` and change this parameter:

Comment rbash and uncomment standard bash

```properties
# The DSHELL variable specifies the default login shell on your
# system.
#DSHELL=/bin/bash
DSHELL=/bin/rbash
```

Change user Dir privileges

```properties
# If DIR_MODE is set, directories will be created with the specified
# mode. Otherwise the default mode 0755 will be used.
DIR_MODE=0700
```

74 changes: 44 additions & 30 deletions jupyterhub/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,44 @@
jupyterhub:
container_name: jupyterhub
image: jupyterhub
restart: always
extra_hosts:
idm.daf.gov.it: 192.168.0.29
livy.default.svc.cluster.local: 192.168.0.27
links:
- postgresjupyterhub
environment:
POSTGRES_HOST: "postgresjupyterhub"
POSTGRES_DB: "jupyterhub"
POSTGRES_USER: "jupyterhub"
POSTGRES_PASSWORD: "jupyterhub"
ports:
- "8000:8000"
volumes:
- ./jupyterhubconfig:/srv/jupyterhub
postgresjupyterhub:
container_name: postgresjupyterhub
image: postgres:9.6
restart: always
ports:
- "5432:5432"
environment:
POSTGRES_DB: jupyterhub
POSTGRES_PASSWORD: jupyterhub
POSTGRES_USER: jupyterhub
volumes:
- postgres:/var/lib/postgresql/data
version: '3'

services:
jupyterhub:
container_name: jupyterhub
image: jupyterhub
restart: always
extra_hosts:
idm.daf.gov.it: 192.168.0.29
livy.default.svc.cluster.local: 192.168.0.27
links:
- postgresjupyterhub
environment:
POSTGRES_HOST: "postgresjupyterhub"
POSTGRES_DB: "jupyterhub"
POSTGRES_USER: "jupyterhub"
POSTGRES_PASSWORD: "jupyterhub"
ports:
- "8000:8000"
volumes:
- ./jupyterhubconfig:/srv/jupyterhub
networks:
- back

postgresjupyterhub:
container_name: postgresjupyterhub
image: postgres:9.6
restart: always
ports:
- "5432:5432"
environment:
POSTGRES_DB: jupyterhub
POSTGRES_PASSWORD: jupyterhub
POSTGRES_USER: jupyterhub
# volumes:
# - postgres:/var/lib/postgresql/data
networks:
- back


networks:
back:
# use the bridge driver, but enable IPv6
driver: bridge
9 changes: 9 additions & 0 deletions jupyterhub/ldap_fake/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

mkdir -p db

docker run -p 389:389 -v "$PWD/db:/var/lib/ldap"\
-e LDAP_DOMAIN=mycorp.com\
-e LDAP_ROOTPASS=1234abc\
--name=fake_ldap
--network=bridge -d nickstenning/slapd

0 comments on commit f7df12a

Please sign in to comment.