summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2018-02-10 19:17:08 +0100
committerChristian Pointner <equinox@spreadspace.org>2018-02-10 19:17:08 +0100
commit9e81bbd8db0658def59694b9d5e29e461c759e1d (patch)
tree4bac74180a5b121c2c472f207328e76726d005fe
parentrevised worker flags (diff)
make use of new and revised worker flags for inputs
-rw-r--r--src/examples/elevate2018.yml26
-rwxr-xr-xsrc/flufigut.py46
-rw-r--r--templates/default/kubernetes/flumotion-worker-deploy.yml.j236
3 files changed, 65 insertions, 43 deletions
diff --git a/src/examples/elevate2018.yml b/src/examples/elevate2018.yml
index daa4abe..64605e7 100644
--- a/src/examples/elevate2018.yml
+++ b/src/examples/elevate2018.yml
@@ -97,16 +97,16 @@ streams:
burst-on-connect: 5
hostname: "elevate-live%i.spreadspace.org"
repeater: True
-records:
- av:
- mux: avr
- format: rec
- profile: rec
- directory: /srv/recording/elevate-2018
- filename: "%Y-%m-%d %H-%M-%S"
- audio:
- mux: audio-orig
- format: ogg
- profile: high
- directory: /srv/recording/elevate-2018
- filename: "%Y-%m-%d %H-%M-%S"
+# records:
+# av:
+# mux: avr
+# format: rec
+# profile: rec
+# directory: /srv/recording/elevate-2018
+# filename: "%Y-%m-%d %H-%M-%S"
+# audio:
+# mux: audio-orig
+# format: ogg
+# profile: high
+# directory: /srv/recording/elevate-2018
+# filename: "%Y-%m-%d %H-%M-%S"
diff --git a/src/flufigut.py b/src/flufigut.py
index aa5d2ce..d0de644 100755
--- a/src/flufigut.py
+++ b/src/flufigut.py
@@ -707,29 +707,29 @@ if __name__ == '__main__':
print("- " + c)
sys.exit(1)
- print("****************************************************")
- print("** atmosphere **")
- print("**")
- __pp.pprint(p.atmosphere)
- print("**")
- print("**************************")
- print("** planet **")
- print("**")
- __pp.pprint(p.flow)
- print("**")
- print("**************************")
- print("** _workers_ **")
- print("**")
- __pp.pprint(p.workers)
- print("**")
- print("****************************************************")
-
- # k8s = K8sDeployment(d, p)
- # print("wiping exisiting namespace ...")
- # k8s.wipe()
- # print("deploying new planet ...")
- # k8s.deploy('../templates')
- # print("done.")
+ # print("****************************************************")
+ # print("** atmosphere **")
+ # print("**")
+ # __pp.pprint(p.atmosphere)
+ # print("**")
+ # print("**************************")
+ # print("** planet **")
+ # print("**")
+ # __pp.pprint(p.flow)
+ # print("**")
+ # print("**************************")
+ # print("** _workers_ **")
+ # print("**")
+ # __pp.pprint(p.workers)
+ # print("**")
+ # print("****************************************************")
+
+ k8s = K8sDeployment(d, p)
+ print("wiping exisiting namespace ...")
+ k8s.wipe()
+ print("deploying new planet ...")
+ k8s.deploy('../templates')
+ print("done.")
except Exception as e:
print("ERROR: while running app: %s" % e)
diff --git a/templates/default/kubernetes/flumotion-worker-deploy.yml.j2 b/templates/default/kubernetes/flumotion-worker-deploy.yml.j2
index bee42cc..0705364 100644
--- a/templates/default/kubernetes/flumotion-worker-deploy.yml.j2
+++ b/templates/default/kubernetes/flumotion-worker-deploy.yml.j2
@@ -48,30 +48,52 @@ spec:
volumeMounts:
- name: home
mountPath: /srv
-%% if 'input-decklink' in sub.flags
- - name: decklink-devices
- mountPath: /dev/blackmagic
+%% if 'input' in sub.flags
+%% set _needs_ = { 'decklink_libs': False, 'privileged': False }
+%% for input_name in worker.flags.input
+%% if desc.inputs[input_name].type == 'decklink'
+%% if _needs_.update({'decklink_libs': True, 'privileged': True})
+%# jinja variables are weird... https://stackoverflow.com/questions/9486393
+%% endif
+ - name: decklink-device-{{ desc.inputs[input_name].properties.device }}
+ mountPath: /dev/blackmagic/dv{{ desc.inputs[input_name].properties.device }}
+%% endif
+%% endfor
+%% if _needs_.decklink_libs
- name: decklink-libs
subPath: libDeckLinkAPI.so
mountPath: /usr/lib/libDeckLinkAPI.so
- name: decklink-libs
subPath: libDeckLinkPreviewAPI.so
mountPath: /usr/lib/libDeckLinkPreviewAPI.so
+%% endif
+%% if _needs_.privileged
securityContext:
privileged: true
+%% endif
%% endif
%% endfor
volumes:
- name: home
emptyDir:
medium: Memory
-%% if 'input-decklink' in worker.flags
- - name: decklink-devices
+%% if 'input' in worker.flags
+%% set _needs_ = { 'decklink_libs': False }
+%% for input_name in worker.flags.input
+%% if desc.inputs[input_name].type == 'decklink'
+%% if _needs_.update({'decklink_libs': True})
+%# jinja variables are weird... https://stackoverflow.com/questions/9486393
+%% endif
+ - name: decklink-device-{{ desc.inputs[input_name].properties.device }}
hostPath:
- type: Directory
- path: /dev/blackmagic
+ type: File {# CharDevice doesn't work for some reason... #}
+ path: /dev/blackmagic/dv{{ desc.inputs[input_name].properties.device }}
+%% endif
+%% endfor
+%% if _needs_.decklink_libs
- name: decklink-libs
hostPath:
type: Directory
path: /usr/lib/
+%% endif
%% endif