Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

481-nachet-deploy-classifier #482

Merged
merged 1 commit into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions kubernetes/aks/apps/nachet/base/nachet-rcnn-model-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,6 @@ spec:
resources:
requests:
storage: 2Gi
# ---
# apiVersion: v1
# kind: PersistentVolumeClaim
# metadata:
# name: nachet-tmp-pvc
# spec:
# storageClassName: azurefile
# accessModes:
# - ReadWriteMany
# resources:
# requests:
# storage: 2Gi
---
apiVersion: policy/v1
kind: PodDisruptionBudget
Expand All @@ -118,7 +106,6 @@ spec:
selector:
matchLabels:
app: nachet-rcnn-detector

---
apiVersion: v1
kind: Service
Expand Down
11 changes: 11 additions & 0 deletions kubernetes/aks/apps/nachet/base/nachet-secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,14 @@ metadata:
stringData:
NACHET_ENV: <NACHET_ENV>
NACHET_BACKEND_SVC_URL: <NACHET_BACKEND_SVC_URL>
---
kind: Secret
apiVersion: v1
metadata:
name: nachet-swin-classifier-secrets
annotations:
avp.kubernetes.io/path: "kv/data/nachet"
avp.kubernetes.io/secret-version: "13"
stringData:
NACHET_ENV: <NACHET_ENV>
NACHET_BACKEND_SVC_URL: <NACHET_BACKEND_SVC_URL>
121 changes: 121 additions & 0 deletions kubernetes/aks/apps/nachet/base/nachet-swin-model-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: nachet-swin-classifier
namespace: nachet
spec:
replicas: 1
revisionHistoryLimit: 3
selector:
matchLabels:
app: nachet-swin-classifier
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
template:
metadata:
labels:
app: nachet-swin-classifier
spec:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- nachet-swin-classifier
topologyKey: "kubernetes.io/hostname"
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/role
operator: In
values:
- agent
containers:
- name: nachet-swin-classifier
image: ghcr.io/ai-cfia/nachet-backend:29-azureml-swin-classifier
imagePullPolicy: Always
command: ["/bin/sh", "-c"]
args: ['./startup.sh']
envFrom:
- secretRef:
name: nachet-swin-classifier-secrets
ports:
- containerPort: 5001
volumeMounts:
- name: logs
mountPath: /app/logs
- name: tmp
mountPath: /tmp
livenessProbe:
httpGet:
path: /score
port: 5001
initialDelaySeconds: 60
periodSeconds: 10
resources:
requests:
cpu: "250m"
memory: "1Gi"
limits:
cpu: "500m"
memory: "2Gi"
securityContext:
runAsNonRoot: false
runAsUser: 1000
runAsGroup: 1000
readOnlyRootFilesystem: false
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
volumes:
- name: tmp
emptyDir:
medium: Memory
sizeLimit: 500Mi
- name: logs
persistentVolumeClaim:
claimName: nachet-logs-pvc
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nachet-logs-pvc
spec:
storageClassName: azurefile
accessModes:
- ReadWriteMany
resources:
requests:
storage: 2Gi
---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: nachet-swin-classifier-pdb
namespace: nachet
spec:
minAvailable: 1
selector:
matchLabels:
app: nachet-swin-classifier
---
apiVersion: v1
kind: Service
metadata:
name: nachet-swin-classifier-svc
namespace: nachet
spec:
clusterIP: None
selector:
app: nachet-swin-classifier
ports:
- protocol: TCP
port: 5001
Loading