diff options
author | Christian Pointner <equinox@spreadspace.org> | 2012-10-02 17:57:20 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2012-10-02 17:57:20 +0200 |
commit | a9c06aa5b5e0ea74458d754be4f8f9932db465c6 (patch) | |
tree | 284e651434ac8b44ae3b520ffcc27c3c4893977b /src | |
parent | redesign of streamer definition (diff) |
streamer seem to work now
Diffstat (limited to 'src')
-rwxr-xr-x | src/flufigut.py | 33 | ||||
-rw-r--r-- | src/test.json | 12 |
2 files changed, 41 insertions, 4 deletions
diff --git a/src/flufigut.py b/src/flufigut.py index 04216ea..635b48c 100755 --- a/src/flufigut.py +++ b/src/flufigut.py @@ -226,14 +226,45 @@ for cluster in stream.keys(): for profile in transcode[format]: feeder = 'muxer-%s-%s' % (format, profile) name = '%s-%s%i-%s-%s' % (stream[cluster]['type'], cluster, idx+1, format, profile) + mount_point = '/%s-%s.%s' % (format, profile, globals['formats'][format]['muxer']) + if streamer_cnt > 1: + hostname = "%s.%s" % (stream[cluster]['hostname'] % (idx+1), globals['domain']) + if idx != 0: + hostname_next = "%s.%s" % (stream[cluster]['hostname'] % (idx), globals['domain']) + else: + hostname_next = "%s.%s" % (stream[cluster]['hostname'] % (streamer_cnt), globals['domain']) + else: + hostname = "%s.%s" % (stream[cluster]['hostname'], globals['domain']) flow['streamer'][name] = { 'type': "%s-stream" % stream[cluster]['type'], - 'desc': "%s streamer for %s-%s (part %i of %s)" % (stream[cluster]['type'], format, profile, idx+1, cluster), + 'desc': "%s streamer for %s-%s (part %i of %s cluster)" % (stream[cluster]['type'], format, profile, idx+1, cluster), 'worker': worker, 'feeder': feeder, + 'rrd_clients' : "%s/%s_clients.rrd" % (globals['rrd-dir'], name), + 'rrd_bytes' : "%s/%s_bytes.rrd" % (globals['rrd-dir'], name), 'properties': { + 'description': globals['description'], + 'type': 'slave', + 'porter-socket-path': machines[machine]['porter'][port]['socket-path'], + 'porter-username': machines[machine]['porter'][port]['username'], + 'porter-password': machines[machine]['porter'][port]['password'], + 'mount-point': mount_point, + 'hostname': hostname, + 'port': port, } } + for prop in stream[cluster]: + if prop == 'max-con': + flow['streamer'][name]['properties']['client-limit'] = stream[cluster][prop] + if streamer_cnt > 1: + flow['streamer'][name]['properties']['redirect-on-overflow'] = "http://%s:%i%s" % (hostname_next, port, mount_point) + if prop == 'max-bw': + flow['streamer'][name]['properties']['bandwidth-limit'] = stream[cluster][prop] + if streamer_cnt > 1: + flow['streamer'][name]['properties']['redirect-on-overflow'] = "http://%s:%i%s" % (hostname_next, port, mount_point) + if prop == 'burst-on-connect': + flow['streamer'][name]['properties']['burst-on-connect'] = 'true' + flow['streamer'][name]['properties']['burst-time'] = stream[cluster][prop] ### initialize and render templates ############################# diff --git a/src/test.json b/src/test.json index d03845e..abe35f8 100644 --- a/src/test.json +++ b/src/test.json @@ -1,8 +1,10 @@ { "globals":{ - "name": "emc", + "name": "elevate-live", + "description": "Live from Elevate Festival 2012", "domain": "spreadspace.org", "passwdfile": "/etc/flumotion/passwd", + "rrd-dir": "/var/lib/flumotion/rrd", "manager": "titan", "version": "0.10.0", "resolutions": { @@ -46,11 +48,15 @@ "stream": { "streamer-local": { "formats": [ "flash", "webm", "ogg-audio" ], - "type": "http", "count": 1, "port": 8000, "max-con": 5 + "type": "http", "count": 1, "port": 8000, + "max-con": 5, "burst-on-connect": 5, + "hostname": "elevate-feed" }, "streamer-pub": { "formats": [ "flash", "webm" ], - "type": "http", "count": 3, "port": 8000, "max-bw": 290000 + "type": "http", "count": 3, "port": 8000, + "max-bw": 290000, "burst-on-connect": 5, + "hostname": "elevate-live%i" } } } |