[PATCH] [Kimchi 0/2] Live Migration v5
by sguimaraes943@gmail.com
From: samhenri <samuel.guimaraes(a)eldorado.org.br>
- Rebased initial checkin for live migration to new-ui;
- Added form validation to optional fields (e.g. disable submit button if username is filled but password is empty, added warn classes to form fields);
- Fixed error messages in modal window;
- Delete VM once Live Migration is finished checkbox is working;
Socorro Stoppler (1):
Initial checkin for live migration UI support
samhenri (1):
Live Migration front-end
ui/js/src/kimchi.api.js | 3 +-
ui/js/src/kimchi.guest_livemigration.js | 145 ++++++++++++++++++++++++++++++++
ui/js/src/kimchi.guest_main.js | 47 +++++++++--
ui/pages/guest-migration.html.tmpl | 67 +++++++++++++++
ui/pages/guest.html.tmpl | 7 +-
ui/pages/i18n.json.tmpl | 2 +
ui/pages/tabs/guests.html.tmpl | 4 +-
7 files changed, 261 insertions(+), 14 deletions(-)
create mode 100644 ui/js/src/kimchi.guest_livemigration.js
create mode 100644 ui/pages/guest-migration.html.tmpl
--
1.9.3
8 years, 10 months
[PATCH] [Kimchi 0/2] Live Migration v6
by sguimaraes943@gmail.com
From: Samuel Guimarães <sguimaraes943(a)gmail.com>
v5
- Rebased initial checkin for live migration to new-ui;
- Added form validation to optional fields (e.g. disable submit button if username is filled but password is empty, added warn classes to form fields);
- Fixed error messages in modal window;
- Delete VM once Live Migration is finished checkbox is working;
v6
- wok.window.close() destroys modal content when called. Before sending the necessary parameters to perform a migration to Kimchi API, all the input values including the "Delete..." checkbox had to be stored in an array including the VM name and then called a function to keep track of the ongoing tasks and verify if the VM should be deleted based on the checkbox value.
- Rewrote most of the JS in kimchi.guest_livemigration.js
- Fixed asynchronous live migration proccess.
- Fixed some minor issues with Guests main page when Cloning, Creating and Migrating VMs (this wasn't listed as a bug nor enhancement on Github but it had to be fixed in order to show "Migrating..." text on the Action button for List and Gallery views)
- Small change in SCSS and CSS to fix Action button.
- Now when a VM is migrating it is removed from the list and attached to the top just like when it is cloning or creating a new VM. In order to keep the migrating guest in the same position it would require other js libraries or more prototype functions just to handle the arrays in this screen.
- Had to change a line in /models/vms.py because getTasksByFilter() wasn't working when trying to get all the migrating guests by "/plugins/kimchi/vms/.+/migrate"
Socorro Stoppler (1):
Initial checkin for live migration UI support
samhenri (1):
Live Migration front-end
model/vms.py | 2 +-
ui/css/kimchi.css | 21 +++--
ui/css/src/modules/_guests.scss | 6 +-
ui/js/src/kimchi.api.js | 3 +-
ui/js/src/kimchi.guest_livemigration.js | 136 ++++++++++++++++++++++++++++++++
ui/js/src/kimchi.guest_main.js | 58 +++++++++++---
ui/pages/guest-migration.html.tmpl | 67 ++++++++++++++++
ui/pages/guest.html.tmpl | 16 ++--
ui/pages/i18n.json.tmpl | 2 +
ui/pages/tabs/guests.html.tmpl | 4 +-
10 files changed, 290 insertions(+), 25 deletions(-)
create mode 100644 ui/js/src/kimchi.guest_livemigration.js
create mode 100644 ui/pages/guest-migration.html.tmpl
--
1.8.3.1
8 years, 10 months
[Wok v2] Rotate wok logs
by Ramon Medeiros
Use logrotate to compress and keep 10 logs of 1MB
Signed-off-by: Ramon Medeiros <ramonn(a)linux.vnet.ibm.com>
---
Changes:
v2:
Add logrotate as dependency
Fix typo in Copyright
Makefile.am | 2 ++
contrib/DEBIAN/control.in | 1 +
contrib/Makefile.am | 1 +
contrib/wok.spec.fedora.in | 2 ++
contrib/wok.spec.suse.in | 2 ++
contrib/wokd.logrotate | 28 ++++++++++++++++++++++++++++
6 files changed, 36 insertions(+)
create mode 100644 contrib/wokd.logrotate
diff --git a/Makefile.am b/Makefile.am
index 278bda1..6d4c574 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -140,6 +140,8 @@ install-data-local:
mkdir -p $(DESTDIR)/etc/wok/
$(INSTALL_DATA) src/dhparams.pem $(DESTDIR)/etc/wok/dhparams.pem
touch $(DESTDIR)/etc/nginx/conf.d/wok.conf
+ mkdir -p $(DESTDIR)/etc/logrotate.d/
+ $(INSTALL_DATA) $(top_srcdir)/contrib/wokd.logrotate $(DESTDIR)/etc/logrotate.d/wokd
uninstall-local:
@if test -f $(systemdsystemunitdir)/wokd.service; then \
diff --git a/contrib/DEBIAN/control.in b/contrib/DEBIAN/control.in
index 1f39ad8..e585080 100644
--- a/contrib/DEBIAN/control.in
+++ b/contrib/DEBIAN/control.in
@@ -14,6 +14,7 @@ Depends: python-cherrypy3 (>= 3.2.0),
python-ldap,
python-psutil (>= 0.6.0),
fonts-font-awesome,
+ logrotate,
texlive-fonts-extra
Build-Depends: xsltproc,
gettext,
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
index ed4a006..2939bc9 100644
--- a/contrib/Makefile.am
+++ b/contrib/Makefile.am
@@ -29,6 +29,7 @@ EXTRA_DIST = \
wokd-upstart.conf.debian \
wokd-upstart.conf.fedora \
make-deb.sh.in \
+ wokd.logrotate \
$(NULL)
make-deb.sh: make-deb.sh.in $(top_builddir)/config.status
diff --git a/contrib/wok.spec.fedora.in b/contrib/wok.spec.fedora.in
index 34b3ac3..5501a20 100644
--- a/contrib/wok.spec.fedora.in
+++ b/contrib/wok.spec.fedora.in
@@ -19,6 +19,7 @@ Requires: python-ldap
Requires: python-psutil >= 0.6.0
Requires: fontawesome-fonts
Requires: open-sans-fonts
+Requires: logrotate
BuildRequires: gettext-devel
BuildRequires: libxslt
BuildRequires: openssl
@@ -116,6 +117,7 @@ rm -rf $RPM_BUILD_ROOT
%{_sysconfdir}/nginx/conf.d/wok.conf.in
%{_sysconfdir}/wok/wok.conf
%{_sysconfdir}/wok/
+%{_sysconfdir}/logrotate.d/wokd
%{_mandir}/man8/wokd.8.gz
%if 0%{?with_systemd}
diff --git a/contrib/wok.spec.suse.in b/contrib/wok.spec.suse.in
index aab4a80..20d7138 100644
--- a/contrib/wok.spec.suse.in
+++ b/contrib/wok.spec.suse.in
@@ -20,6 +20,7 @@ Requires: nginx
Requires: python-psutil >= 0.6.0
Requires: fontawesome-fonts
Requires: google-opensans-fonts
+Requires: logrotate
BuildRequires: gettext-tools
BuildRequires: libxslt-tools
BuildRequires: openssl
@@ -93,6 +94,7 @@ rm -rf $RPM_BUILD_ROOT
%{_sysconfdir}/wok/
%{_sysconfdir}/nginx/conf.d/wok.conf.in
%{_sysconfdir}/nginx/conf.d/wok.conf
+%{_sysconfdir}/logrotate.d/wokd
%{_var}/lib/wok/
%{_localstatedir}/log/wok/*
%{_localstatedir}/log/wok/
diff --git a/contrib/wokd.logrotate b/contrib/wokd.logrotate
new file mode 100644
index 0000000..0bf575f
--- /dev/null
+++ b/contrib/wokd.logrotate
@@ -0,0 +1,28 @@
+#
+# Project Wok
+#
+# Copyright IBM Corp, 2016
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+/var/log/wok/*log {
+ daily
+ maxsize 1024k
+ rotate 10
+ missingok
+ compress
+ sharedscripts
+}
+
--
2.1.0
8 years, 10 months
[PATCH] [Wok] Set returncode when run_command logging its output
by pvital@linux.vnet.ibm.com
From: Paulo Vital <pvital(a)linux.vnet.ibm.com>
Call proc.poll() to set and return the returncode attribute of the process that
is logging its output into a file.
Signed-off-by: Paulo Vital <pvital(a)linux.vnet.ibm.com>
---
src/wok/utils.py | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/wok/utils.py b/src/wok/utils.py
index 2527e77..dfcd978 100644
--- a/src/wok/utils.py
+++ b/src/wok/utils.py
@@ -224,15 +224,17 @@ def run_command(cmd, timeout=None, silent=False, tee=None,
tee_log(line, tee)
out = ''.join(output)
error = proc.stderr.read()
+ returncode = proc.poll()
else:
out, error = proc.communicate()
if out:
wok_log.debug("out:\n%s", out)
- if proc.returncode != 0:
+ returncode = proc.returncode
+ if returncode != 0:
msg = "rc: %s error: %s returned from cmd: %s" %\
- (proc.returncode, error, ' '.join(cmd))
+ (returncode, error, ' '.join(cmd))
if silent:
wok_log.debug(msg)
@@ -251,7 +253,7 @@ def run_command(cmd, timeout=None, silent=False, tee=None,
msg_args = {'cmd': " ".join(cmd), 'seconds': str(timeout)}
raise TimeoutExpired("WOKUTILS0002E", msg_args)
- return out, error, proc.returncode
+ return out, error, returncode
except TimeoutExpired:
raise
except OSError as e:
--
2.5.0
8 years, 10 months
[PATCH v3][Kimchi] Add support for websockify 0.7
by Ramon Medeiros
The lastest update of websockify changes how the class instantiate
WebSocketProxy.
Signed-off-by: Ramon Medeiros <ramonn(a)linux.vnet.ibm.com>
---
Changes:
v2:
Change variable name
Instead of create params dictionary from begining, just append the changes
v3:
Rebase over last master
vnc.py | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/vnc.py b/vnc.py
index 9a25f50..4f94ab2 100644
--- a/vnc.py
+++ b/vnc.py
@@ -21,12 +21,20 @@
import base64
import errno
import os
+
from multiprocessing import Process
from websockify import WebSocketProxy
from wok.config import config, paths, PluginPaths
+try:
+ from websockify.token_plugins import TokenFile
+ tokenFile = True
+except ImportError:
+ tokenFile = False
+
+
WS_TOKENS_DIR = os.path.join(PluginPaths('kimchi').state_dir, 'vnc-tokens')
@@ -45,9 +53,16 @@ def new_ws_proxy():
params = {'listen_host': '127.0.0.1',
'listen_port': config.get('server', 'websockets_port'),
- 'target_cfg': WS_TOKENS_DIR,
'ssl_only': False}
+ # old websockify: do not use TokenFile
+ if not tokenFile:
+ params['target_cfg'] = WS_TOKENS_DIR
+
+ # websockify 0.7 and higher: use TokenFile
+ else:
+ params['token_plugin'] = TokenFile(src=WS_TOKENS_DIR)
+
def start_proxy():
server = WebSocketProxy(**params)
server.start_server()
--
2.1.0
8 years, 10 months
[PATCH v2][Kimchi] Add support for websockify 0.7
by Ramon Medeiros
The lastest update of websockify changes how the class instantiate
WebSocketProxy.
Signed-off-by: Ramon Medeiros <ramonn(a)linux.vnet.ibm.com>
---
Changes:
v2:
Change variable name
Instead of create params dictionary from begining, just append the changes
vnc.py | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/vnc.py b/vnc.py
index 1a2e59d..f866126 100644
--- a/vnc.py
+++ b/vnc.py
@@ -21,12 +21,20 @@
import base64
import errno
import os
+
from multiprocessing import Process
from websockify import WebSocketProxy
from wok.config import config, paths, PluginPaths
+try:
+ from websockify.token_plugins import TokenFile
+ tokenFile = True
+except ImportError:
+ tokenFile = False
+
+
WS_TOKENS_DIR = os.path.join(PluginPaths('kimchi').state_dir, 'vnc-tokens')
@@ -45,9 +53,16 @@ def new_ws_proxy():
params = {'web': os.path.join(paths.ui_dir, 'pages/websockify'),
'listen_port': config.get('display', 'display_proxy_port'),
- 'target_cfg': WS_TOKENS_DIR,
'key': key, 'cert': cert, 'ssl_only': True}
+ # old websockify: do not use TokenFile
+ if not tokenFile:
+ params['target_cfg'] = WS_TOKENS_DIR
+
+ # websockify 0.7 and higher: use TokenFile
+ else:
+ params['token_plugin'] = TokenFile(src=WS_TOKENS_DIR)
+
def start_proxy():
server = WebSocketProxy(**params)
server.start_server()
--
2.1.0
8 years, 10 months
[PATCH] [Kimchi 0/3 V2] Start up websockify on localhost
by Aline Manera
This patch set depends on Wok patch: [PATCH] [Wok 0/6] Configure nginx to proxy connections to the websocket server
V1 -> V2:
- Update spec files to add the all the docs/ directory content
Aline Manera (2):
Update /plugins/kimchi/config API to only return information related
to Kimchi
Update README
Rob Lemley (1):
Start up websockify on localhost
contrib/kimchi.spec.fedora.in | 6 +-
contrib/kimchi.spec.suse.in | 6 +-
docs/API.md | 3 +-
docs/Makefile.am | 10 +-
docs/README.md | 239 +++++++++--------------------------
docs/fedora-deps.md | 53 ++++++++
docs/kimchi-guest.png | Bin 192281 -> 0 bytes
docs/kimchi-guests.png | Bin 0 -> 55954 bytes
docs/kimchi-login.png | Bin 318041 -> 0 bytes
docs/kimchi-templates.png | Bin 329678 -> 60887 bytes
docs/opensuse-deps.md | 48 +++++++
docs/ubuntu-deps.md | 34 +++++
docs/wok-login.png | Bin 0 -> 20140 bytes
model/config.py | 10 +-
tests/test_rest.py | 4 +-
ui/js/src/kimchi.api.js | 29 ++---
ui/spice-html5/pages/spice_auto.html | 2 +-
vnc.py | 8 +-
18 files changed, 222 insertions(+), 230 deletions(-)
create mode 100644 docs/fedora-deps.md
delete mode 100644 docs/kimchi-guest.png
create mode 100644 docs/kimchi-guests.png
delete mode 100644 docs/kimchi-login.png
create mode 100644 docs/opensuse-deps.md
create mode 100644 docs/ubuntu-deps.md
create mode 100644 docs/wok-login.png
--
2.5.0
8 years, 10 months
[PATCH] [Wok 0/6] Configure nginx to proxy connections to the websocket server
by Aline Manera
Aline Manera (5):
Wok config: move websockets port setting to [server] section
Remove websockify/console.html from Wok
Split API documentation into multiple files
Create /config API to return the Wok server configuration
Update README
Rob Lemley (1):
Configure nginx to proxy connections to the websocket server
configure.ac | 4 +-
docs/API.md | 76 ----------------
docs/API/Makefile.am | 22 +++++
docs/API/README.md | 43 +++++++++
docs/API/config.md | 27 ++++++
docs/API/plugins.md | 13 +++
docs/API/tasks.md | 45 ++++++++++
docs/Makefile.am | 10 +--
docs/README.md | 189 ++++++++-------------------------------
docs/fedora-deps.md | 48 ++++++++++
docs/opensuse-deps.md | 32 +++++++
docs/troubleshooting.md | 30 +++++++
docs/ubuntu-deps.md | 32 +++++++
src/firewalld.xml | 1 -
src/nginx/wok.conf.in | 20 ++++-
src/wok.conf.in | 7 +-
src/wok/config.py.in | 5 +-
src/wok/control/config.py | 31 +++++++
src/wok/model/config.py | 34 +++++++
src/wok/proxy.py | 5 +-
src/wokd.in | 4 +
tests/test_api.py | 57 ++++++++++++
tests/utils.py | 6 +-
ui/pages/Makefile.am | 4 +-
ui/pages/websockify/Makefile.am | 22 -----
ui/pages/websockify/console.html | 25 ------
26 files changed, 493 insertions(+), 299 deletions(-)
delete mode 100644 docs/API.md
create mode 100644 docs/API/Makefile.am
create mode 100644 docs/API/README.md
create mode 100644 docs/API/config.md
create mode 100644 docs/API/plugins.md
create mode 100644 docs/API/tasks.md
create mode 100644 docs/fedora-deps.md
create mode 100644 docs/opensuse-deps.md
create mode 100644 docs/troubleshooting.md
create mode 100644 docs/ubuntu-deps.md
create mode 100644 src/wok/control/config.py
create mode 100644 src/wok/model/config.py
create mode 100644 tests/test_api.py
delete mode 100644 ui/pages/websockify/Makefile.am
delete mode 100644 ui/pages/websockify/console.html
--
2.5.0
8 years, 10 months
[Kimchi] Add support for websockify 0.7
by Ramon Medeiros
The lastest update of websockify changes how the class instantiate
WebSocketProxy.
Signed-off-by: Ramon Medeiros <ramonn(a)linux.vnet.ibm.com>
---
vnc.py | 27 +++++++++++++++++++++++----
1 file changed, 23 insertions(+), 4 deletions(-)
diff --git a/vnc.py b/vnc.py
index 1a2e59d..00069d5 100644
--- a/vnc.py
+++ b/vnc.py
@@ -21,12 +21,20 @@
import base64
import errno
import os
+
from multiprocessing import Process
from websockify import WebSocketProxy
from wok.config import config, paths, PluginPaths
+websockifyOld = False
+try:
+ from websockify.token_plugins import TokenFile
+except ImportError:
+ websockifyOld = True
+
+
WS_TOKENS_DIR = os.path.join(PluginPaths('kimchi').state_dir, 'vnc-tokens')
@@ -43,10 +51,21 @@ def new_ws_proxy():
cert = '%s/wok-cert.pem' % paths.conf_dir
key = '%s/wok-key.pem' % paths.conf_dir
- params = {'web': os.path.join(paths.ui_dir, 'pages/websockify'),
- 'listen_port': config.get('display', 'display_proxy_port'),
- 'target_cfg': WS_TOKENS_DIR,
- 'key': key, 'cert': cert, 'ssl_only': True}
+ # old websockify: do not use TokenFile
+ if websockifyOld:
+ params = {'web': os.path.join(paths.ui_dir, 'pages/websockify'),
+ 'listen_port': config.get('display', 'display_proxy_port'),
+ 'target_cfg': WS_TOKENS_DIR,
+ 'key': key, 'cert': cert, 'ssl_only': True}
+
+ # websockify 0.7 and higher: use TokenFile
+ else:
+ token_plugin = TokenFile(src=WS_TOKENS_DIR)
+
+ params = {'web': os.path.join(paths.ui_dir, 'pages/websockify'),
+ 'listen_port': config.get('display', 'display_proxy_port'),
+ 'token_plugin': token_plugin,
+ 'key': key, 'cert': cert, 'ssl_only': True}
def start_proxy():
server = WebSocketProxy(**params)
--
2.1.0
8 years, 10 months