Skip to content

Commit

Permalink
[CLIPPER-154] Make a pip package (ucbrise#165)
Browse files Browse the repository at this point in the history
* Setup for pip package

* format code

* Made requested changes

* Fixup

* Made requested changes -- added clipper_admin to requirements.txt and consolidated container build scripts

* fixed formatting

* Fixed import
  • Loading branch information
nishadsingh1 authored and dcrankshaw committed May 22, 2017
1 parent 8a47e12 commit bb49084
Show file tree
Hide file tree
Showing 18 changed files with 47 additions and 19 deletions.
File renamed without changes.
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include the license file
include LICENSE.txt
include README.md
2 changes: 1 addition & 1 deletion containers/python/NoopDockerfile → NoopDockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM clipper/py-rpc:latest

MAINTAINER Dan Crankshaw <[email protected]>

COPY noop_container.py /container/
COPY containers/python/noop_container.py /container/

CMD ["python", "/container/noop_container.py"]

Expand Down
12 changes: 12 additions & 0 deletions PythonContainerDockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM clipper/py-rpc:latest

MAINTAINER Dan Crankshaw <[email protected]>

COPY containers/python/python_container.py containers/python/python_container_entry.sh /container/
COPY clipper_admin/pywrencloudpickle.py containers/python/python_container_conda_deps.txt /lib/

RUN conda install -y --file /lib/python_container_conda_deps.txt

CMD ["/container/python_container_entry.sh"]

# vim: set filetype=dockerfile:
2 changes: 1 addition & 1 deletion containers/python/RPCDockerfile → RPCDockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN mkdir -p /model \

WORKDIR /container

COPY __init__.py rpc.py /container/
COPY containers/python/__init__.py containers/python/rpc.py /container/

ENV CLIPPER_MODEL_PATH=/model

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM clipper/py-rpc:latest

MAINTAINER Dan Crankshaw <[email protected]>

COPY sklearn_cifar_container.py /container/
COPY containers/python/sklearn_cifar_container.py /container/

CMD ["python", "/container/sklearn_cifar_container.py"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ MAINTAINER Dan Crankshaw <[email protected]>

RUN pip install tensorflow==1.0

COPY tf_cifar_container.py /container/
COPY containers/python/tf_cifar_container.py /container/

CMD ["python", "/container/tf_cifar_container.py"]

Expand Down
10 changes: 8 additions & 2 deletions bin/build_docker_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ time docker build -t clipper/spark-scala-container -f SparkScalaContainerDockerf
cd -

# Build the Python model containers
cd $DIR/../containers/python
./build_container_images.sh
cd $DIR/..

# first build base image
docker build -t clipper/py-rpc -f ./RPCDockerfile ./
time docker build -t clipper/noop-container -f ./NoopDockerfile ./
time docker build -t clipper/python-container -f ./PythonContainerDockerfile ./
time docker build -t clipper/sklearn_cifar_container -f ./SklearnCifarDockerfile ./
time docker build -t clipper/tf_cifar_container -f ./TensorFlowCifarDockerfile ./
cd -
Empty file added clipper_admin/__init__.py
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 0 additions & 8 deletions containers/python/build_container_images.sh

This file was deleted.

1 change: 1 addition & 0 deletions examples/tutorial/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ scipy==0.18.1
seaborn==0.7.1
subprocess32==3.2.7
tensorflow==0.12.1
clipper_admin
3 changes: 1 addition & 2 deletions examples/tutorial/tutorial_part_one.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,7 @@
"# clipper_manager must be on your path:\n",
"import sys\n",
"import os\n",
"sys.path.append(os.path.abspath('../../management/'))\n",
"import clipper_manager as cm\n",
"import clipper_admin.clipper_manager as cm\n",
"# Change the username if necessary\n",
"user = \"\"\n",
"# Set the path to the SSH key\n",
Expand Down
3 changes: 1 addition & 2 deletions examples/tutorial/tutorial_part_two.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
"# clipper_manager must be on your path:\n",
"import sys\n",
"import os\n",
"sys.path.append(os.path.abspath('../../management/'))\n",
"import clipper_manager as cm\n",
"import clipper_admin.clipper_manager as cm\n",
"# Change the username if necessary\n",
"user = \"\"\n",
"# Set the path to the SSH key\n",
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/light_load_all_functionality.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import json
import numpy as np
cur_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, os.path.abspath('%s/../management/' % cur_dir))
sys.path.insert(0, os.path.abspath('%s/../clipper_admin/' % cur_dir))
import clipper_manager as cm
import time
import subprocess32 as subprocess
Expand Down
16 changes: 16 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from distutils.core import setup
from setuptools import find_packages

setup(
name='clipper_admin',
version='0.1',
description='Admin commands for the Clipper prediction-serving system',
author='Dan Crankshaw',
author_email='[email protected]',
url='http://clipper.ai',
packages=['clipper_admin'],
keywords=['clipper', 'prediction', 'model', 'management'],
install_requires=[
'requests', 'pyparsing', 'appdirs', 'pprint', 'subprocess32',
'sklearn', 'numpy', 'scipy', 'fabric', 'conda', 'pyyaml'
])

0 comments on commit bb49084

Please sign in to comment.