From 3b2828e86d0551af3964000b901c684be26d67c9 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Wed, 17 Oct 2012 20:04:58 +0200 Subject: moved output to output/ --- src/audio.json | 2 +- src/flufigut-client.sh | 2 +- src/flufigut.py | 10 ++--- src/manage.sh | 4 +- src/test.json | 2 +- src/test2.json | 2 +- src/update.sh | 4 +- templates/example/aac-encode.xml | 12 ------ templates/example/audio-resample.xml | 12 ------ templates/example/decklink.xml | 13 ------- templates/example/flv-mux.xml | 14 ------- templates/example/h264-encode.xml | 12 ------ templates/example/http-stream.xml | 22 ----------- templates/example/ogg-mux.xml | 14 ------- templates/example/planet.xml | 53 -------------------------- templates/example/porter.xml | 11 ------ templates/example/repeater.xml | 11 ------ templates/example/soundcard.xml | 24 ------------ templates/example/video-resize.xml | 12 ------ templates/example/vorbis-encode.xml | 12 ------ templates/example/vp8-encode.xml | 15 -------- templates/example/webm-mux.xml | 14 ------- templates/example/worker.xml | 20 ---------- templates/flumotion/default/aac-encode.xml | 12 ++++++ templates/flumotion/default/audio-resample.xml | 12 ++++++ templates/flumotion/default/decklink.xml | 13 +++++++ templates/flumotion/default/flv-mux.xml | 14 +++++++ templates/flumotion/default/h264-encode.xml | 12 ++++++ templates/flumotion/default/http-stream.xml | 22 +++++++++++ templates/flumotion/default/ogg-mux.xml | 14 +++++++ templates/flumotion/default/planet.xml | 53 ++++++++++++++++++++++++++ templates/flumotion/default/porter.xml | 11 ++++++ templates/flumotion/default/repeater.xml | 11 ++++++ templates/flumotion/default/soundcard.xml | 24 ++++++++++++ templates/flumotion/default/video-resize.xml | 12 ++++++ templates/flumotion/default/vorbis-encode.xml | 12 ++++++ templates/flumotion/default/vp8-encode.xml | 15 ++++++++ templates/flumotion/default/webm-mux.xml | 14 +++++++ templates/flumotion/default/worker.xml | 20 ++++++++++ 39 files changed, 283 insertions(+), 285 deletions(-) delete mode 100644 templates/example/aac-encode.xml delete mode 100644 templates/example/audio-resample.xml delete mode 100644 templates/example/decklink.xml delete mode 100644 templates/example/flv-mux.xml delete mode 100644 templates/example/h264-encode.xml delete mode 100644 templates/example/http-stream.xml delete mode 100644 templates/example/ogg-mux.xml delete mode 100644 templates/example/planet.xml delete mode 100644 templates/example/porter.xml delete mode 100644 templates/example/repeater.xml delete mode 100644 templates/example/soundcard.xml delete mode 100644 templates/example/video-resize.xml delete mode 100644 templates/example/vorbis-encode.xml delete mode 100644 templates/example/vp8-encode.xml delete mode 100644 templates/example/webm-mux.xml delete mode 100644 templates/example/worker.xml create mode 100644 templates/flumotion/default/aac-encode.xml create mode 100644 templates/flumotion/default/audio-resample.xml create mode 100644 templates/flumotion/default/decklink.xml create mode 100644 templates/flumotion/default/flv-mux.xml create mode 100644 templates/flumotion/default/h264-encode.xml create mode 100644 templates/flumotion/default/http-stream.xml create mode 100644 templates/flumotion/default/ogg-mux.xml create mode 100644 templates/flumotion/default/planet.xml create mode 100644 templates/flumotion/default/porter.xml create mode 100644 templates/flumotion/default/repeater.xml create mode 100644 templates/flumotion/default/soundcard.xml create mode 100644 templates/flumotion/default/video-resize.xml create mode 100644 templates/flumotion/default/vorbis-encode.xml create mode 100644 templates/flumotion/default/vp8-encode.xml create mode 100644 templates/flumotion/default/webm-mux.xml create mode 100644 templates/flumotion/default/worker.xml diff --git a/src/audio.json b/src/audio.json index 435a5d9..cdaa734 100644 --- a/src/audio.json +++ b/src/audio.json @@ -1,6 +1,6 @@ { "globals":{ - "templates": "example", + "templates": "default", "version": "0.10.0", "name": "audio-only", "description": "Audio only test", diff --git a/src/flufigut-client.sh b/src/flufigut-client.sh index 7cb0c54..aabb8dd 100755 --- a/src/flufigut-client.sh +++ b/src/flufigut-client.sh @@ -90,7 +90,7 @@ param=`echo $SSH_ORIGINAL_COMMAND | awk '{ print $2 }'` case "$command" in install) echo -n "install files from '$param' ... " - sudo -u flumotion tar -C "$CONF_DIR" --strip-components=2 -xzf "$param" + sudo -u flumotion tar -C "$CONF_DIR" --strip-components 1 -xzf "$param" rm "$param" echo "done." ;; diff --git a/src/flufigut.py b/src/flufigut.py index d2ef659..0eabdf8 100755 --- a/src/flufigut.py +++ b/src/flufigut.py @@ -368,15 +368,15 @@ if error != 0: # import shutil -shutil.rmtree('output', ignore_errors=True) +shutil.rmtree('output/%s' % output_format, ignore_errors=True) -env = Environment(loader=FileSystemLoader('../templates/%s/' % (globals['templates'])), line_statement_prefix = '%%') +env = Environment(loader=FileSystemLoader('../templates/%s/%s/' % (output_format,globals['templates'])), line_statement_prefix = '%%') print "generating planet '%s/%s'" % (globals['manager']['machine'], globals['name']) template = env.get_template('planet.xml') planet = template.render(globals=globals, atmosphere=atmosphere, flow=flow) -dir = 'output/%s/managers/%s/' % (globals['manager']['machine'], globals['name']) +dir = 'output/%s/%s/managers/%s/' % (output_format, globals['manager']['machine'], globals['name']) if not os.path.exists(dir): os.makedirs(dir) f = open('%s/planet.xml' % (dir), 'w') @@ -384,7 +384,7 @@ f.write(planet.encode("utf8")) f.write('\n') f.close() -passwd = open('output/%s/%s.passwd' % (globals['manager']['machine'], globals['name']), 'w') +passwd = open('output/%s/%s/%s.passwd' % (output_format, globals['manager']['machine'], globals['name']), 'w') port = 9000 for w in worker: @@ -400,7 +400,7 @@ for w in worker: ports = "%i-%i" % (port, port+1) port+=2 workerconf = template.render(globals=globals, name=w, password=password, portrange=ports) - dir = 'output/%s/workers' % machine + dir = 'output/%s/%s/workers' % (output_format, machine) if not os.path.exists(dir): os.makedirs(dir) f = open('%s/%s-%s.xml' % (dir, globals['name'], w), 'w') diff --git a/src/manage.sh b/src/manage.sh index 23ea39e..1cd3a03 100755 --- a/src/manage.sh +++ b/src/manage.sh @@ -37,7 +37,7 @@ # $ sudo ./flufigut-client.sh install # -OUTPUT_DIR="output" +OUTPUT_DIR="output/flumotion" SSH_KEY="id_rsa" SSH_CONFIG="ssh.config" SSH_USER="flufigut" @@ -47,7 +47,7 @@ deploy_all() { if [ -d "$machine" ]; then machine=`basename $machine` echo "copying files to $machine ... " - tar -czf "$OUTPUT_DIR/$machine.tar.gz" "$OUTPUT_DIR/$machine"/* + tar -C "$OUTPUT_DIR" -czf "$OUTPUT_DIR/$machine.tar.gz" "$machine" scp -i "$SSH_KEY" -F "$SSH_CONFIG" "$OUTPUT_DIR/$machine.tar.gz" $SSH_USER@"$machine":/tmp ssh -i "$SSH_KEY" -F "$SSH_CONFIG" $SSH_USER@"$machine" install "/tmp/$machine.tar.gz" fi diff --git a/src/test.json b/src/test.json index 56188fa..b921481 100644 --- a/src/test.json +++ b/src/test.json @@ -1,6 +1,6 @@ { "globals":{ - "templates": "example", + "templates": "default", "version": "0.10.0", "name": "elevate-live", "description": "Live from Elevate Festival 2012", diff --git a/src/test2.json b/src/test2.json index 7b66060..1479563 100644 --- a/src/test2.json +++ b/src/test2.json @@ -1,6 +1,6 @@ { "globals":{ - "templates": "example", + "templates": "default", "version": "0.10.0", "name": "elevate-live", "description": "Live from Elevate Festival 2012", diff --git a/src/update.sh b/src/update.sh index b28347a..18ab61a 100755 --- a/src/update.sh +++ b/src/update.sh @@ -33,11 +33,9 @@ if [ -z "$1" ]; then exit 1 fi -TEMPLATES="example" - ./manage.sh stop ./manage.sh clean -./flufigut.py "$TEMPLATES" $1 +./flufigut.py flumotion $1 ./manage.sh deploy ./manage.sh start diff --git a/templates/example/aac-encode.xml b/templates/example/aac-encode.xml deleted file mode 100644 index e6ad65a..0000000 --- a/templates/example/aac-encode.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - {{ component.feeder }} - - audioconvert ! faac bitrate={{ component.properties['bitrate'] * 1000 }} - false - diff --git a/templates/example/audio-resample.xml b/templates/example/audio-resample.xml deleted file mode 100644 index 7182b01..0000000 --- a/templates/example/audio-resample.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - {{ component.feeder }} - - audioresample ! audio/x-raw-int,rate={{ component.properties['samplerate'] }} - false - diff --git a/templates/example/decklink.xml b/templates/example/decklink.xml deleted file mode 100644 index 5eb6a2a..0000000 --- a/templates/example/decklink.xml +++ /dev/null @@ -1,13 +0,0 @@ - -%% for name, value in component.properties.items() -%% if name != 'samplerate' - {{ value }} -%% endif -%% endfor - {{ component.master }} - diff --git a/templates/example/flv-mux.xml b/templates/example/flv-mux.xml deleted file mode 100644 index a3706da..0000000 --- a/templates/example/flv-mux.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - {{ component.feeder_audio }} -%% if component.feeder_video != 'none' - {{ component.feeder_video }} -%% endif - - false - diff --git a/templates/example/h264-encode.xml b/templates/example/h264-encode.xml deleted file mode 100644 index ba8b136..0000000 --- a/templates/example/h264-encode.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - {{ component.feeder }} - - ffmpegcolorspace ! x264enc bitrate={{ component.properties['bitrate'] }} profile=baseline threads=8 key-int-max=50 byte-stream=false pass=0 cabac=true bframes=0 - false - diff --git a/templates/example/http-stream.xml b/templates/example/http-stream.xml deleted file mode 100644 index 561097a..0000000 --- a/templates/example/http-stream.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - {{ component.feeder }} - - - - {{ component.rrd_clients }} - {{ component.rrd_bytes }} - - -%% for name, value in component.properties.items() -%% if name != 'samplerate' - {{ value }} -%% endif -%% endfor - false - diff --git a/templates/example/ogg-mux.xml b/templates/example/ogg-mux.xml deleted file mode 100644 index 36d7ef5..0000000 --- a/templates/example/ogg-mux.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - {{ component.feeder_audio }} -%% if component.feeder_video != 'none' - {{ component.feeder_video }} -%% endif - - false - diff --git a/templates/example/planet.xml b/templates/example/planet.xml deleted file mode 100644 index c1633ee..0000000 --- a/templates/example/planet.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - -%% for name, value in globals.manager.items() -%% if name != 'machine' - <{{ name }}>{{ value }} -%% endif -%% endfor - - /etc/flumotion/{{ globals.name }}.passwd - - - - -{% for name, component in atmosphere.items() %} -{% include '%s.xml' % component.type %} -{% endfor %} - - - - -{% for name, component in flow['input'].items() %} -{% include '%s.xml' % component.type %} -{% endfor %} - - - -{% for name, component in flow['encoder_audio'].items() %} -{% include '%s.xml' % component.type %} -{% endfor %} - -{% for name, component in flow['encoder_video'].items() %} -{% include '%s.xml' % component.type %} -{% endfor %} - - -{% for name, component in flow['muxer'].items() %} -{% include '%s.xml' % component.type %} -{% endfor %} - - -{% for name, component in flow['repeater'].items() %} -{% include '%s.xml' % component.type %} -{% endfor %} - - -{% for name, component in flow['streamer'].items() %} -{% include '%s.xml' % component.type %} -{% endfor %} - - - diff --git a/templates/example/porter.xml b/templates/example/porter.xml deleted file mode 100644 index cf960bf..0000000 --- a/templates/example/porter.xml +++ /dev/null @@ -1,11 +0,0 @@ - - {{ component.properties['port'] }} - {{ component.properties['socket-path'] }} - {{ component.properties['username'] }} - {{ component.properties['password'] }} - diff --git a/templates/example/repeater.xml b/templates/example/repeater.xml deleted file mode 100644 index aa469ec..0000000 --- a/templates/example/repeater.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - {{ component.feeder }} - - false - diff --git a/templates/example/soundcard.xml b/templates/example/soundcard.xml deleted file mode 100644 index 23df8a4..0000000 --- a/templates/example/soundcard.xml +++ /dev/null @@ -1,24 +0,0 @@ - -%% for name, value in component.properties.items() - {{ value }} -%% endfor - {{ component.master }} - - - - - {{ name }}_raw - - audioconvert ! audio/x-raw-int,rate=(int)48000,width=16,depth=16,channels=2 - false - diff --git a/templates/example/video-resize.xml b/templates/example/video-resize.xml deleted file mode 100644 index 3444bc1..0000000 --- a/templates/example/video-resize.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - {{ component.feeder }} - - videoscale method=bilinear ! video/x-raw-yuv,width={{ component.properties['width'] }},height={{ component.properties['height'] }} - false - diff --git a/templates/example/vorbis-encode.xml b/templates/example/vorbis-encode.xml deleted file mode 100644 index 83471fd..0000000 --- a/templates/example/vorbis-encode.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - {{ component.feeder }} - - {{ component.properties['bitrate'] * 1000 }} - false - diff --git a/templates/example/vp8-encode.xml b/templates/example/vp8-encode.xml deleted file mode 100644 index 97b9e8d..0000000 --- a/templates/example/vp8-encode.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - {{ component.feeder }} - - 50 - {{ component.properties['bitrate'] * 1000 }} - 5 - 8 - false - diff --git a/templates/example/webm-mux.xml b/templates/example/webm-mux.xml deleted file mode 100644 index acace74..0000000 --- a/templates/example/webm-mux.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - {{ component.feeder_audio }} -%% if component.feeder_video != 'none' - {{ component.feeder_video }} -%% endif - - false - diff --git a/templates/example/worker.xml b/templates/example/worker.xml deleted file mode 100644 index b6f4667..0000000 --- a/templates/example/worker.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - -%% for name, value in globals.manager.items() -%% if name != 'machine' - <{{ name }}>{{ value }} -%% endif -%% endfor - - - - {{ name }} - {{ password }} - - - {{ portrange }} -%% if debug and debug != '' - {{ debug }} -%% endif - diff --git a/templates/flumotion/default/aac-encode.xml b/templates/flumotion/default/aac-encode.xml new file mode 100644 index 0000000..e6ad65a --- /dev/null +++ b/templates/flumotion/default/aac-encode.xml @@ -0,0 +1,12 @@ + + + {{ component.feeder }} + + audioconvert ! faac bitrate={{ component.properties['bitrate'] * 1000 }} + false + diff --git a/templates/flumotion/default/audio-resample.xml b/templates/flumotion/default/audio-resample.xml new file mode 100644 index 0000000..7182b01 --- /dev/null +++ b/templates/flumotion/default/audio-resample.xml @@ -0,0 +1,12 @@ + + + {{ component.feeder }} + + audioresample ! audio/x-raw-int,rate={{ component.properties['samplerate'] }} + false + diff --git a/templates/flumotion/default/decklink.xml b/templates/flumotion/default/decklink.xml new file mode 100644 index 0000000..5eb6a2a --- /dev/null +++ b/templates/flumotion/default/decklink.xml @@ -0,0 +1,13 @@ + +%% for name, value in component.properties.items() +%% if name != 'samplerate' + {{ value }} +%% endif +%% endfor + {{ component.master }} + diff --git a/templates/flumotion/default/flv-mux.xml b/templates/flumotion/default/flv-mux.xml new file mode 100644 index 0000000..a3706da --- /dev/null +++ b/templates/flumotion/default/flv-mux.xml @@ -0,0 +1,14 @@ + + + {{ component.feeder_audio }} +%% if component.feeder_video != 'none' + {{ component.feeder_video }} +%% endif + + false + diff --git a/templates/flumotion/default/h264-encode.xml b/templates/flumotion/default/h264-encode.xml new file mode 100644 index 0000000..ba8b136 --- /dev/null +++ b/templates/flumotion/default/h264-encode.xml @@ -0,0 +1,12 @@ + + + {{ component.feeder }} + + ffmpegcolorspace ! x264enc bitrate={{ component.properties['bitrate'] }} profile=baseline threads=8 key-int-max=50 byte-stream=false pass=0 cabac=true bframes=0 + false + diff --git a/templates/flumotion/default/http-stream.xml b/templates/flumotion/default/http-stream.xml new file mode 100644 index 0000000..561097a --- /dev/null +++ b/templates/flumotion/default/http-stream.xml @@ -0,0 +1,22 @@ + + + {{ component.feeder }} + + + + {{ component.rrd_clients }} + {{ component.rrd_bytes }} + + +%% for name, value in component.properties.items() +%% if name != 'samplerate' + {{ value }} +%% endif +%% endfor + false + diff --git a/templates/flumotion/default/ogg-mux.xml b/templates/flumotion/default/ogg-mux.xml new file mode 100644 index 0000000..36d7ef5 --- /dev/null +++ b/templates/flumotion/default/ogg-mux.xml @@ -0,0 +1,14 @@ + + + {{ component.feeder_audio }} +%% if component.feeder_video != 'none' + {{ component.feeder_video }} +%% endif + + false + diff --git a/templates/flumotion/default/planet.xml b/templates/flumotion/default/planet.xml new file mode 100644 index 0000000..c1633ee --- /dev/null +++ b/templates/flumotion/default/planet.xml @@ -0,0 +1,53 @@ + + + + +%% for name, value in globals.manager.items() +%% if name != 'machine' + <{{ name }}>{{ value }} +%% endif +%% endfor + + /etc/flumotion/{{ globals.name }}.passwd + + + + +{% for name, component in atmosphere.items() %} +{% include '%s.xml' % component.type %} +{% endfor %} + + + + +{% for name, component in flow['input'].items() %} +{% include '%s.xml' % component.type %} +{% endfor %} + + + +{% for name, component in flow['encoder_audio'].items() %} +{% include '%s.xml' % component.type %} +{% endfor %} + +{% for name, component in flow['encoder_video'].items() %} +{% include '%s.xml' % component.type %} +{% endfor %} + + +{% for name, component in flow['muxer'].items() %} +{% include '%s.xml' % component.type %} +{% endfor %} + + +{% for name, component in flow['repeater'].items() %} +{% include '%s.xml' % component.type %} +{% endfor %} + + +{% for name, component in flow['streamer'].items() %} +{% include '%s.xml' % component.type %} +{% endfor %} + + + diff --git a/templates/flumotion/default/porter.xml b/templates/flumotion/default/porter.xml new file mode 100644 index 0000000..cf960bf --- /dev/null +++ b/templates/flumotion/default/porter.xml @@ -0,0 +1,11 @@ + + {{ component.properties['port'] }} + {{ component.properties['socket-path'] }} + {{ component.properties['username'] }} + {{ component.properties['password'] }} + diff --git a/templates/flumotion/default/repeater.xml b/templates/flumotion/default/repeater.xml new file mode 100644 index 0000000..aa469ec --- /dev/null +++ b/templates/flumotion/default/repeater.xml @@ -0,0 +1,11 @@ + + + {{ component.feeder }} + + false + diff --git a/templates/flumotion/default/soundcard.xml b/templates/flumotion/default/soundcard.xml new file mode 100644 index 0000000..23df8a4 --- /dev/null +++ b/templates/flumotion/default/soundcard.xml @@ -0,0 +1,24 @@ + +%% for name, value in component.properties.items() + {{ value }} +%% endfor + {{ component.master }} + + + + + {{ name }}_raw + + audioconvert ! audio/x-raw-int,rate=(int)48000,width=16,depth=16,channels=2 + false + diff --git a/templates/flumotion/default/video-resize.xml b/templates/flumotion/default/video-resize.xml new file mode 100644 index 0000000..3444bc1 --- /dev/null +++ b/templates/flumotion/default/video-resize.xml @@ -0,0 +1,12 @@ + + + {{ component.feeder }} + + videoscale method=bilinear ! video/x-raw-yuv,width={{ component.properties['width'] }},height={{ component.properties['height'] }} + false + diff --git a/templates/flumotion/default/vorbis-encode.xml b/templates/flumotion/default/vorbis-encode.xml new file mode 100644 index 0000000..83471fd --- /dev/null +++ b/templates/flumotion/default/vorbis-encode.xml @@ -0,0 +1,12 @@ + + + {{ component.feeder }} + + {{ component.properties['bitrate'] * 1000 }} + false + diff --git a/templates/flumotion/default/vp8-encode.xml b/templates/flumotion/default/vp8-encode.xml new file mode 100644 index 0000000..97b9e8d --- /dev/null +++ b/templates/flumotion/default/vp8-encode.xml @@ -0,0 +1,15 @@ + + + {{ component.feeder }} + + 50 + {{ component.properties['bitrate'] * 1000 }} + 5 + 8 + false + diff --git a/templates/flumotion/default/webm-mux.xml b/templates/flumotion/default/webm-mux.xml new file mode 100644 index 0000000..acace74 --- /dev/null +++ b/templates/flumotion/default/webm-mux.xml @@ -0,0 +1,14 @@ + + + {{ component.feeder_audio }} +%% if component.feeder_video != 'none' + {{ component.feeder_video }} +%% endif + + false + diff --git a/templates/flumotion/default/worker.xml b/templates/flumotion/default/worker.xml new file mode 100644 index 0000000..b6f4667 --- /dev/null +++ b/templates/flumotion/default/worker.xml @@ -0,0 +1,20 @@ + + + +%% for name, value in globals.manager.items() +%% if name != 'machine' + <{{ name }}>{{ value }} +%% endif +%% endfor + + + + {{ name }} + {{ password }} + + + {{ portrange }} +%% if debug and debug != '' + {{ debug }} +%% endif + -- cgit v1.2.3