summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2012-10-13 15:50:34 +0200
committerChristian Pointner <equinox@spreadspace.org>2012-10-13 15:50:34 +0200
commit0d5e46ea593b48a92f8a800d2ef633a6e8858c7b (patch)
tree00f46ffce906a98f8a449fc61636a43adfac7403
parentdeployment and start, stop, restart work now (diff)
admin account can now be configured in json file
some bugfixes video encoder now use 8 threads
-rwxr-xr-xsrc/flufigut.py20
-rwxr-xr-xsrc/manage.sh7
-rwxr-xr-xsrc/update.sh43
-rw-r--r--templates/example/h264-encode.xml2
-rw-r--r--templates/example/vp8-encode.xml2
5 files changed, 57 insertions, 17 deletions
diff --git a/src/flufigut.py b/src/flufigut.py
index ae4edb4..b1e04af 100755
--- a/src/flufigut.py
+++ b/src/flufigut.py
@@ -363,14 +363,18 @@ for w in worker:
salt = rand_string(6)
passwd.write("%s:%s\n" % (w, crypt.crypt(password, salt)));
-user = raw_input("username of administrator: ")
-if user == "":
- raise SystemExit("WARN: empty username (not creating admin account)")
-
-password = getpass.getpass("password for '%s': " % user)
-password2 = getpass.getpass("retype password for '%s': " % user)
-if password != password2:
- raise SystemExit("WARN: passwords don't match (not creating admin account)")
+if "admin" in globals:
+ user = globals['admin']['username']
+ password = globals['admin']['password']
+else:
+ user = raw_input("username of administrator (leave empty for none): ")
+ if user == "":
+ raise SystemExit("WARN: empty username (not creating admin account)")
+
+ password = getpass.getpass("password for '%s': " % user)
+ password2 = getpass.getpass("retype password for '%s': " % user)
+ if password != password2:
+ raise SystemExit("WARN: passwords don't match (not creating admin account)")
salt = rand_string(6)
passwd.write("%s:%s\n" % (user, crypt.crypt(password, salt)));
diff --git a/src/manage.sh b/src/manage.sh
index d6fb813..76f2358 100755
--- a/src/manage.sh
+++ b/src/manage.sh
@@ -52,7 +52,6 @@ deploy_all() {
tar -czf "$OUTPUT_DIR/$machine.tar.gz" "$OUTPUT_DIR/$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"
- rm "$OUTPUT_DIR/$machine.tar.gz"
fi
done
}
@@ -82,7 +81,6 @@ start_all() {
echo " $machine (manager, worker)"
generate_instance_list $machine
ssh -i "$SSH_KEY" -F "$SSH_CONFIG" $SSH_USER@"$machine" start < "$OUTPUT_DIR/$machine.list"
- rm "$OUTPUT_DIR/$machine.list"
break
fi
done
@@ -92,8 +90,6 @@ start_all() {
echo " $machine (worker)"
generate_instance_list $machine
ssh -i "$SSH_KEY" -F "$SSH_CONFIG" $SSH_USER@"$machine" start < "$OUTPUT_DIR/$machine.list"
- rm "$OUTPUT_DIR/$machine.list"
- break
fi
done
}
@@ -105,8 +101,6 @@ stop_all() {
echo " $machine (worker)"
generate_instance_list $machine
ssh -i "$SSH_KEY" -F "$SSH_CONFIG" $SSH_USER@"$machine" stop < "$OUTPUT_DIR/$machine.list"
- rm "$OUTPUT_DIR/$machine.list"
- break
fi
done
for machine in "$OUTPUT_DIR"/*; do
@@ -115,7 +109,6 @@ stop_all() {
echo " $machine (manager, worker)"
generate_instance_list $machine
ssh -i "$SSH_KEY" -F "$SSH_CONFIG" $SSH_USER@"$machine" stop < "$OUTPUT_DIR/$machine.list"
- rm "$OUTPUT_DIR/$machine.list"
break
fi
done
diff --git a/src/update.sh b/src/update.sh
new file mode 100755
index 0000000..ca4f028
--- /dev/null
+++ b/src/update.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+#
+# flufigut
+#
+# flufigut, the flumotion configuration utility, is a simple tool
+# that generates flumotion configuration files using pyhton jinja2
+# template engine and simplejson. flufigut generates planet.xml
+# and worker.xml files from configuration templates and an easy to
+# understand representation of the flow structure written in json.
+#
+#
+# Copyright (C) 2012 Christian Pointner <equinox@spreadspace.org>
+# Michael Gebetsroither <michael@mgeb.org>
+#
+# This file is part of flufigut.
+#
+# flufigut is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# any later version.
+#
+# flufigut is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with flufigut. If not, see <http://www.gnu.org/licenses/>.
+#
+
+if [ -z "$1" ]; then
+ echo "Usage: $0 <config file>"
+ exit 1
+fi
+
+TEMPLATES="example"
+
+./manage.sh stop
+./flufigut.py "$TEMPLATES" $1
+./manage.sh deploy
+./manage.sh start
+
+exit 0
diff --git a/templates/example/h264-encode.xml b/templates/example/h264-encode.xml
index 9e85b0d..ba8b136 100644
--- a/templates/example/h264-encode.xml
+++ b/templates/example/h264-encode.xml
@@ -7,6 +7,6 @@
<eater name="default">
<feed alias="default">{{ component.feeder }}</feed>
</eater>
- <property name="pipeline">ffmpegcolorspace ! x264enc bitrate={{ component.properties['bitrate'] }} profile=baseline threads=6 key-int-max=50 byte-stream=false pass=0 cabac=true bframes=0</property>
+ <property name="pipeline">ffmpegcolorspace ! x264enc bitrate={{ component.properties['bitrate'] }} profile=baseline threads=8 key-int-max=50 byte-stream=false pass=0 cabac=true bframes=0</property>
<clock-master>false</clock-master>
</component>
diff --git a/templates/example/vp8-encode.xml b/templates/example/vp8-encode.xml
index 8c3fc1c..424295f 100644
--- a/templates/example/vp8-encode.xml
+++ b/templates/example/vp8-encode.xml
@@ -9,6 +9,6 @@
</eater>
<property name="keyframe-maxdistance">50</property>
<property name="bitrate">{{ component.properties['bitrate'] * 1000 }}</property>
- <property name="threads">6</property>
+ <property name="threads">8</property>
<clock-master>false</clock-master>
</component>