Skip to content

Latest commit

 

History

History
99 lines (81 loc) · 2.9 KB

INSTALLATION.md

File metadata and controls

99 lines (81 loc) · 2.9 KB

Installation

Steps

  • Setup python 3.0 in the first VM
  • Configure Kafka, Minio and Couch db in first VM
  • Configure OpenWhisk in second VM
  • Connect two VMs.Click here for the setup
  • Create a function, you want to deploy in OpenWhisk. Click here for the setup
  • Use the above created action name while running CLI as function name
  • Follow Getting started for running the sanity

Configure

Ubuntu User

Getting started

Install all the Sanity dependencies
$ pip3 install couchdb
$ pip3 install docopt
$ pip3 install kafka
$ pip3 install minio
$ pip3 install requests   
Clone the Github Repository
$ git clone https://github.com/bu-528-sp19/Deduplicating-Cloud-functions.git 
Change the directory
$ cd Deduplicating-Cloud-functions
$ cd sanity/final
Run the CLI
$ python3 sanity.py --i <INPUT_BUCKET_NAME> --o <OUTPUT_BUCKET_NAME> --f <FUNCTION_NAME> --u <USER NAME>

alt_text

Add one file to the input bucket

alt_text

Unique Data

alt_text

De duplication effect

alt_text

alt_text


Steps for creating a function in OpenWhisk

Create a file named thumbnail.py
import sys
import os
from PIL import Image
from json import loads

def main(location):
  im = Image.open(location)
  im.thumbnail((120,120), Image.ANTIALIAS)
  image_path="thumbnail.jpg"
  im.save(image_path)
  print("Thumbnail generated thumbnail.jpg")
  return image_path

Create Dockerfile to load the python file and the dependency
FROM ubuntu
MAINTAINER Name (<email id>)
COPY thumbnail.py ./
RUN apt-get update
RUN apt install python3-pip -y
RUN pip3 install Pillow 
CMD ["python3", "./thumbnail.py"]
Create an action called sprint using the Docker file containing the code
$ wsk -i action create sprint <docker hub path of the image>
ok: created action sprint