Skip to content

Commit

Permalink
fixed the docker image build
Browse files Browse the repository at this point in the history
Signed-off-by: Shyam Jesalpura <[email protected]>
  • Loading branch information
shyamjesal authored and ustiugov committed Jan 8, 2021
1 parent 49de389 commit a670f4d
Show file tree
Hide file tree
Showing 12 changed files with 53 additions and 36 deletions.
6 changes: 3 additions & 3 deletions function-images/chameleon/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM ustiugov/py_grpc:builder_grpc as builder_workload
COPY --from=ustiugov/py_grpc:builder_grpc /root/.local /root/.local
FROM vhiveease/py_grpc:builder_grpc as builder_workload
COPY --from=vhiveease/py_grpc:builder_grpc /root/.local /root/.local
COPY requirements.txt .
RUN pip3 install --user -r requirements.txt

FROM ustiugov/py_grpc:base as var_workload
FROM vhiveease/py_grpc:base as var_workload
COPY *.py /
COPY --from=builder_workload /root/.local /root/.local
RUN apk add libstdc++ --update --no-cache
Expand Down
6 changes: 4 additions & 2 deletions function-images/cnn_serving/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ RUN apk update && \
ln -sf /usr/bin/pip3 /usr/local/bin/pip && \
ln -sf /usr/bin/python3 /usr/local/bin/python && \
ln -sf /usr/bin/python3 /usr/local/bin/python3 && \
echo "http://dl-8.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories && \
echo "http://dl-3.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \
ln -s /usr/include/locale.h /usr/include/xlocale.h && \
echo "http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories && \
echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \
apk update && \
apk add --upgrade && \
apk add --update --no-cache build-base gcc g++ protobuf && \
apk add --allow-untrusted --repository http://dl-3.alpinelinux.org/alpine/edge/testing hdf5 hdf5-dev && \
apk add py3-numpy && \
apk add py-numpy-dev && \
pip3 install --upgrade pip && \
pip3 uninstall -y enum34 && \
pip3 install --no-cache-dir Cython && \
pip3 install --no-cache-dir -r requirements.txt && \
pip3 install --no-cache-dir protobuf==3.11.3 grpcio==${GRPC_PYTHON_VERSION}
Expand Down
6 changes: 3 additions & 3 deletions function-images/helloworld/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM ustiugov/py_grpc:builder_grpc as builder_workload
COPY --from=ustiugov/py_grpc:builder_grpc /root/.local /root/.local
FROM vhiveease/py_grpc:builder_grpc as builder_workload
COPY --from=vhiveease/py_grpc:builder_grpc /root/.local /root/.local
COPY requirements.txt .
RUN pip3 install --user -r requirements.txt

FROM ustiugov/py_grpc:base as var_workload
FROM vhiveease/py_grpc:base as var_workload
COPY *.py /
COPY --from=builder_workload /root/.local /root/.local
RUN apk add libstdc++ --update --no-cache
Expand Down
6 changes: 3 additions & 3 deletions function-images/image_rotate_s3/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM ustiugov/py_grpc:builder_grpc as builder_workload
COPY --from=ustiugov/py_grpc:builder_grpc /root/.local /root/.local
FROM vhiveease/py_grpc:builder_grpc as builder_workload
COPY --from=vhiveease/py_grpc:builder_grpc /root/.local /root/.local
COPY requirements.txt .
RUN apk add --no-cache --virtual .build-deps \
build-base linux-headers zlib-dev jpeg-dev \
&& pip3 install --user -r requirements.txt \
&& apk del .build-deps

FROM ustiugov/py_grpc:base as var_workload
FROM vhiveease/py_grpc:base as var_workload
COPY *.py /
COPY --from=builder_workload /root/.local /root/.local
RUN apk add libstdc++ libjpeg-turbo --update --no-cache
Expand Down
12 changes: 8 additions & 4 deletions function-images/image_rotate_s3/server.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from concurrent import futures
import logging

import os
import grpc

from PIL import Image, ImageOps
Expand All @@ -9,20 +9,24 @@
import helloworld_pb2_grpc

from minio import Minio
from minio.error import (ResponseError, BucketAlreadyOwnedByYou,
BucketAlreadyExists)

minioEnvKey = "MINIO_ADDRESS"
image_name = 'img2.jpeg'
image2_name = 'img3.jpeg'
image_path = '/pulled_' + image_name
image_path2 = '/pulled_' +image2_name

responses = ["record_response", "replay_response"]

minioAddress = os.getenv(minioEnvKey)

class Greeter(helloworld_pb2_grpc.GreeterServicer):

