This repository has been archived by the owner on Mar 25, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
fabio fumarola
committed
Oct 2, 2017
1 parent
ccf8b68
commit f7df12a
Showing
5 changed files
with
119 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
db |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |