Skip to content

Commit

Permalink
Add samples for mmsys-test-encode
Browse files Browse the repository at this point in the history
  • Loading branch information
mtneug committed Nov 21, 2023
1 parent c93e110 commit c3f9a55
Show file tree
Hide file tree
Showing 7 changed files with 508 additions and 0 deletions.
57 changes: 57 additions & 0 deletions config/samples/k8s/mmsys-test-encode/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Example for mmsys-test-encode operation

This example shows task execution of the `mmsys-test-encode` function demonstrating MPEG NBMP task recovery using event sourcing.

```sh
# create cluster
make kind-up
kubectl create namespace mmsys-test-encode

# upload media to S3
kubectl -n mmsys-test-encode apply -f config/samples/k8s/mmsys-test-encode/job-upload-media.yaml
kubectl -n mmsys-test-encode wait --timeout=-1s --for=condition=complete job/upload-media
kubectl -n mmsys-test-encode delete job upload-media

# create secrets
kubectl -n mmsys-test-encode create secret generic workflow-manager-helper-data-mmsys-test-encode-baseline-simple "--from-literal=data.yaml=$(
cat config/samples/nagare-media/workflow-manager-helper-data_mmsys-test-encode-baseline-simple.yaml \
| sed 's/localhost:9000/minio.s3.svc.cluster.local:9000/g' \
| sed 's/localhost:4222/nats.nats.svc.cluster.local:4222/g'
)"
kubectl -n mmsys-test-encode create secret generic workflow-manager-helper-data-mmsys-test-encode-baseline-split-merge "--from-literal=data.yaml=$(
cat config/samples/nagare-media/workflow-manager-helper-data_mmsys-test-encode-baseline-split-merge.yaml \
| sed 's/localhost:9000/minio.s3.svc.cluster.local:9000/g' \
| sed 's/localhost:4222/nats.nats.svc.cluster.local:4222/g'
)"
kubectl -n mmsys-test-encode create secret generic workflow-manager-helper-data-mmsys-test-encode-test-no-recovery-simple "--from-literal=data.yaml=$(
cat config/samples/nagare-media/workflow-manager-helper-data_mmsys-test-encode-test-no-recovery-simple.yaml \
| sed 's/localhost:9000/minio.s3.svc.cluster.local:9000/g' \
| sed 's/localhost:4222/nats.nats.svc.cluster.local:4222/g'
)"
kubectl -n mmsys-test-encode create secret generic workflow-manager-helper-data-mmsys-test-encode-test-no-recovery-split-merge "--from-literal=data.yaml=$(
cat config/samples/nagare-media/workflow-manager-helper-data_mmsys-test-encode-test-no-recovery-split-merge.yaml \
| sed 's/localhost:9000/minio.s3.svc.cluster.local:9000/g' \
| sed 's/localhost:4222/nats.nats.svc.cluster.local:4222/g'
)"
kubectl -n mmsys-test-encode create secret generic workflow-manager-helper-data-mmsys-test-encode-test-recovery-split-merge "--from-literal=data.yaml=$(
cat config/samples/nagare-media/workflow-manager-helper-data_mmsys-test-encode-test-recovery-split-merge.yaml \
| sed 's/localhost:9000/minio.s3.svc.cluster.local:9000/g' \
| sed 's/localhost:4222/nats.nats.svc.cluster.local:4222/g'
)"

# create jobs
kubectl -n mmsys-test-encode apply -f config/samples/k8s/mmsys-test-encode/job-task-mmsys-test-encode-baseline-simple.yaml
kubectl -n mmsys-test-encode wait --timeout=-1s --for=condition=complete job/task-mmsys-test-encode-baseline-simple

kubectl -n mmsys-test-encode apply -f config/samples/k8s/mmsys-test-encode/job-task-mmsys-test-encode-baseline-split-merge.yaml
kubectl -n mmsys-test-encode wait --timeout=-1s --for=condition=complete job/task-mmsys-test-encode-baseline-split-merge

kubectl -n mmsys-test-encode apply -f config/samples/k8s/mmsys-test-encode/job-task-mmsys-test-encode-test-no-recovery-simple.yaml
kubectl -n mmsys-test-encode wait --timeout=-1s --for=condition=complete job/task-mmsys-test-encode-test-no-recovery-simple

kubectl -n mmsys-test-encode apply -f config/samples/k8s/mmsys-test-encode/job-task-mmsys-test-encode-test-no-recovery-split-merge.yaml
kubectl -n mmsys-test-encode wait --timeout=-1s --for=condition=complete job/task-mmsys-test-encode-test-no-recovery-split-merge

kubectl -n mmsys-test-encode apply -f config/samples/k8s/mmsys-test-encode/job-task-mmsys-test-encode-test-recovery-split-merge.yaml
kubectl -n mmsys-test-encode wait --timeout=-1s --for=condition=complete job/task-mmsys-test-encode-test-recovery-split-merge
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
apiVersion: batch/v1
kind: Job
metadata:
name: task-mmsys-test-encode-baseline-simple
spec:
backoffLimit: 10
podFailurePolicy:
rules:
- action: Ignore
onPodConditions:
- type: DisruptionTarget
ttlSecondsAfterFinished: 86400
template:
metadata:
annotations:
kubectl.kubernetes.io/default-container: function
spec:
restartPolicy: Never # recreate pod by job controller
terminationGracePeriodSeconds: 35
containers:
- name: function
imagePullPolicy: Always
image: ghcr.io/nagare-media/engine/function-mmsys-test-encode:dev
ports:
- name: task-api
containerPort: 8888
protocol: TCP
startupProbe:
failureThreshold: 60
periodSeconds: 2
httpGet:
path: /healthz
port: task-api
readinessProbe:
periodSeconds: 2
httpGet:
path: /readyz
port: task-api
livenessProbe:
periodSeconds: 2
httpGet:
path: /healthz
port: task-api
resources:
requests:
cpu: 7000m
memory: 2Gi
- name: workflow-manager-helper
imagePullPolicy: Always
image: ghcr.io/nagare-media/engine/workflow-manager-helper:dev
args: [ "--config", "/config/workflow-manager-helper.yaml", "/run/secrets/engine.nagare.media/task/data.yaml" ]
ports:
- name: event-api
containerPort: 8181
protocol: TCP
startupProbe:
failureThreshold: 60
periodSeconds: 2
httpGet:
path: /healthz
port: event-api
readinessProbe:
periodSeconds: 2
httpGet:
path: /readyz
port: event-api
livenessProbe:
periodSeconds: 2
httpGet:
path: /healthz
port: event-api
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 100m
memory: 128Mi
volumeMounts:
- name: task-data
mountPath: /run/secrets/engine.nagare.media/task
readOnly: true
volumes:
- name: task-data
secret:
secretName: workflow-manager-helper-data-mmsys-test-encode-baseline-simple
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
apiVersion: batch/v1
kind: Job
metadata:
name: task-mmsys-test-encode-baseline-simple
spec:
backoffLimit: 10
podFailurePolicy:
rules:
- action: Ignore
onPodConditions:
- type: DisruptionTarget
ttlSecondsAfterFinished: 86400
template:
metadata:
annotations:
kubectl.kubernetes.io/default-container: function
spec:
restartPolicy: Never # recreate pod by job controller
terminationGracePeriodSeconds: 35
containers:
- name: function
imagePullPolicy: Always
image: ghcr.io/nagare-media/engine/function-mmsys-test-encode:dev
ports:
- name: task-api
containerPort: 8888
protocol: TCP
startupProbe:
failureThreshold: 60
periodSeconds: 2
httpGet:
path: /healthz
port: task-api
readinessProbe:
periodSeconds: 2
httpGet:
path: /readyz
port: task-api
livenessProbe:
periodSeconds: 2
httpGet:
path: /healthz
port: task-api
resources:
requests:
cpu: 7000m
memory: 2Gi
- name: workflow-manager-helper
imagePullPolicy: Always
image: ghcr.io/nagare-media/engine/workflow-manager-helper:dev
args: [ "--config", "/config/workflow-manager-helper.yaml", "/run/secrets/engine.nagare.media/task/data.yaml" ]
ports:
- name: event-api
containerPort: 8181
protocol: TCP
startupProbe:
failureThreshold: 60
periodSeconds: 2
httpGet:
path: /healthz
port: event-api
readinessProbe:
periodSeconds: 2
httpGet:
path: /readyz
port: event-api
livenessProbe:
periodSeconds: 2
httpGet:
path: /healthz
port: event-api
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 100m
memory: 128Mi
volumeMounts:
- name: task-data
mountPath: /run/secrets/engine.nagare.media/task
readOnly: true
volumes:
- name: task-data
secret:
secretName: workflow-manager-helper-data-mmsys-test-encode-baseline-split-merge
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
apiVersion: batch/v1
kind: Job
metadata:
name: task-mmsys-test-encode-baseline-simple
spec:
backoffLimit: 10
podFailurePolicy:
rules:
- action: Ignore
onPodConditions:
- type: DisruptionTarget
ttlSecondsAfterFinished: 86400
template:
metadata:
annotations:
kubectl.kubernetes.io/default-container: function
spec:
restartPolicy: Never # recreate pod by job controller
terminationGracePeriodSeconds: 35
containers:
- name: function
imagePullPolicy: Always
image: ghcr.io/nagare-media/engine/function-mmsys-test-encode:dev
ports:
- name: task-api
containerPort: 8888
protocol: TCP
startupProbe:
failureThreshold: 60
periodSeconds: 2
httpGet:
path: /healthz
port: task-api
readinessProbe:
periodSeconds: 2
httpGet:
path: /readyz
port: task-api
livenessProbe:
periodSeconds: 2
httpGet:
path: /healthz
port: task-api
resources:
requests:
cpu: 7000m
memory: 2Gi
- name: workflow-manager-helper
imagePullPolicy: Always
image: ghcr.io/nagare-media/engine/workflow-manager-helper:dev
args: [ "--config", "/config/workflow-manager-helper.yaml", "/run/secrets/engine.nagare.media/task/data.yaml" ]
ports:
- name: event-api
containerPort: 8181
protocol: TCP
startupProbe:
failureThreshold: 60
periodSeconds: 2
httpGet:
path: /healthz
port: event-api
readinessProbe:
periodSeconds: 2
httpGet:
path: /readyz
port: event-api
livenessProbe:
periodSeconds: 2
httpGet:
path: /healthz
port: event-api
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 100m
memory: 128Mi
volumeMounts:
- name: task-data
mountPath: /run/secrets/engine.nagare.media/task
readOnly: true
volumes:
- name: task-data
secret:
secretName: workflow-manager-helper-data-mmsys-test-encode-test-no-recovery-simple
Loading

0 comments on commit c3f9a55

Please sign in to comment.