def SayHello(self, request, context):
minioClient = Minio('128.110.154.105:9000',
if minioAddress == None:
return None

minioClient = Minio(minioAddress,
access_key='minioadmin',
secret_key='minioadmin',
secure=False)
Expand Down
6 changes: 3 additions & 3 deletions function-images/json_serdes_s3/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM ustiugov/py_grpc:builder_grpc as builder_workload
COPY --from=ustiugov/py_grpc:builder_grpc /root/.local /root/.local
FROM vhiveease/py_grpc:builder_grpc as builder_workload
COPY --from=vhiveease/py_grpc:builder_grpc /root/.local /root/.local
COPY requirements.txt .
RUN pip3 install --user -r requirements.txt

FROM ustiugov/py_grpc:base as var_workload
FROM vhiveease/py_grpc:base as var_workload
COPY *.py /
COPY --from=builder_workload /root/.local /root/.local
RUN apk add libstdc++ --update --no-cache
Expand Down
12 changes: 8 additions & 4 deletions function-images/json_serdes_s3/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,32 @@

from concurrent import futures
import logging

import os
import grpc

import helloworld_pb2
import helloworld_pb2_grpc

from minio import Minio
from minio.error import (ResponseError, BucketAlreadyOwnedByYou,
BucketAlreadyExists)
import json

minioEnvKey = "MINIO_ADDRESS"
data_name = '2.json'
data2_name = '1.json'
data_path = '/pulled_' + data_name
data2_path = '/pulled_' + data2_name

responses = ["record_response", "replay_response"]

minioAddress = os.getenv(minioEnvKey)

class Greeter(helloworld_pb2_grpc.GreeterServicer):

def SayHello(self, request, context):
minioClient = Minio('128.110.154.105:9000',
if minioAddress == None:
return None

minioClient = Minio(minioAddress,
access_key='minioadmin',
secret_key='minioadmin',
secure=False)
Expand Down
4 changes: 2 additions & 2 deletions function-images/lr_serving/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ RUN apk add --no-cache \
\
ln -s locale.h /usr/include/xlocale.h && \
\
pip install --disable-pip-version-check --no-build-isolation numpy && \
pip install --disable-pip-version-check --no-build-isolation pandas && \
pip install --disable-pip-version-check --no-build-isolation numpy==1.19.0 && \
pip install --disable-pip-version-check --no-build-isolation pandas==1.0.5 && \
pip install --disable-pip-version-check --no-build-isolation protobuf==3.11.3 && \
pip install --disable-pip-version-check --no-build-isolation grpcio==1.26.0 && \
\
Expand Down
2 changes: 1 addition & 1 deletion function-images/lr_training_s3/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ustiugov/lr_serving:var_workload as var_workload
FROM vhiveease/lr_serving:var_workload as var_workload
COPY requirements.txt .
RUN pip3 install --no-cache-dir -r requirements.txt

Expand Down
11 changes: 7 additions & 4 deletions function-images/lr_training_s3/server.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
from concurrent import futures
import logging

import os
import grpc
from minio import Minio
from minio.error import (ResponseError, BucketAlreadyOwnedByYou,
BucketAlreadyExists)
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.linear_model import LogisticRegression
import joblib
Expand All @@ -24,16 +22,21 @@ def cleanup(sentence):
sentence = cleanup_re.sub(' ', sentence).strip()
return sentence

minioEnvKey = "MINIO_ADDRESS"
df_name = 'dataset.csv'
df2_name = 'dataset2.csv'
df_path = '/pulled_' + df_name
df2_path = 'pulled_' + df2_name

minioAddress = os.getenv(minioEnvKey)

class Greeter(helloworld_pb2_grpc.GreeterServicer):

def SayHello(self, request, context):
minioClient = Minio('128.110.154.105:9000',
if minioAddress == None:
return None

minioClient = Minio(minioAddress,
access_key='minioadmin',
secret_key='minioadmin',
secure=False)
Expand Down
6 changes: 3 additions & 3 deletions function-images/pyaes/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM ustiugov/py_grpc:builder_grpc as builder_workload
COPY --from=ustiugov/py_grpc:builder_grpc /root/.local /root/.local
FROM vhiveease/py_grpc:builder_grpc as builder_workload
COPY --from=vhiveease/py_grpc:builder_grpc /root/.local /root/.local
COPY requirements.txt .
RUN pip3 install --user -r requirements.txt

FROM ustiugov/py_grpc:base as var_workload
FROM vhiveease/py_grpc:base as var_workload
COPY *.py /
COPY --from=builder_workload /root/.local /root/.local
RUN apk add libstdc++ --update --no-cache
Expand Down
12 changes: 8 additions & 4 deletions function-images/video_processing_s3/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@
import logging
import cv2
from minio import Minio
from minio.error import (ResponseError, BucketAlreadyOwnedByYou,
BucketAlreadyExists)
import grpc

import os
import helloworld_pb2
import helloworld_pb2_grpc
tmp = "/tmp/"

minioEnvKey = "MINIO_ADDRESS"
vid1_name = 'vid1.mp4'
vid2_name = 'vid2.mp4'
vid1_path = '/pulled_' + vid1_name
vid2_path = '/pulled_' + vid2_name

minioAddress = os.getenv(minioEnvKey)

def video_processing(video_path):
result_file_path = tmp + video_path

Expand Down Expand Up @@ -47,7 +48,10 @@ def video_processing(video_path):
class Greeter(helloworld_pb2_grpc.GreeterServicer):

def SayHello(self, request, context):
minioClient = Minio('128.110.154.105:9000',
if minioAddress == None:
return None

minioClient = Minio(minioAddress,
access_key='minioadmin',
secret_key='minioadmin',
secure=False)
Expand Down

0 comments on commit a670f4d

Please sign in to comment.