Compare commits
3 Commits
v0.9.91
...
578e47410b
Author | SHA1 | Date | |
---|---|---|---|
578e47410b | |||
f2818385d4 | |||
efd915858e |
10
CHANGELOG.md
10
CHANGELOG.md
@ -1,18 +1,10 @@
|
|||||||
## PVC Changelog
|
## PVC Changelog
|
||||||
|
|
||||||
###### [v0.9.91](https://github.com/parallelvirtualcluster/pvc/releases/tag/v0.9.91)
|
|
||||||
|
|
||||||
* [Client CLI] Fixes a bug and improves output during cluster task events.
|
|
||||||
* [Client CLI] Improves the output of the task list display.
|
|
||||||
* [Provisioner] Fixes some missing cloud-init modules in the default debootstrap script.
|
|
||||||
* [Client CLI] Fixes a bug with a missing argument to the vm_define helper function.
|
|
||||||
* [All] Fixes inconsistent package find + rm commands to avoid errors in dpkg.
|
|
||||||
|
|
||||||
###### [v0.9.90](https://github.com/parallelvirtualcluster/pvc/releases/tag/v0.9.90)
|
###### [v0.9.90](https://github.com/parallelvirtualcluster/pvc/releases/tag/v0.9.90)
|
||||||
|
|
||||||
* [Client CLI/API Daemon] Adds additional backup metainfo and an emailed report option to autobackups.
|
* [Client CLI/API Daemon] Adds additional backup metainfo and an emailed report option to autobackups.
|
||||||
* [All] Adds a live migration maximum downtime selector to help with busy VM migrations.
|
* [All] Adds a live migration maximum downtime selector to help with busy VM migrations.
|
||||||
* [API Daemon] Fixes a database migration bug on Debian 10/11.
|
* [API Daemon] Fixes a database migration bug on Debian 11.
|
||||||
* [Node Daemon] Fixes a race condition when applying Zookeeper schema changes.
|
* [Node Daemon] Fixes a race condition when applying Zookeeper schema changes.
|
||||||
|
|
||||||
###### [v0.9.89](https://github.com/parallelvirtualcluster/pvc/releases/tag/v0.9.89)
|
###### [v0.9.89](https://github.com/parallelvirtualcluster/pvc/releases/tag/v0.9.89)
|
||||||
|
@ -589,13 +589,11 @@ After=multi-user.target
|
|||||||
- migrator
|
- migrator
|
||||||
- bootcmd
|
- bootcmd
|
||||||
- write-files
|
- write-files
|
||||||
- growpart
|
|
||||||
- resizefs
|
- resizefs
|
||||||
- set_hostname
|
- set_hostname
|
||||||
- update_hostname
|
- update_hostname
|
||||||
- update_etc_hosts
|
- update_etc_hosts
|
||||||
- ca-certs
|
- ca-certs
|
||||||
- users-groups
|
|
||||||
- ssh
|
- ssh
|
||||||
|
|
||||||
cloud_config_modules:
|
cloud_config_modules:
|
||||||
|
@ -12,7 +12,16 @@ fi
|
|||||||
|
|
||||||
pushd /usr/share/pvc
|
pushd /usr/share/pvc
|
||||||
|
|
||||||
export FLASK_APP=./pvcapid-manage-flask.py
|
case "$( cat /etc/debian_version )" in
|
||||||
flask db upgrade
|
10.*)
|
||||||
|
# Debian 10
|
||||||
|
./pvcapid-manage_legacy.py db upgrade
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
# Debian 12+
|
||||||
|
export FLASK_APP=./pvcapid-manage_flask.py
|
||||||
|
flask db upgrade
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
popd
|
popd
|
||||||
|
33
api-daemon/pvcapid-manage_legacy.py
Executable file
33
api-daemon/pvcapid-manage_legacy.py
Executable file
@ -0,0 +1,33 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
# pvcapid-manage_legacy.py - PVC Database management tasks (Legacy)
|
||||||
|
# Part of the Parallel Virtual Cluster (PVC) system
|
||||||
|
#
|
||||||
|
# Copyright (C) 2018-2024 Joshua M. Boniface <joshua@boniface.me>
|
||||||
|
#
|
||||||
|
# This program 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, version 3.
|
||||||
|
#
|
||||||
|
# This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
from flask_migrate import Migrate, MigrateCommand, Manager
|
||||||
|
|
||||||
|
from pvcapid.flaskapi import app, db
|
||||||
|
from pvcapid.models import * # noqa F401,F403
|
||||||
|
|
||||||
|
migrate = Migrate(app, db)
|
||||||
|
manager = Manager(app)
|
||||||
|
|
||||||
|
manager.add_command("db", MigrateCommand)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
manager.run()
|
@ -27,7 +27,7 @@ from distutils.util import strtobool as dustrtobool
|
|||||||
import daemon_lib.config as cfg
|
import daemon_lib.config as cfg
|
||||||
|
|
||||||
# Daemon version
|
# Daemon version
|
||||||
version = "0.9.91"
|
version = "0.9.90"
|
||||||
|
|
||||||
# API version
|
# API version
|
||||||
API_VERSION = 1.0
|
API_VERSION = 1.0
|
||||||
|
13
api-daemon/swagger.html
Normal file
13
api-daemon/swagger.html
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>PVC Client API Documentation</title>
|
||||||
|
<meta charset="utf-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<style> body { margin: 0; padding: 0; } </style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<redoc spec-url='./swagger.json' hide-loading></redoc>
|
||||||
|
<script src="https://rebilly.github.io/ReDoc/releases/latest/redoc.min.js"> </script>
|
||||||
|
</body>
|
||||||
|
</html>
|
4750
api-daemon/swagger.json
Normal file
4750
api-daemon/swagger.json
Normal file
File diff suppressed because it is too large
Load Diff
@ -687,10 +687,7 @@ def cli_cluster_task(task_id, wait_flag, format_function):
|
|||||||
|
|
||||||
if wait_flag:
|
if wait_flag:
|
||||||
# First validate that this is actually a valid task that is running
|
# First validate that this is actually a valid task that is running
|
||||||
echo(CLI_CONFIG, "Querying cluster for tasks...", newline=False)
|
|
||||||
retcode, retdata = pvc.lib.common.task_status(CLI_CONFIG, None)
|
retcode, retdata = pvc.lib.common.task_status(CLI_CONFIG, None)
|
||||||
echo(CLI_CONFIG, " done.")
|
|
||||||
echo(CLI_CONFIG, "")
|
|
||||||
if task_id in [i["id"] for i in retdata]:
|
if task_id in [i["id"] for i in retdata]:
|
||||||
task = [i for i in retdata if i["id"] == task_id][0]
|
task = [i for i in retdata if i["id"] == task_id][0]
|
||||||
retmsg = wait_for_celery_task(
|
retmsg = wait_for_celery_task(
|
||||||
@ -702,10 +699,7 @@ def cli_cluster_task(task_id, wait_flag, format_function):
|
|||||||
retmsg = f"No task with ID {task_id} found."
|
retmsg = f"No task with ID {task_id} found."
|
||||||
finish(retcode, retmsg)
|
finish(retcode, retmsg)
|
||||||
else:
|
else:
|
||||||
echo(CLI_CONFIG, "Querying cluster for tasks...", newline=False)
|
|
||||||
retcode, retdata = pvc.lib.common.task_status(CLI_CONFIG, task_id)
|
retcode, retdata = pvc.lib.common.task_status(CLI_CONFIG, task_id)
|
||||||
echo(CLI_CONFIG, " done.")
|
|
||||||
echo(CLI_CONFIG, "")
|
|
||||||
finish(retcode, retdata, format_function)
|
finish(retcode, retdata, format_function)
|
||||||
|
|
||||||
|
|
||||||
|
@ -645,24 +645,6 @@ def cli_cluster_task_format_pretty(CLI_CONFIG, task_data):
|
|||||||
if _task_type_length > task_type_length:
|
if _task_type_length > task_type_length:
|
||||||
task_type_length = _task_type_length
|
task_type_length = _task_type_length
|
||||||
|
|
||||||
for arg_name, arg_data in task["kwargs"].items():
|
|
||||||
# Skip the "run_on" argument
|
|
||||||
if arg_name == "run_on":
|
|
||||||
continue
|
|
||||||
|
|
||||||
# task_arg_name column
|
|
||||||
_task_arg_name_length = len(str(arg_name)) + 1
|
|
||||||
if _task_arg_name_length > task_arg_name_length:
|
|
||||||
task_arg_name_length = _task_arg_name_length
|
|
||||||
|
|
||||||
task_header_length = (
|
|
||||||
task_id_length + task_name_length + task_type_length + task_worker_length + 3
|
|
||||||
)
|
|
||||||
max_task_data_length = (
|
|
||||||
MAX_CONTENT_WIDTH - task_header_length - task_arg_name_length - 2
|
|
||||||
)
|
|
||||||
|
|
||||||
for task in task_data:
|
|
||||||
updated_kwargs = list()
|
updated_kwargs = list()
|
||||||
for arg_name, arg_data in task["kwargs"].items():
|
for arg_name, arg_data in task["kwargs"].items():
|
||||||
# Skip the "run_on" argument
|
# Skip the "run_on" argument
|
||||||
@ -674,22 +656,8 @@ def cli_cluster_task_format_pretty(CLI_CONFIG, task_data):
|
|||||||
if _task_arg_name_length > task_arg_name_length:
|
if _task_arg_name_length > task_arg_name_length:
|
||||||
task_arg_name_length = _task_arg_name_length
|
task_arg_name_length = _task_arg_name_length
|
||||||
|
|
||||||
if isinstance(arg_data, list):
|
if len(str(arg_data)) > 17:
|
||||||
for subarg_data in arg_data:
|
arg_data = arg_data[:17] + "..."
|
||||||
if len(subarg_data) > max_task_data_length:
|
|
||||||
subarg_data = (
|
|
||||||
str(subarg_data[: max_task_data_length - 4]) + " ..."
|
|
||||||
)
|
|
||||||
|
|
||||||
# task_arg_data column
|
|
||||||
_task_arg_data_length = len(str(subarg_data)) + 1
|
|
||||||
if _task_arg_data_length > task_arg_data_length:
|
|
||||||
task_arg_data_length = _task_arg_data_length
|
|
||||||
|
|
||||||
updated_kwargs.append({"name": arg_name, "data": subarg_data})
|
|
||||||
else:
|
|
||||||
if len(str(arg_data)) > 24:
|
|
||||||
arg_data = str(arg_data[:24]) + " ..."
|
|
||||||
|
|
||||||
# task_arg_data column
|
# task_arg_data column
|
||||||
_task_arg_data_length = len(str(arg_data)) + 1
|
_task_arg_data_length = len(str(arg_data)) + 1
|
||||||
@ -697,7 +665,6 @@ def cli_cluster_task_format_pretty(CLI_CONFIG, task_data):
|
|||||||
task_arg_data_length = _task_arg_data_length
|
task_arg_data_length = _task_arg_data_length
|
||||||
|
|
||||||
updated_kwargs.append({"name": arg_name, "data": arg_data})
|
updated_kwargs.append({"name": arg_name, "data": arg_data})
|
||||||
|
|
||||||
task["kwargs"] = updated_kwargs
|
task["kwargs"] = updated_kwargs
|
||||||
tasks.append(task)
|
tasks.append(task)
|
||||||
|
|
||||||
|
@ -115,8 +115,6 @@ def wait_for_celery_task(CLI_CONFIG, task_detail, start_late=False):
|
|||||||
)
|
)
|
||||||
while True:
|
while True:
|
||||||
sleep(0.5)
|
sleep(0.5)
|
||||||
if isinstance(task_status, tuple):
|
|
||||||
continue
|
|
||||||
if task_status.get("state") != "RUNNING":
|
if task_status.get("state") != "RUNNING":
|
||||||
break
|
break
|
||||||
if task_status.get("current") > last_task:
|
if task_status.get("current") > last_task:
|
||||||
|
@ -89,7 +89,6 @@ def vm_define(
|
|||||||
node_selector,
|
node_selector,
|
||||||
node_autostart,
|
node_autostart,
|
||||||
migration_method,
|
migration_method,
|
||||||
migration_max_downtime,
|
|
||||||
user_tags,
|
user_tags,
|
||||||
protected_tags,
|
protected_tags,
|
||||||
):
|
):
|
||||||
@ -97,7 +96,7 @@ def vm_define(
|
|||||||
Define a new VM on the cluster
|
Define a new VM on the cluster
|
||||||
|
|
||||||
API endpoint: POST /vm
|
API endpoint: POST /vm
|
||||||
API arguments: xml={xml}, node={node}, limit={node_limit}, selector={node_selector}, autostart={node_autostart}, migration_method={migration_method}, migration_max_downtime={migration_max_downtime}, user_tags={user_tags}, protected_tags={protected_tags}
|
API arguments: xml={xml}, node={node}, limit={node_limit}, selector={node_selector}, autostart={node_autostart}, migration_method={migration_method}, user_tags={user_tags}, protected_tags={protected_tags}
|
||||||
API schema: {"message":"{data}"}
|
API schema: {"message":"{data}"}
|
||||||
"""
|
"""
|
||||||
params = {
|
params = {
|
||||||
@ -106,7 +105,6 @@ def vm_define(
|
|||||||
"selector": node_selector,
|
"selector": node_selector,
|
||||||
"autostart": node_autostart,
|
"autostart": node_autostart,
|
||||||
"migration_method": migration_method,
|
"migration_method": migration_method,
|
||||||
"migration_max_downtime": migration_max_downtime,
|
|
||||||
"user_tags": user_tags,
|
"user_tags": user_tags,
|
||||||
"protected_tags": protected_tags,
|
"protected_tags": protected_tags,
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ from setuptools import setup
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="pvc",
|
name="pvc",
|
||||||
version="0.9.91",
|
version="0.9.90",
|
||||||
packages=["pvc.cli", "pvc.lib"],
|
packages=["pvc.cli", "pvc.lib"],
|
||||||
install_requires=[
|
install_requires=[
|
||||||
"Click",
|
"Click",
|
||||||
|
12
debian/changelog
vendored
12
debian/changelog
vendored
@ -1,18 +1,8 @@
|
|||||||
pvc (0.9.91-0) unstable; urgency=high
|
|
||||||
|
|
||||||
* [Client CLI] Fixes a bug and improves output during cluster task events.
|
|
||||||
* [Client CLI] Improves the output of the task list display.
|
|
||||||
* [Provisioner] Fixes some missing cloud-init modules in the default debootstrap script.
|
|
||||||
* [Client CLI] Fixes a bug with a missing argument to the vm_define helper function.
|
|
||||||
* [All] Fixes inconsistent package find + rm commands to avoid errors in dpkg.
|
|
||||||
|
|
||||||
-- Joshua M. Boniface <joshua@boniface.me> Tue, 23 Jan 2024 10:02:19 -0500
|
|
||||||
|
|
||||||
pvc (0.9.90-0) unstable; urgency=high
|
pvc (0.9.90-0) unstable; urgency=high
|
||||||
|
|
||||||
* [Client CLI/API Daemon] Adds additional backup metainfo and an emailed report option to autobackups.
|
* [Client CLI/API Daemon] Adds additional backup metainfo and an emailed report option to autobackups.
|
||||||
* [All] Adds a live migration maximum downtime selector to help with busy VM migrations.
|
* [All] Adds a live migration maximum downtime selector to help with busy VM migrations.
|
||||||
* [API Daemon] Fixes a database migration bug on Debian 10/11.
|
* [API Daemon] Fixes a database migration bug on Debian 11.
|
||||||
* [Node Daemon] Fixes a race condition when applying Zookeeper schema changes.
|
* [Node Daemon] Fixes a race condition when applying Zookeeper schema changes.
|
||||||
|
|
||||||
-- Joshua M. Boniface <joshua@boniface.me> Thu, 11 Jan 2024 00:14:49 -0500
|
-- Joshua M. Boniface <joshua@boniface.me> Thu, 11 Jan 2024 00:14:49 -0500
|
||||||
|
5
debian/pvc-client-cli.postinst
vendored
5
debian/pvc-client-cli.postinst
vendored
@ -2,12 +2,7 @@
|
|||||||
|
|
||||||
# Generate the bash completion configuration
|
# Generate the bash completion configuration
|
||||||
if [ -d /etc/bash_completion.d ]; then
|
if [ -d /etc/bash_completion.d ]; then
|
||||||
echo "Installing BASH completion configuration"
|
|
||||||
_PVC_COMPLETE=source_bash pvc > /etc/bash_completion.d/pvc
|
_PVC_COMPLETE=source_bash pvc > /etc/bash_completion.d/pvc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Remove any cached CPython directories or files
|
|
||||||
echo "Cleaning up CPython caches"
|
|
||||||
find /usr/lib/python3/dist-packages/pvc -type d -name "__pycache__" -exec rm -fr {} + &>/dev/null || true
|
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
4
debian/pvc-daemon-api.preinst
vendored
4
debian/pvc-daemon-api.preinst
vendored
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Remove any cached CPython directories or files
|
# Remove any cached CPython directories or files
|
||||||
echo "Cleaning up CPython caches"
|
echo "Cleaning up existing CPython files"
|
||||||
find /usr/share/pvc/pvcapid -type d -name "__pycache__" -exec rm -fr {} + &>/dev/null || true
|
find /usr/share/pvc/pvcapid -type d -name "__pycache__" -exec rm -rf {} \; &>/dev/null || true
|
||||||
|
5
debian/pvc-daemon-common.preinst
vendored
5
debian/pvc-daemon-common.preinst
vendored
@ -1,5 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Remove any cached CPython directories or files
|
|
||||||
echo "Cleaning up CPython caches"
|
|
||||||
find /usr/share/pvc/daemon_lib -type d -name "__pycache__" -exec rm -fr {} + &>/dev/null || true
|
|
6
debian/pvc-daemon-health.preinst
vendored
6
debian/pvc-daemon-health.preinst
vendored
@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Remove any cached CPython directories or files
|
# Remove any cached CPython directories or files
|
||||||
echo "Cleaning up CPython caches"
|
echo "Cleaning up existing CPython files"
|
||||||
find /usr/share/pvc/pvchealthd -type d -name "__pycache__" -exec rm -fr {} + &>/dev/null || true
|
find /usr/share/pvc/pvchealthd -type d -name "__pycache__" -exec rm -rf {} \; &>/dev/null || true
|
||||||
find /usr/share/pvc/plugins -type d -name "__pycache__" -exec rm -fr {} + &>/dev/null || true
|
find /usr/share/pvc/plugins -type d -name "__pycache__" -exec rm -rf {} \; &>/dev/null || true
|
||||||
|
4
debian/pvc-daemon-node.preinst
vendored
4
debian/pvc-daemon-node.preinst
vendored
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Remove any cached CPython directories or files
|
# Remove any cached CPython directories or files
|
||||||
echo "Cleaning up CPython caches"
|
echo "Cleaning up existing CPython files"
|
||||||
find /usr/share/pvc/pvcnoded -type d -name "__pycache__" -exec rm -fr {} + &>/dev/null || true
|
find /usr/share/pvc/pvcnoded -type d -name "__pycache__" -exec rm -rf {} \; &>/dev/null || true
|
||||||
|
4
debian/pvc-daemon-worker.preinst
vendored
4
debian/pvc-daemon-worker.preinst
vendored
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Remove any cached CPython directories or files
|
# Remove any cached CPython directories or files
|
||||||
echo "Cleaning up CPython caches"
|
echo "Cleaning up existing CPython files"
|
||||||
find /usr/share/pvc/pvcworkerd -type d -name "__pycache__" -exec rm -fr {} + &>/dev/null || true
|
find /usr/share/pvc/pvcworkerd -type d -name "__pycache__" -exec rm -rf {} \; &>/dev/null || true
|
||||||
|
2
debian/rules
vendored
2
debian/rules
vendored
@ -13,7 +13,7 @@ override_dh_python3:
|
|||||||
rm -r $(CURDIR)/client-cli/.pybuild $(CURDIR)/client-cli/pvc.egg-info
|
rm -r $(CURDIR)/client-cli/.pybuild $(CURDIR)/client-cli/pvc.egg-info
|
||||||
|
|
||||||
override_dh_auto_clean:
|
override_dh_auto_clean:
|
||||||
find . -name "__pycache__" -o -name ".pybuild" -exec rm -fr {} + || true
|
find . -name "__pycache__" -o -name ".pybuild" -exec rm -r {} \; || true
|
||||||
|
|
||||||
# If you need to rebuild the Sphinx documentation
|
# If you need to rebuild the Sphinx documentation
|
||||||
# Add spinxdoc to the dh --with line
|
# Add spinxdoc to the dh --with line
|
||||||
|
@ -33,7 +33,7 @@ import os
|
|||||||
import signal
|
import signal
|
||||||
|
|
||||||
# Daemon version
|
# Daemon version
|
||||||
version = "0.9.91"
|
version = "0.9.90"
|
||||||
|
|
||||||
|
|
||||||
##########################################################
|
##########################################################
|
||||||
|
@ -49,7 +49,7 @@ import re
|
|||||||
import json
|
import json
|
||||||
|
|
||||||
# Daemon version
|
# Daemon version
|
||||||
version = "0.9.91"
|
version = "0.9.90"
|
||||||
|
|
||||||
|
|
||||||
##########################################################
|
##########################################################
|
||||||
|
@ -44,7 +44,7 @@ from daemon_lib.vmbuilder import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Daemon version
|
# Daemon version
|
||||||
version = "0.9.91"
|
version = "0.9.90"
|
||||||
|
|
||||||
|
|
||||||
config = cfg.get_configuration()
|
config = cfg.get_configuration()
|
||||||
|
Reference in New Issue
Block a user