Skip to content

Commit

Permalink
462 deploy nachet autologin (#463)
Browse files Browse the repository at this point in the history
* 462 deploy nachet autologin and detector model server
* add ingress path
  • Loading branch information
ChromaticPanic authored Nov 19, 2024
1 parent c3f6c7f commit 83b37f0
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ spec:
- agent
containers:
- name: nachet-backend
image: ghcr.io/ai-cfia/nachet-backend:main
image: ghcr.io/ai-cfia/nachet-backend:129-Autologin-uuid
imagePullPolicy: Always
command: ["/bin/sh", "-c"]
args: ['hypercorn -b :8080 app:app']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ spec:
- agent
containers:
- name: nachet-frontend
image: ghcr.io/ai-cfia/nachet-frontend:191-User-Autologin
image: ghcr.io/ai-cfia/nachet-frontend:193-autologin-uuid-b
imagePullPolicy: Always
command: ["/bin/sh", "-c"]
args: [serve -s build]
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/aks/apps/nachet/base/nachet-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ metadata:
auth_request_set $auth_resp_err $upstream_http_x_vouch_err;
auth_request_set $auth_resp_failcount $upstream_http_x_vouch_failcount;
nginx.ingress.kubernetes.io/custom-http-errors: "403"
nginx.ingress.kubernetes.io/default-backend: "default-nginx-backend" # Overrides the global default backend
nginx.ingress.kubernetes.io/default-backend: "default-nginx-backend" # Overrides the global default backend
spec:
ingressClassName: nginx
tls:
Expand Down
100 changes: 100 additions & 0 deletions kubernetes/aks/apps/nachet/base/nachet-rcnn-model-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: nachet-rcnn-detector
namespace: nachet
spec:
replicas: 1
revisionHistoryLimit: 3
selector:
matchLabels:
app: nachet-rcnn-detector
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
template:
metadata:
labels:
app: nachet-rcnn-detector
spec:
securityContext:
runAsNonRoot: true
runAsUser: 1000
runAsGroup: 3000
fsGroup: 2000
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- nachet-rcnn-detector
topologyKey: "kubernetes.io/hostname"
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/role
operator: In
values:
- agent
containers:
- name: nachet-rcnn-detector
image: ghcr.io/ai-cfia/nachet-model:29-azureml-seed-detector
imagePullPolicy: Always
command: ["/bin/sh", "-c"]
args: ['azmlinfsrv --entry_script /app/scoring_file_v_1_0_0.py']
envFrom:
- secretRef:
name: nachet-rcnn-detector-secrets
ports:
- containerPort: 12389
livenessProbe:
httpGet:
path: /score
port: 12380
initialDelaySeconds: 60
periodSeconds: 10
resources:
requests:
cpu: "250m"
memory: "1Gi"
limits:
cpu: "500m"
memory: "2Gi"
securityContext:
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL

---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: nachet-rcnn-detector-pdb
namespace: nachet
spec:
minAvailable: 1
selector:
matchLabels:
app: nachet-rcnn-detector

---
apiVersion: v1
kind: Service
metadata:
name: nachet-rcnn-detector-svc
namespace: nachet
spec:
clusterIP: None
selector:
app: nachet-rcnn-detector
ports:
- protocol: TCP
port: 8080
5 changes: 4 additions & 1 deletion kubernetes/aks/apps/nachet/base/nachet-secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: nachet-backend-secrets
annotations:
avp.kubernetes.io/path: "kv/data/nachet"
avp.kubernetes.io/secret-version: "9"
avp.kubernetes.io/secret-version: "12"
stringData:
NACHET_AZURE_STORAGE_CONNECTION_STRING: <NACHET_AZURE_STORAGE_CONNECTION_STRING>
NACHET_DATA: <NACHET_DATA>
Expand All @@ -19,6 +19,9 @@ stringData:
NACHET_STORAGE_URL: <NACHET_STORAGE_URL>
NACHET_VALID_DIMENSION: <NACHET_VALID_DIMENSION>
NACHET_VALID_EXTENSION: <NACHET_VALID_EXTENSION>
NACHET_ENV: <NACHET_ENV>
NACHET_FRONTEND_PUBLIC_URL: <NACHET_FRONTEND_PUBLIC_URL>
NACHET_FRONTEND_DEV_URL: <NACHET_FRONTEND_DEV_URL>
---
kind: Secret
apiVersion: v1
Expand Down

0 comments on commit 83b37f0

Please sign in to comment.