Added docker and k8s stuff

This commit is contained in:
Pünkösd Marcell 2020-07-27 18:18:26 +02:00
parent fcef542a7c
commit a45abf5870
5 changed files with 57 additions and 1 deletions

14
Dockerfile Normal file
View File

@ -0,0 +1,14 @@
FROM registry.kmlabz.com/birbnetes/ai-base-image
RUN apt update && apt install -y libsndfile1-dev libsndfile1 && apt clean
ENV PIP_NO_CACHE_DIR=true
ENV TZ Europe/Budapest
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
ADD cnn_classification_service requirements.txt /cnn_classification_service/
WORKDIR /cnn_classification_service/
RUN pip3 install -r requirements.txt
ENTRYPOINT ["python3", "main.py"]

13
k8s/configmap.yaml Normal file
View File

@ -0,0 +1,13 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: cnn-classification-service
labels:
app: cnn-classification-service
namespace: birbnetes
data:
SENTRY_DSN: https://6d243347cf9f4fc6a54759c3eb34e864@sentry.kmlabz.com/8
RELEASE_ID: luna-k8s
RELEASEMODE: release
PIKA_URL: amqp://user:1wZVQnP5vy@birb-rabbitmq:5672/
PIKA_EXCHANGE_NAME: "wave"

27
k8s/deployment.yaml Normal file
View File

@ -0,0 +1,27 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: cnn-classification-service
namespace: birbnetes
labels:
app: cnn-classification-service
spec:
replicas: 1
selector:
matchLabels:
app: cnn-classification-service
strategy:
type: Recreate
template:
metadata:
labels:
app: cnn-classification-service
spec:
containers:
- image: registry.kmlabz.com/birbnetes/cnn-classification-service
name: cnn-classification-service
envFrom:
- configMapRef:
name: cnn-classification-service
imagePullSecrets:
- name: regcred

View File

@ -7,4 +7,6 @@ librosa
keras
numpy
matplotlib
keras_preprocessing
keras_preprocessing
tensorflow
sndfile