Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
bb2aac145d | |||
a7c1b91f60 | |||
ec6d3351b2 | |||
22faaa9bbc | |||
6c407d54c3 | |||
9ba7aa5b08 | |||
cb413e5ce6 | |||
123499f75f | |||
83b8ce7b62 | |||
5e43f9bd7c | |||
ed087d83c2 |
13
CHANGELOG.md
13
CHANGELOG.md
@ -1,5 +1,18 @@
|
||||
## PVC Changelog
|
||||
|
||||
###### [v0.9.71](https://github.com/parallelvirtualcluster/pvc/releases/tag/v0.9.71)
|
||||
|
||||
* [API] Adds API support for Debian Bookworm
|
||||
|
||||
###### [v0.9.70](https://github.com/parallelvirtualcluster/pvc/releases/tag/v0.9.70)
|
||||
|
||||
* [Node Daemon] Fixes several compatibility issues for Debian 12 "Bookworm"
|
||||
|
||||
###### [v0.9.69](https://github.com/parallelvirtualcluster/pvc/releases/tag/v0.9.69)
|
||||
|
||||
* [Node Daemon] Ensures that system load is always 2 decimal places on Bookworm
|
||||
* [Node Daemon] Fixes bug blocking primary takeover at DNS Aggregator start if Patroni is down
|
||||
|
||||
###### [v0.9.68](https://github.com/parallelvirtualcluster/pvc/releases/tag/v0.9.68)
|
||||
|
||||
* [CLI] Fixes another bug with network info view
|
||||
|
@ -11,5 +11,16 @@ if [[ ! -f ${PVC_CONFIG_FILE} ]]; then
|
||||
fi
|
||||
|
||||
pushd /usr/share/pvc
|
||||
./pvcapid-manage.py db upgrade
|
||||
|
||||
case "$( cat /etc/debian_version )" in
|
||||
10.*|11.*)
|
||||
# Debian 10 & 11
|
||||
./pvcapid-manage_legacy.py db upgrade
|
||||
;;
|
||||
*)
|
||||
# Debian 12+
|
||||
flask --app ./pvcapid-manage_flask.py db upgrade
|
||||
;;
|
||||
esac
|
||||
|
||||
popd
|
||||
|
29
api-daemon/pvcapid-manage_flask.py
Executable file
29
api-daemon/pvcapid-manage_flask.py
Executable file
@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# pvcapid-manage_flask.py - PVC Database management tasks (via Flask CLI)
|
||||
# Part of the Parallel Virtual Cluster (PVC) system
|
||||
#
|
||||
# Copyright (C) 2018-2022 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 pvcapid.flaskapi import app, db
|
||||
from pvcapid.models import * # noqa F401,F403
|
||||
|
||||
from flask_migrate import Migrate
|
||||
|
||||
migrate = Migrate(app, db)
|
||||
|
||||
# Call flask --app /usr/share/pvc/pvcapid-manage_flask.py db upgrade
|
@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# manage.py - PVC Database management tasks
|
||||
# pvcapid-manage_legacy.py - PVC Database management tasks (Legacy)
|
||||
# Part of the Parallel Virtual Cluster (PVC) system
|
||||
#
|
||||
# Copyright (C) 2018-2022 Joshua M. Boniface <joshua@boniface.me>
|
||||
@ -19,8 +19,7 @@
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
from flask_migrate import Migrate, MigrateCommand
|
||||
from flask_script import Manager
|
||||
from flask_migrate import Migrate, MigrateCommand, Manager
|
||||
|
||||
from pvcapid.flaskapi import app, db
|
||||
from pvcapid.models import * # noqa F401,F403
|
@ -27,12 +27,8 @@ case "$( cat /etc/debian_version )" in
|
||||
10.*)
|
||||
CELERY_ARGS="worker --app pvcapid.flaskapi.celery --concurrency 1 --loglevel INFO"
|
||||
;;
|
||||
11.*)
|
||||
CELERY_ARGS="--app pvcapid.flaskapi.celery worker --concurrency 1 --loglevel INFO"
|
||||
;;
|
||||
*)
|
||||
echo "Invalid Debian version found!"
|
||||
exit 1
|
||||
CELERY_ARGS="--app pvcapid.flaskapi.celery worker --concurrency 1 --loglevel INFO"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
@ -27,7 +27,7 @@ from ssl import SSLContext, TLSVersion
|
||||
from distutils.util import strtobool as dustrtobool
|
||||
|
||||
# Daemon version
|
||||
version = "0.9.68"
|
||||
version = "0.9.71"
|
||||
|
||||
# API version
|
||||
API_VERSION = 1.0
|
||||
|
@ -2,7 +2,7 @@ from setuptools import setup
|
||||
|
||||
setup(
|
||||
name="pvc",
|
||||
version="0.9.68",
|
||||
version="0.9.71",
|
||||
packages=["pvc.cli", "pvc.lib"],
|
||||
install_requires=[
|
||||
"Click",
|
||||
|
19
debian/changelog
vendored
19
debian/changelog
vendored
@ -1,3 +1,22 @@
|
||||
pvc (0.9.71-0) unstable; urgency=high
|
||||
|
||||
* [API] Adds API support for Debian Bookworm
|
||||
|
||||
-- Joshua M. Boniface <joshua@boniface.me> Fri, 01 Sep 2023 00:30:42 -0400
|
||||
|
||||
pvc (0.9.70-0) unstable; urgency=high
|
||||
|
||||
* [Node Daemon] Fixes several compatibility issues for Debian 12 "Bookworm"
|
||||
|
||||
-- Joshua M. Boniface <joshua@boniface.me> Thu, 31 Aug 2023 14:15:54 -0400
|
||||
|
||||
pvc (0.9.69-0) unstable; urgency=high
|
||||
|
||||
* [Node Daemon] Ensures that system load is always 2 decimal places on Bookworm
|
||||
* [Node Daemon] Fixes bug blocking primary takeover at DNS Aggregator start if Patroni is down
|
||||
|
||||
-- Joshua M. Boniface <joshua@boniface.me> Tue, 29 Aug 2023 22:01:22 -0400
|
||||
|
||||
pvc (0.9.68-0) unstable; urgency=high
|
||||
|
||||
* [CLI] Fixes another bug with network info view
|
||||
|
2
debian/control
vendored
2
debian/control
vendored
@ -16,7 +16,7 @@ Description: Parallel Virtual Cluster node daemon (Python 3)
|
||||
|
||||
Package: pvc-daemon-api
|
||||
Architecture: all
|
||||
Depends: systemd, pvc-daemon-common, python3-yaml, python3-flask, python3-flask-restful, python3-celery, python-celery-common, python3-distutils, redis, python3-redis, python3-lxml, python3-flask-migrate, python3-flask-script, fio
|
||||
Depends: systemd, pvc-daemon-common, python3-yaml, python3-flask, python3-flask-restful, python3-celery, python-celery-common, python3-distutils, redis, python3-redis, python3-lxml, python3-flask-migrate, fio
|
||||
Description: Parallel Virtual Cluster API daemon (Python 3)
|
||||
A KVM/Zookeeper/Ceph-based VM and private cloud manager
|
||||
.
|
||||
|
2
debian/pvc-daemon-api.install
vendored
2
debian/pvc-daemon-api.install
vendored
@ -1,5 +1,5 @@
|
||||
api-daemon/pvcapid.py usr/share/pvc
|
||||
api-daemon/pvcapid-manage.py usr/share/pvc
|
||||
api-daemon/pvcapid-manage*.py usr/share/pvc
|
||||
api-daemon/pvc-api-db-upgrade usr/share/pvc
|
||||
api-daemon/pvcapid.sample.yaml etc/pvc
|
||||
api-daemon/pvcapid usr/share/pvc
|
||||
|
@ -49,7 +49,7 @@ import re
|
||||
import json
|
||||
|
||||
# Daemon version
|
||||
version = "0.9.68"
|
||||
version = "0.9.71"
|
||||
|
||||
|
||||
##########################################################
|
||||
|
@ -77,7 +77,7 @@ def connect_zookeeper():
|
||||
|
||||
with open(pvcnoded_config_file, "r") as cfgfile:
|
||||
try:
|
||||
o_config = yaml.load(cfgfile)
|
||||
o_config = yaml.load(cfgfile, yaml.SafeLoader)
|
||||
except Exception as e:
|
||||
print(
|
||||
"ERROR: Failed to parse configuration file: {}".format(e),
|
||||
|
@ -620,9 +620,12 @@ class NodeInstance(object):
|
||||
for network in self.d_network:
|
||||
self.d_network[network].startDHCPServer()
|
||||
# 9. Start DNS aggregator; just continue if we fail
|
||||
try:
|
||||
if not patroni_failed:
|
||||
self.dns_aggregator.start_aggregator()
|
||||
else:
|
||||
raise
|
||||
except Exception:
|
||||
self.logger.out(
|
||||
"Not starting DNS aggregator due to Patroni failures", state="e"
|
||||
)
|
||||
|
@ -338,8 +338,21 @@ def collect_ceph_stats(logger, config, zkhandler, this_node, queue):
|
||||
line = re.sub(r"\x1b(\[.*?[@-~]|\].*?(\x07|\x1b\\))", "", line)
|
||||
# Split it for parsing
|
||||
line = line.split()
|
||||
if len(line) > 1 and line[1].isdigit():
|
||||
# This is an OSD line so parse it
|
||||
|
||||
# Ceph 14 format:
|
||||
# ['|', '0', '|', 'hv1.p.u.bonilan.net', '|', '318G', '|', '463G', '|', '213', '|', '1430k', '|', '22', '|', '124k', '|', 'exists,up', '|']
|
||||
# Ceph 16 format:
|
||||
# ['0', 'hv1.t.u.bonilan.net', '2489M', '236G', '0', '0', '0', '0', 'exists,up']
|
||||
|
||||
# Bypass obviously invalid lines
|
||||
if len(line) < 1:
|
||||
continue
|
||||
elif line[0] == "+":
|
||||
continue
|
||||
|
||||
# If line begins with | and second entry is a digit (i.e. OSD ID)
|
||||
if line[0] == "|" and line[1].isdigit():
|
||||
# Parse the line in Ceph 14 format
|
||||
osd_id = line[1]
|
||||
node = line[3].split(".")[0]
|
||||
used = line[5]
|
||||
@ -349,6 +362,25 @@ def collect_ceph_stats(logger, config, zkhandler, this_node, queue):
|
||||
rd_ops = line[13]
|
||||
rd_data = line[15]
|
||||
state = line[17]
|
||||
# If first entry is a digit (i.e. OSD ID)
|
||||
elif line[0].isdigit():
|
||||
# Parse the line in Ceph 16 format
|
||||
osd_id = line[0]
|
||||
node = line[1].split(".")[0]
|
||||
used = line[2]
|
||||
avail = line[3]
|
||||
wr_ops = line[4]
|
||||
wr_data = line[5]
|
||||
rd_ops = line[6]
|
||||
rd_data = line[7]
|
||||
state = line[8]
|
||||
# Otherwise, it's the header line and is ignored
|
||||
else:
|
||||
continue
|
||||
|
||||
# I don't know why 2018 me used this construct instead of a normal
|
||||
# dictionary update, but it works so not changing it.
|
||||
# ref: bfbe9188ce830381f3f2fa1da11f1973f08eca8c
|
||||
osd_status.update(
|
||||
{
|
||||
str(osd_id): {
|
||||
@ -753,7 +785,7 @@ def node_keepalive(logger, config, zkhandler, this_node, monitoring_instance):
|
||||
this_node.memtotal = int(psutil.virtual_memory().total / 1024 / 1024)
|
||||
this_node.memused = int(psutil.virtual_memory().used / 1024 / 1024)
|
||||
this_node.memfree = int(psutil.virtual_memory().free / 1024 / 1024)
|
||||
this_node.cpuload = os.getloadavg()[0]
|
||||
this_node.cpuload = round(os.getloadavg()[0], 2)
|
||||
|
||||
# Join against running threads
|
||||
if config["enable_hypervisor"]:
|
||||
|
Reference in New Issue
Block a user