Skip to content

Commit

Permalink
change to different folder structure to support kustomize and overlay…
Browse files Browse the repository at this point in the history
…s to define deployment layer
  • Loading branch information
cedricve committed Nov 29, 2024
1 parent 6055a9a commit 48c6c24
Show file tree
Hide file tree
Showing 60 changed files with 146 additions and 135 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/kind-cloud.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
kubectl create namespace mongodb
helm install mongodb -n mongodb bitnami/mongodb --values ./mongodb-values.yaml
helm install mongodb -n mongodb bitnami/mongodb --values ./base/mongodb-values.yaml
echo "Sleeping for 250 seconds, give time for the helm chart to create the pods" && sleep 250
kubectl get pods -A -o wide
kubectl get pods -A -o wide | grep mongodb | awk '{print $3}' | grep -q '1/1' && echo "mongodb pod is running with status 1/1" || (echo "mongodb pod is not running with status 1/1" && exit 1)
Expand All @@ -53,9 +53,9 @@ jobs:
id: install-kerberos-vault
run: |
kubectl create namespace kerberos-vault
kubectl apply -f ./mongodb-configmap.yaml -n kerberos-vault
kubectl apply -f ./kerberos-vault-deployment.yaml -n kerberos-vault
kubectl apply -f ./kerberos-vault-service.yaml -n kerberos-vault
kubectl apply -f ./base/mongodb-configmap.yaml -n kerberos-vault
kubectl apply -f ./base/vault/kerberos-vault-deployment.yaml -n kerberos-vault
kubectl apply -f ./base/vault/kerberos-vault-service.yaml -n kerberos-vault
echo "Sleeping for 30 seconds, give time for the helm chart to create the pods" && sleep 30
kubectl get pods -A -o wide
kubectl get pods -A -o wide | grep kerberos-vault | awk '{print $3}' | grep -q '1/1' && echo "kerberos-vault pod is running with status 1/1" || (echo "kerberos-vault pod is not running with status 1/1" && exit 1)
Expand All @@ -80,7 +80,7 @@ jobs:
run: |
kubectl create namespace vernemq
helm repo add vernemq https://vernemq.github.io/docker-vernemq
helm install vernemq vernemq/vernemq --values ./vernemq-values.yaml -n vernemq --create-namespace
helm install vernemq vernemq/vernemq --values ./base/vernemq-values.yaml -n vernemq --create-namespace
echo "Sleeping for 120 seconds, give time for the helm chart to create the pods" && sleep 120
kubectl get pods -A -o wide
kubectl get pods -A -o wide | grep vernemq-0 | awk '{print $3}' | grep -q '1/1' && echo "vernemq pod is running with status 1/1" || (echo "vernemq pod is not running with status 1/1" && exit 1)
Expand All @@ -90,7 +90,7 @@ jobs:
run: |
helm repo add kerberos https://charts.kerberos.io
kubectl create namespace kerberos-hub
helm install hub kerberos/hub --values kerberos-hub-values.yaml -n kerberos-hub --create-namespace
helm install hub kerberos/hub --values base/hub/kerberos-hub-values.yaml -n kerberos-hub --create-namespace
echo "Sleeping for 300 seconds, give time for the helm chart to create the pods" && sleep 300
kubectl get pods -A -o wide
kubectl get pods -A -o wide | grep kerberos-hub | awk '{print $3}' | grep -q '1/1' && echo "kerberos-hub pod is running with status 1/1" || (echo "kerberos-hub pod is not running with status 1/1" && exit 1)
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/kind.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
kubectl create namespace mongodb
helm install mongodb -n mongodb bitnami/mongodb --values ./mongodb-values.yaml
helm install mongodb -n mongodb bitnami/mongodb --values ./base/mongodb-values.yaml
echo "Sleeping for 250 seconds, give time for the helm chart to create the pods" && sleep 250
kubectl get pods -A -o wide
kubectl get pods -A -o wide | grep mongodb | awk '{print $3}' | grep -q '1/1' && echo "mongodb pod is running with status 1/1" || (echo "mongodb pod is not running with status 1/1" && exit 1)
Expand All @@ -54,34 +54,34 @@ jobs:
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
kubectl create namespace rabbitmq
helm install rabbitmq -n rabbitmq bitnami/rabbitmq --values ./rabbitmq-values.yaml
helm install rabbitmq -n rabbitmq bitnami/rabbitmq --values ./base/rabbitmq-values.yaml
echo "Sleeping for 60 seconds, give time for the helm chart to create the pods" && sleep 60
kubectl get pods -A -o wide
kubectl get pods -A -o wide | grep rabbitmq | awk '{print $3}' | grep -q '1/1' && echo "rabbitmq pod is running with status 1/1" || (echo "rabbitmq pod is not running with status 1/1" && exit 1)
- name: Install Kerberos Vault
id: install-kerberos-vault
run: |
kubectl create namespace kerberos-vault
kubectl apply -f ./mongodb-configmap.yaml -n kerberos-vault
kubectl apply -f ./kerberos-vault-deployment.yaml -n kerberos-vault
kubectl apply -f ./kerberos-vault-service.yaml -n kerberos-vault
kubectl apply -f ./base/mongodb-configmap.yaml -n kerberos-vault
kubectl apply -f ./base/vault/kerberos-vault-deployment.yaml -n kerberos-vault
kubectl apply -f ./base/vault/kerberos-vault-service.yaml -n kerberos-vault
echo "Sleeping for 30 seconds, give time for the helm chart to create the pods" && sleep 30
kubectl get pods -A -o wide
kubectl get pods -A -o wide | grep kerberos-vault | awk '{print $3}' | grep -q '1/1' && echo "kerberos-vault pod is running with status 1/1" || (echo "kerberos-vault pod is not running with status 1/1" && exit 1)
- name: Install Kerberos Agent
id: install-kerberos-agent
run: |
kubectl apply -f ./kerberos-agent-deployment.yaml
kubectl apply -f ./base/agent/kerberos-agent-deployment.yaml
echo "Sleeping for 30 seconds, give time for the helm chart to create the pods" && sleep 30
kubectl get pods -A -o wide
kubectl get pods -A -o wide | grep agent | awk '{print $3}' | grep -q '1/1' && echo "kerberos-agent pod is running with status 1/1" || (echo "kerberos-agent pod is not running with status 1/1" && exit 1)
- name: Install Data filtering
id: install-data-filtering
run: |
sed -e '/resources/ s/^#*/#/' -i ./data-filtering-deployment.yaml
sed -e '/limits/ s/^#*/#/' -i ./data-filtering-deployment.yaml
sed -e '/nvidia/ s/^#*/#/' -i ./data-filtering-deployment.yaml
kubectl apply -f data-filtering-deployment.yaml
sed -e '/resources/ s/^#*/#/' -i ./base/vault/data-filtering-deployment.yaml
sed -e '/limits/ s/^#*/#/' -i ./base/vault/data-filtering-deployment.yaml
sed -e '/nvidia/ s/^#*/#/' -i ./base/vault/data-filtering-deployment.yaml
kubectl apply -f ./base/vault/data-filtering-deployment.yaml
echo "Sleeping for 250 seconds, give time for the helm chart to create the pods" && sleep 250
kubectl get pods -A -o wide
kubectl get pods -A -o wide | grep data-filtering | awk '{print $3}' | grep -q '1/1' && echo "data-filtering pod is running with status 1/1" || (echo "data-filtering pod is not running with status 1/1" && exit 1)
33 changes: 18 additions & 15 deletions .github/workflows/microk8s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,16 @@ jobs:
kubectl get pods -A -o wide
- name: Checkout repository
uses: actions/checkout@v2
- name: Install OpenEBS
run: |
kubectl apply -f https://openebs.github.io/charts/openebs-operator.yaml
echo "Sleeping for 60 seconds, give time for the operator to create the CRDs" && sleep 60
kubectl get sc
kubectl get po -A -o wide
- name: Install Minio
id: install-minio
run: |
git clone --depth 1 --branch v6.0.1 https://github.com/minio/operator.git && kubectl apply -k operator/
sed -i 's/openebs-hostpath/microk8s-hostpath/g' ./minio-tenant-base.yaml
kubectl apply -f minio-tenant-base.yaml
echo "Sleeping for 60 seconds, give time for the operator/tenant to create the CRDs" && sleep 60
kubectl get po -A -o wide
Expand All @@ -39,45 +44,43 @@ jobs:
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
kubectl create namespace mongodb
sed -i 's/openebs-hostpath/microk8s-hostpath/g' ./mongodb-values.yaml
helm install mongodb -n mongodb bitnami/mongodb --values ./mongodb-values.yaml
echo "Sleeping for 90 seconds, give time for the helm chart to create the pods" && sleep 90
helm install mongodb -n mongodb bitnami/mongodb --values ./base/mongodb-values.yaml
echo "Sleeping for 250 seconds, give time for the helm chart to create the pods" && sleep 250
kubectl get pods -A -o wide
kubectl get pods -A -o wide | grep mongodb | awk '{print $3}' | grep -q '1/1' && echo "mongodb pod is running with status 1/1" || (echo "mongodb pod is not running with status 1/1" && exit 1)
- name: Install RabbitMQ
id: install-rabbitmq
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
kubectl create namespace rabbitmq
sed -i 's/openebs-hostpath/microk8s-hostpath/g' ./rabbitmq-values.yaml
helm install rabbitmq -n rabbitmq bitnami/rabbitmq --values ./rabbitmq-values.yaml
helm install rabbitmq -n rabbitmq bitnami/rabbitmq --values ./base/rabbitmq-values.yaml
echo "Sleeping for 60 seconds, give time for the helm chart to create the pods" && sleep 60
kubectl get pods -A -o wide
kubectl get pods -A -o wide | grep rabbitmq | awk '{print $3}' | grep -q '1/1' && echo "rabbitmq pod is running with status 1/1" || (echo "rabbitmq pod is not running with status 1/1" && exit 1)
- name: Install Kerberos Vault
id: install-kerberos-vault
run: |
kubectl create namespace kerberos-vault
kubectl apply -f ./mongodb-configmap.yaml -n kerberos-vault
kubectl apply -f ./kerberos-vault-deployment.yaml -n kerberos-vault
kubectl apply -f ./kerberos-vault-service.yaml -n kerberos-vault
kubectl apply -f ./base/mongodb-configmap.yaml -n kerberos-vault
kubectl apply -f ./base/vault/kerberos-vault-deployment.yaml -n kerberos-vault
kubectl apply -f ./base/vault/kerberos-vault-service.yaml -n kerberos-vault
echo "Sleeping for 30 seconds, give time for the helm chart to create the pods" && sleep 30
kubectl get pods -A -o wide
kubectl get pods -A -o wide | grep kerberos-vault | awk '{print $3}' | grep -q '1/1' && echo "kerberos-vault pod is running with status 1/1" || (echo "kerberos-vault pod is not running with status 1/1" && exit 1)
- name: Install Kerberos Agent
id: install-kerberos-agent
run: |
kubectl apply -f ./kerberos-agent-deployment.yaml
kubectl apply -f ./base/agent/kerberos-agent-deployment.yaml
echo "Sleeping for 30 seconds, give time for the helm chart to create the pods" && sleep 30
kubectl get pods -A -o wide
kubectl get pods -A -o wide | grep agent | awk '{print $3}' | grep -q '1/1' && echo "kerberos-agent pod is running with status 1/1" || (echo "kerberos-agent pod is not running with status 1/1" && exit 1)
- name: Install Data filtering
id: install-data-filtering
run: |
sed -e '/resources/ s/^#*/#/' -i ./data-filtering-deployment.yaml
sed -e '/limits/ s/^#*/#/' -i ./data-filtering-deployment.yaml
sed -e '/nvidia/ s/^#*/#/' -i ./data-filtering-deployment.yaml
kubectl apply -f data-filtering-deployment.yaml
echo "Sleeping for 120 seconds, give time for the helm chart to create the pods" && sleep 120
sed -e '/resources/ s/^#*/#/' -i ./base/vault/data-filtering-deployment.yaml
sed -e '/limits/ s/^#*/#/' -i ./base/vault/data-filtering-deployment.yaml
sed -e '/nvidia/ s/^#*/#/' -i ./base/vault/data-filtering-deployment.yaml
kubectl apply -f ./base/vault/data-filtering-deployment.yaml
echo "Sleeping for 250 seconds, give time for the helm chart to create the pods" && sleep 250
kubectl get pods -A -o wide
kubectl get pods -A -o wide | grep data-filtering | awk '{print $3}' | grep -q '1/1' && echo "data-filtering pod is running with status 1/1" || (echo "data-filtering pod is not running with status 1/1" && exit 1)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file added base/hub/kerberos-hub-pvc.yaml
Empty file.
File renamed without changes.
73 changes: 73 additions & 0 deletions base/hub/kerberos-hub-yolov8.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: data-filtering
labels:
app: data-filtering
spec:
replicas: 1
selector:
matchLabels:
app: data-filtering
template:
metadata:
labels:
app: data-filtering
spec:
containers:
- name: data-filtering
image: uugai/data-filter:1.0.4
resources:
limits:
nvidia.com/gpu: 1 # requesting a single GPU
env:
- name: MODEL_NAME
value: "yolov8n.pt"
- name: CONDITION
value: "1 persons detected"

