-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
508 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |
86 changes: 86 additions & 0 deletions
86
config/samples/k8s/mmsys-test-encode/job-task-mmsys-test-encode-baseline-simple.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
86 changes: 86 additions & 0 deletions
86
config/samples/k8s/mmsys-test-encode/job-task-mmsys-test-encode-baseline-split-merge.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
86 changes: 86 additions & 0 deletions
86
config/samples/k8s/mmsys-test-encode/job-task-mmsys-test-encode-test-no-recovery-simple.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.