Commit dd9928a8 authored by kjam's avatar kjam
Browse files

Merge remote-tracking branch 'oreilly/master'

parents 4e47b745 4c4c5b91
Loading
Loading
Loading
Loading

Dockerfile

0 → 100644
+31 −0
Changes for Dockerfile: 31 added lines, 0 removed lines.
Original line number Diff line number Diff line
FROM jupyter/<notebook>:<version hash>

# launchbot-specific labels
LABEL name.launchbot.io="Cleaning data at scale"
LABEL workdir.launchbot.io="/home/jovyan"
LABEL description.launchbot.io="Cleaning data at scale"
LABEL 8888.port.launchbot.io="Start Tutorial"

#Set the working directory
WORKDIR /home/jovyan/

# Modules
COPY requirements.txt /home/jovyan/requirements.txt
RUN pip install -r /home/jovyan/requirements.txt

# Add files
COPY notebooks /home/jovyan/notebooks
COPY data /home/jovyan/data
COPY solutions /home/jovyan/solutions

# Allow user to write to directory
USER root
RUN chown -R $NB_USER /home/jovyan \
    && chmod -R 774 /home/jovyan
USER $NB_USER

# Expose the notebook port
EXPOSE 8888

# Start the notebook server
CMD jupyter notebook --no-browser --port 8888 --ip=* --NotebookApp.token='' --NotebookApp.disable_check_xsrf=True --NotebookApp.iopub_data_rate_limit=1.0e10
+33 −2
Changes for README.md: 33 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -2,7 +2,10 @@

A workshop on data privacy methods for data scientists. 

This workshop will be presented as part of [EuroPython 2018](https://ep2018.europython.eu/conference/talks/privacy-for-data-scientists). 
This workshop was first presented as part of [EuroPython 2018](https://ep2018.europython.eu/conference/talks/privacy-for-data-scientists). It was thereafter modified for O'Reilly Live Online Trainings.


This is a public repository so there is no need to create an account to download its contents. To download the source code from this page, click the 'Cloud' icon on the top right hand, above where the latest commit is detailed.

### Motivation

@@ -10,12 +13,40 @@ As data and information security become core components of managing user data, d

In this workshop, we will introduce some of the basics in terms of defining privacy within the realm of data collection, modeling and machine learning. A focus on practical knowledge and code, we will cover how one can implement some of these algorithms with Python. Students will be presented with these theories along with recent research on privacy-preserving models, so they can leave with a better understanding of how to apply privacy principles to data science in their work and study.

### Installation

### Repository Download

This project contains the Jupyter Notebooks and the associated Dockerfile for Katharine Jarmul - Data Privacy in a Machine Learning World. It contains both the exercises (/notebooks) and the solutions (/solutions), as well as any data or files needed (/data).


To download via git from your preferred terminal application, type: 

```git clone https://resources.oreilly.com/live-training/protecting-data-privacy-in-a-machine-learning-world/```

### Running Jupyter Locally via Docker

We've shared the same Dockerfile we use for our JupyterHub session in this repository, to make sure you can run all of these notebooks in your own time, on your own machine. This isn't required during class, but can be useful for learning once the session is over.

You will need to have Docker installed on your system to create images and run containers. You can find the installation steps for all platforms on the company's [website](https://docs.docker.com/install/)
.

1) Clone the repository for the class either using the UI or your terminal (see above)..

2) Once you have Docker installed, type the following on your terminal to create a Docker image: `docker build -t ${TITLE} .` (note the period)

3) That will take a little while to create a Docker image, but once completed, you can run your server with the following:
`docker run -p 8888:8888 ${TITLE}`

4) Head to `localhost:8888` in your browser and you will be able to access the Jupyter Notebooks.


### Local Installation

Please utilize the included `requirements.txt` to install your requirements using `pip` (you can also do so in `conda`. The notebooks have *only* been tested with Python 3. 🙌🏻

We recommend using [virtual environments](https://packaging.python.org/guides/installing-using-pip-and-virtualenv/) or [conda environments](https://conda.io/docs/user-guide/tasks/manage-environments.html). 


### Outline

Agenda

create_jh/Dockerfile

0 → 100644
+28 −0
Changes for create_jh/Dockerfile: 28 added lines, 0 removed lines.
Original line number Diff line number Diff line
FROM us.gcr.io/jupyterhub-170614/<series_id>:<single user version>

USER root

# notebook and ipykernel should already be installed. now just need jupyterhub
RUN pip install --upgrade --no-cache-dir jupyterhub==0.8.1

# Specify tornado==4.5.3
RUN pip install --upgrade --no-cache-dir tornado==4.5.3

USER jovyan

WORKDIR /home/jovyan

# css stuff
RUN for i in `find / -wholename /opt/conda/*/custom.css 2>/dev/null` ; \
  do echo "@import url(\"https://cdn.oreillystatic.com/jupyterhub/jupyterhub-theme/custom/custom.css\")" \
  | tee ${i}; done

CMD jupyterhub-singleuser \
  --port=8888 \
  --ip=0.0.0.0 \
  --user="$JPY_USER" \
  --cookie-name=$JPY_COOKIE_NAME \
  --base-url=$JPY_BASE_URL \
  --hub-prefix=$JPY_HUB_PREFIX \
  --hub-api-url=$JPY_HUB_API_URL \