- name: QUEUE_NAME
value: "data-filtering" # This is the topic of kafka we will read messages from.
- name: QUEUE_HOST
value: rabbitmq.rabbitmq:5672
- name: QUEUE_EXCHANGE
- name: QUEUE_USERNAME
value: yourusername
- name: QUEUE_PASSWORD
value: yourpassword

- name: STORAGE_URI
#value: http://vault-lb.kerberos-vault/api
value: "http://vault-nodeport.kerberos-vault:80/api"
- name: STORAGE_ACCESS_KEY
value: "XJoi2@bgSOvOYBy#"
- name: STORAGE_SECRET_KEY
value: "OGGqat4lXRpL@9XBYc8FUaId@5"

- name: LOGGING
value: "True"
- name: PLOT
value: "False"
- name: SAVE_VIDEO
value: "False"
- name: MEDIA_SAVEPATH
value: "/ml/data/input/video.mp4"
- name: OUTPUT_MEDIA_SAVEPATH
value: "/ml/data/input/output_video.mp4"

- name: TIME_VERBOSE
value: "True"

- name: CLASSIFICATION_FPS
value: "3"
- name: CLASSIFICATION_THRESHOLD
value: "0.3"
- name: MAX_NUMBER_OF_PREDICTIONS
value: "100"
- name: ALLOWED_CLASSIFICATIONS
value: "0, 1, 2, 3, 5, 7, 14, 15, 16, 24, 26, 28"

