diff options
-rwxr-xr-x | src/flufigut.py | 11 | ||||
-rw-r--r-- | templates/default/kubernetes/flumotion-worker-deploy.yml.j2 | 40 |
2 files changed, 32 insertions, 19 deletions
diff --git a/src/flufigut.py b/src/flufigut.py index 7744b5e..f5b737d 100755 --- a/src/flufigut.py +++ b/src/flufigut.py @@ -216,6 +216,11 @@ class Planet: # # inputs + def __set_input_worker_flags(self, worker, input): + self.workers[worker.name]['flags'] = "input-%s" % input['type'] + if worker.subname: + self.workers[worker.name]['subs'][worker.subname]['flags'] = "input-%s" % input['type'] + def __set_input_properties(self, comp_name, props): for prop in props: if prop == 'resolution': @@ -231,15 +236,19 @@ class Planet: for source, input in self._desc.inputs.items(): comp_name = 'capture-%s' % source comp_desc = 'capture raw data from %s' % (source) + worker = self.__get_worker(comp_name) + self.flow['inputs'][comp_name] = { 'type': input['type'], 'desc': comp_desc, - 'worker': str(self.__get_worker(comp_name)), + 'worker': str(worker), 'master': input['master'], 'properties': {}, } if input['master']: master_cnt += 1 + + self.__set_input_worker_flags(worker, input) self.__set_input_properties(comp_name, input['properties']) if master_cnt == 0: diff --git a/templates/default/kubernetes/flumotion-worker-deploy.yml.j2 b/templates/default/kubernetes/flumotion-worker-deploy.yml.j2 index 778aa06..d184661 100644 --- a/templates/default/kubernetes/flumotion-worker-deploy.yml.j2 +++ b/templates/default/kubernetes/flumotion-worker-deploy.yml.j2 @@ -36,29 +36,33 @@ spec: - -u user - -p test - -F {{ 8000 + loop.index0 * 10 }}-{{ 8001 + loop.index0 * 10 }} -# securityContext: -# privileged: true volumeMounts: - name: home mountPath: /srv -# - name: decklink-devices -# mountPath: /dev/blackmagic -# - name: decklink-libs -# subPath: libDeckLinkAPI.so -# mountPath: /usr/lib/libDeckLinkAPI.so -# - name: decklink-libs -# subPath: libDeckLinkPreviewAPI.so -# mountPath: /usr/lib/libDeckLinkPreviewAPI.so +{% if 'input-decklink' in sub.flags %} + - name: decklink-devices + mountPath: /dev/blackmagic + - name: decklink-libs + subPath: libDeckLinkAPI.so + mountPath: /usr/lib/libDeckLinkAPI.so + - name: decklink-libs + subPath: libDeckLinkPreviewAPI.so + mountPath: /usr/lib/libDeckLinkPreviewAPI.so + securityContext: + privileged: true +{% endif %} {% endfor %} volumes: - name: home emptyDir: medium: Memory -# - name: decklink-devices -# hostPath: -# type: Directory -# path: /dev/blackmagic -# - name: decklink-libs -# hostPath: -# type: Directory -# path: /usr/lib/ +{% if 'input-decklink' in worker.flags %} + - name: decklink-devices + hostPath: + type: Directory + path: /dev/blackmagic + - name: decklink-libs + hostPath: + type: Directory + path: /usr/lib/ +{% endif %} |