Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
early experiments in woring with k8s
Browse files Browse the repository at this point in the history
  • Loading branch information
rashley-iqt committed Nov 18, 2021
1 parent 677bce4 commit 0e226f5
Show file tree
Hide file tree
Showing 6 changed files with 209 additions and 0 deletions.
1 change: 1 addition & 0 deletions detectors/ntech/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def predict():
score = model.inference(video_path)
pred={'filename': video}
pred[MODEL_NAME]=score
predictions.append(pred)
else:
return make_response(f"File {video} not found.", 400)
except ValidationError as e:
Expand Down
1 change: 1 addition & 0 deletions detectors/selimsef/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def predict():
score = model.inference(video_path)
pred={'filename': video}
pred[MODEL_NAME]=score
predictions.append(pred)
else:
return make_response(f"File {video} not found.", 400)
except ValidationError as e:
Expand Down
88 changes: 88 additions & 0 deletions ff-deployments.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# apiVersion: v1
# kind: Pod
# metadata:
# labels:
# service: api
# name: api
# spec:
# containers:
# - image: iqtlabs/fakefinder-api
# imagePullPolicy: Never
# name: api
# ports:
# - containerPort: 5000
# resources: {}
# volumeMounts:
# - mountPath: /uploads
# name: uploads
# restartPolicy: Always
# volumes:
# - name: uploads
# hostPath:
# path: ./uploads/
# type: Directory
# status: {}

apiVersion: apps/v1
kind: Deployment
metadata:
labels:
service: api
name: api
spec:
replicas: 1
selector:
matchLabels:
service: api
strategy:
type: Recreate
template:
metadata:
labels:
api: "true"
detectors: "true"
frontend: "true"
service: api
spec:
containers:
- image: iqtlabs/fakefinder-api
imagePullPolicy: Never
name: api
ports:
- containerPort: 5000
resources: {}
volumeMounts:
- mountPath: /uploads
name: uploads
restartPolicy: Always
volumes:
- name: uploads
status: {}
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
service: dash
name: dash
spec:
replicas: 1
selector:
matchLabels:
service: dash
strategy: {}
template:
metadata:
labels:
frontend: "true"
service: dash
spec:
containers:
- image: iqtlabs/fakefinder-dash
imagePullPolicy: Never
name: dash
ports:
- containerPort: 8050
resources: {}
restartPolicy: Always
status: {}
41 changes: 41 additions & 0 deletions ff-networks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: api
spec:
ingress:
- from:
- podSelector:
matchLabels:
api: "true"
podSelector:
matchLabels:
api: "true"
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: detectors
spec:
ingress:
- from:
- podSelector:
matchLabels:
detectors: "true"
podSelector:
matchLabels:
detectors: "true"
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: frontend
spec:
ingress:
- from:
- podSelector:
matchLabels:
frontend: "true"
podSelector:
matchLabels:
frontend: "true"
49 changes: 49 additions & 0 deletions ff-services.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
apiVersion: v1
kind: Service
metadata:
labels:
service: detector
name: detector
spec:
ports:
- name: "detector-port"
port: 5000
targetPort: 5000
selector:
service: detector
status:
loadBalancer: {}
---
apiVersion: v1
kind: Service
metadata:
labels:
service: api
name: api
spec:
ports:
- name: "api-port"
port: 5000
targetPort: 5000
selector:
service: api
status:
loadBalancer: {}
---
apiVersion: v1
kind: Service
metadata:
labels:
service: dash
name: dash
spec:
type: NodePort
ports:
- name: "http"
port: 80
targetPort: 8050
nodePort: 30080
selector:
service: dash
status:
loadBalancer: {}
29 changes: 29 additions & 0 deletions ff-volumes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: weights
labels:
type: local
spec:
capacity:
storage: 100Gi
accessModes:
- ReadOnlyMany
hostPath:
path: ./weights
type: Directory
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: uploads
labels:
type: local
spec:
capacity:
storage: 100Gi
accessModes:
- ReadWriteMany
hostPath:
path: ./uploads
type: Directory

0 comments on commit 0e226f5

Please sign in to comment.