- name: FORWARDING_MEDIA
value: "True"
- name: REMOVE_AFTER_PROCESSED
value: "True"
7 changes: 7 additions & 0 deletions base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
resources:
- mongodb-configmap.yaml
- kerberos-factory-deployment.yaml
- kerberos-factory-service.yaml
- kerberos-factory-clusterrole.yaml
- kerberos-vault-deployment.yaml
- kerberos-vault-service.yaml
File renamed without changes.
1 change: 1 addition & 0 deletions mongodb-configmap.yaml → base/mongodb-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ data:
# This is the mongodb database where data will be stored, you might use a different name if you want.
MONGODB_DATABASE_STORAGE: "KerberosStorage"
MONGODB_DATABASE_FACTORY: "KerberosFactory"
MONGODB_DATABASE_HUB: "Kerberos"
# MongoDB URI (for example for a SaaS service like MongoDB Atlas)
# If uri is set, the below properties are not used (host, adminDatabase, username, password)
#MONGODB_URI: "mongodb+srv://xx:[email protected]/?retryWrites=true&w=majority&appName=xxx"
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,14 @@ spec:
- name: data-filtering
image: uugai/data-filter:1.0.4
resources:
requests:
cpu: 100m
memory: 512Mi
nvidia.com/gpu: "1"
limits:
nvidia.com/gpu: 1 # requesting a single GPU
cpu: 100m
memory: 512Mi
nvidia.com/gpu: "1" # requesting a single GPU
env:
- name: MODEL_NAME
value: "yolov8n.pt"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
103 changes: 0 additions & 103 deletions kerberos-hub-yolov8.yaml

This file was deleted.

2 changes: 2 additions & 0 deletions overlays/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
resources:
- standalone
Loading

0 comments on commit 48c6c24

Please sign in to comment.