Compare commits

..

4 Commits

10 changed files with 64 additions and 23 deletions

View File

@ -1 +1 @@
0.9.69 0.9.70

View File

@ -1,5 +1,9 @@
## PVC Changelog ## PVC Changelog
###### [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) ###### [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] Ensures that system load is always 2 decimal places on Bookworm

View File

@ -19,8 +19,7 @@
# #
############################################################################### ###############################################################################
from flask_migrate import Migrate, MigrateCommand from flask_migrate import Migrate, MigrateCommand, Manager
from flask_script import Manager
from pvcapid.flaskapi import app, db from pvcapid.flaskapi import app, db
from pvcapid.models import * # noqa F401,F403 from pvcapid.models import * # noqa F401,F403

View File

@ -27,7 +27,7 @@ from ssl import SSLContext, TLSVersion
from distutils.util import strtobool as dustrtobool from distutils.util import strtobool as dustrtobool
# Daemon version # Daemon version
version = "0.9.69" version = "0.9.70"
# API version # API version
API_VERSION = 1.0 API_VERSION = 1.0

View File

@ -2,7 +2,7 @@ from setuptools import setup
setup( setup(
name="pvc", name="pvc",
version="0.9.69", version="0.9.70",
packages=["pvc.cli", "pvc.lib"], packages=["pvc.cli", "pvc.lib"],
install_requires=[ install_requires=[
"Click", "Click",

6
debian/changelog vendored
View File

@ -1,3 +1,9 @@
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 pvc (0.9.69-0) unstable; urgency=high
* [Node Daemon] Ensures that system load is always 2 decimal places on Bookworm * [Node Daemon] Ensures that system load is always 2 decimal places on Bookworm

2
debian/control vendored
View File

@ -16,7 +16,7 @@ Description: Parallel Virtual Cluster node daemon (Python 3)
Package: pvc-daemon-api Package: pvc-daemon-api
Architecture: all 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) Description: Parallel Virtual Cluster API daemon (Python 3)
A KVM/Zookeeper/Ceph-based VM and private cloud manager A KVM/Zookeeper/Ceph-based VM and private cloud manager
. .

View File

@ -49,7 +49,7 @@ import re
import json import json
# Daemon version # Daemon version
version = "0.9.69" version = "0.9.70"
########################################################## ##########################################################

View File

@ -77,7 +77,7 @@ def connect_zookeeper():
with open(pvcnoded_config_file, "r") as cfgfile: with open(pvcnoded_config_file, "r") as cfgfile:
try: try:
o_config = yaml.load(cfgfile) o_config = yaml.load(cfgfile, yaml.SafeLoader)
except Exception as e: except Exception as e:
print( print(
"ERROR: Failed to parse configuration file: {}".format(e), "ERROR: Failed to parse configuration file: {}".format(e),

View File

@ -338,8 +338,21 @@ def collect_ceph_stats(logger, config, zkhandler, this_node, queue):
line = re.sub(r"\x1b(\[.*?[@-~]|\].*?(\x07|\x1b\\))", "", line) line = re.sub(r"\x1b(\[.*?[@-~]|\].*?(\x07|\x1b\\))", "", line)
# Split it for parsing # Split it for parsing
line = line.split() 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] osd_id = line[1]
node = line[3].split(".")[0] node = line[3].split(".")[0]
used = line[5] used = line[5]
@ -349,20 +362,39 @@ def collect_ceph_stats(logger, config, zkhandler, this_node, queue):
rd_ops = line[13] rd_ops = line[13]
rd_data = line[15] rd_data = line[15]
state = line[17] state = line[17]
osd_status.update( # If first entry is a digit (i.e. OSD ID)
{ elif line[0].isdigit():
str(osd_id): { # Parse the line in Ceph 16 format
"node": node, osd_id = line[0]
"used": used, node = line[1].split(".")[0]
"avail": avail, used = line[2]
"wr_ops": wr_ops, avail = line[3]
"wr_data": wr_data, wr_ops = line[4]
"rd_ops": rd_ops, wr_data = line[5]
"rd_data": rd_data, rd_ops = line[6]
"state": state, 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): {
"node": node,
"used": used,
"avail": avail,
"wr_ops": wr_ops,
"wr_data": wr_data,
"rd_ops": rd_ops,
"rd_data": rd_data,
"state": state,
} }
) }
)
# Merge them together into a single meaningful dict # Merge them together into a single meaningful dict
if debug: if debug: