Compare commits
10 Commits
cee0adb9f1
...
26046d15de
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
26046d15de | ||
|
|
4b08652307 | ||
|
|
f3a5418911 | ||
|
|
66b0128112 | ||
|
|
b28ea577a5 | ||
|
|
f67aeec9ad | ||
|
|
b020836c9e | ||
|
|
3cdc9a5537 | ||
|
|
eb5a21e9d6 | ||
|
|
fd920500e7 |
@ -1,43 +0,0 @@
|
||||
From 2820dc579dad400c8b0f4dfe4220c3d78e218645 Mon Sep 17 00:00:00 2001
|
||||
From: gongzt <gong_zhengtang@163.com>
|
||||
Date: Wed, 30 Aug 2023 15:41:06 +0800
|
||||
Subject: [PATCH] = Optimize start service check logic
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
---
|
||||
aops-vulcanus | 9 +++++++--
|
||||
1 file changed, 7 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/aops-vulcanus b/aops-vulcanus
|
||||
index abb02b1..ba854f9 100644
|
||||
--- a/aops-vulcanus
|
||||
+++ b/aops-vulcanus
|
||||
@@ -100,8 +100,13 @@ function is_started() {
|
||||
function start_service() {
|
||||
module_name=$1
|
||||
echo "[INFO] 1. Before starting the service, ensure that the data table is initialized"
|
||||
- echo "[INFO] 2. Execute aops-basedatabase zeus or apollo to complete the data table initialization, For example '/opt/aops/script/aops-basedatabase init zues'"
|
||||
+ echo "[INFO] 2. Execute aops-basedatabase zeus or apollo to complete the data table initialization, For example '/opt/aops/script/aops-basedatabase init zeus'"
|
||||
uwsgi -d --ini ${OUT_PATH}/"${module_name}".ini --enable-threads
|
||||
+ pid=`ps auxww | grep $module_name.ini | grep -v grep | awk '{print $2}'`
|
||||
+ if [ "${pid}" = "" ]; then
|
||||
+ echo "[ERROR] start uwsgi service: ${module_name} failed"
|
||||
+ exit 1
|
||||
+ fi
|
||||
echo "[INFO] start uwsgi service: ${module_name} success"
|
||||
exit 0
|
||||
}
|
||||
@@ -167,7 +172,7 @@ function check_mysql_installed() {
|
||||
aops_database=$(get_config "$CONFIG_FILE" "mysql" "database_name")
|
||||
connect_check_cmd="import pymysql
|
||||
try:
|
||||
- connect = pymysql.connect(host='$mysql_ip', port=$port, password='123456', database='$aops_database')
|
||||
+ connect = pymysql.connect(host='$mysql_ip', port=$port, database='$aops_database')
|
||||
connect.close()
|
||||
except pymysql.err.OperationalError:
|
||||
print(False)
|
||||
--
|
||||
Gitee
|
||||
|
||||
45
0001-update-ValidateRules.patch
Normal file
45
0001-update-ValidateRules.patch
Normal file
@ -0,0 +1,45 @@
|
||||
From 77f2c6a864baac31d7e6b4bee924dad82214092c Mon Sep 17 00:00:00 2001
|
||||
From: rabbitali <wenxin32@foxmail.com>
|
||||
Date: Wed, 20 Dec 2023 15:37:29 +0800
|
||||
Subject: [PATCH] update ValidateRules
|
||||
|
||||
---
|
||||
vulcanus/restful/serialize/validate.py | 14 ++++++++++++--
|
||||
1 file changed, 12 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/vulcanus/restful/serialize/validate.py b/vulcanus/restful/serialize/validate.py
|
||||
index d6eacbe..3050693 100644
|
||||
--- a/vulcanus/restful/serialize/validate.py
|
||||
+++ b/vulcanus/restful/serialize/validate.py
|
||||
@@ -64,7 +64,7 @@ class ValidateRules:
|
||||
"""
|
||||
validation rules for username, which only contains string or number
|
||||
"""
|
||||
- if not re.findall("[a-zA-Z0-9]{5,20}", string):
|
||||
+ if not re.findall("^[a-zA-Z0-9]{5,20}$", string):
|
||||
raise ValidationError("username should only contains string or number, between 5 and 20 characters!")
|
||||
|
||||
@staticmethod
|
||||
@@ -72,8 +72,18 @@ class ValidateRules:
|
||||
"""
|
||||
validation rules for password, which only contains string or number
|
||||
"""
|
||||
- if not re.findall("[a-zA-Z0-9]{6,20}", string):
|
||||
+ if not re.findall("^[a-zA-Z0-9]{6,20}$", string):
|
||||
raise ValidationError("password should only contains string or number, between 6 and 20 characters!!")
|
||||
+
|
||||
+ @staticmethod
|
||||
+ def ipv4_address_check(string: str):
|
||||
+ """
|
||||
+ validation rules for IPV4 address
|
||||
+ """
|
||||
+ ipv4_address_pattern = r"^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$"
|
||||
+ if not re.findall(ipv4_address_pattern, string):
|
||||
+ raise ValidationError("Not a valid IPV4 address.")
|
||||
+
|
||||
|
||||
|
||||
class PaginationSchema(Schema):
|
||||
--
|
||||
2.33.0
|
||||
|
||||
41
0002-add-error-catch-when-connect-pro.patch
Normal file
41
0002-add-error-catch-when-connect-pro.patch
Normal file
@ -0,0 +1,41 @@
|
||||
From dfd2f38fd34d300448ed9231377fcf4a0be7d367 Mon Sep 17 00:00:00 2001
|
||||
From: zhu-yuncheng <zhuyuncheng@huawei.com>
|
||||
Date: Sat, 23 Dec 2023 17:43:18 +0800
|
||||
Subject: [PATCH] add httpconnection error catch when connect prometheus
|
||||
|
||||
---
|
||||
vulcanus/database/proxy.py | 10 +++++++---
|
||||
1 file changed, 7 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/vulcanus/database/proxy.py b/vulcanus/database/proxy.py
|
||||
index 94e9883..5753066 100644
|
||||
--- a/vulcanus/database/proxy.py
|
||||
+++ b/vulcanus/database/proxy.py
|
||||
@@ -16,9 +16,9 @@ Author:
|
||||
Description: Database proxy
|
||||
"""
|
||||
from functools import wraps
|
||||
-import math
|
||||
from datetime import datetime
|
||||
from urllib3.exceptions import LocationValueError
|
||||
+from requests.exceptions import ConnectionError
|
||||
|
||||
import sqlalchemy
|
||||
from sqlalchemy.exc import SQLAlchemyError, DisconnectionError
|
||||
@@ -543,8 +543,12 @@ class PromDbProxy(DataBaseProxy):
|
||||
Returns:
|
||||
bool: connect succeed or fail
|
||||
"""
|
||||
-
|
||||
- return self._prom.check_prometheus_connection()
|
||||
+ connected = False
|
||||
+ try:
|
||||
+ connected = self._prom.check_prometheus_connection()
|
||||
+ except ConnectionError as error:
|
||||
+ LOGGER.error(error)
|
||||
+ return connected
|
||||
|
||||
def query(self, host, time_range, metric, label_config=None):
|
||||
"""
|
||||
--
|
||||
Gitee
|
||||
@ -1,58 +0,0 @@
|
||||
From 97d9a39ac7a196af73f491f3d447023797fbe469 Mon Sep 17 00:00:00 2001
|
||||
From: gongzt <gong_zhengtang@163.com>
|
||||
Date: Mon, 18 Sep 2023 11:39:40 +0800
|
||||
Subject: [PATCH 1/1] fix systemctl startup service error
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
---
|
||||
aops-vulcanus | 5 ++++-
|
||||
scripts/deploy/aops-basedatabase.sh | 6 +++---
|
||||
2 files changed, 7 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/aops-vulcanus b/aops-vulcanus
|
||||
index ba854f9..f00b4a0 100644
|
||||
--- a/aops-vulcanus
|
||||
+++ b/aops-vulcanus
|
||||
@@ -101,9 +101,11 @@ function start_service() {
|
||||
module_name=$1
|
||||
echo "[INFO] 1. Before starting the service, ensure that the data table is initialized"
|
||||
echo "[INFO] 2. Execute aops-basedatabase zeus or apollo to complete the data table initialization, For example '/opt/aops/script/aops-basedatabase init zeus'"
|
||||
+ rm -rf ${OUT_PATH}/"${module_name}".pid
|
||||
uwsgi -d --ini ${OUT_PATH}/"${module_name}".ini --enable-threads
|
||||
pid=`ps auxww | grep $module_name.ini | grep -v grep | awk '{print $2}'`
|
||||
- if [ "${pid}" = "" ]; then
|
||||
+ local_pid=`cat ${OUT_PATH}/"${module_name}".pid`
|
||||
+ if [ "${pid}" = "" ] && [ "${local_pid}" = "" ]; then
|
||||
echo "[ERROR] start uwsgi service: ${module_name} failed"
|
||||
exit 1
|
||||
fi
|
||||
@@ -115,6 +117,7 @@ function stop_service() {
|
||||
module_name=$1
|
||||
echo "[INFO] stop uwsgi service: ${module_name}"
|
||||
uwsgi --stop ${OUT_PATH}/"${module_name}".pid
|
||||
+ rm -rf ${OUT_PATH}/"${module_name}".pid
|
||||
echo "[INFO] stop ${AOPS_CONSTANT} service success"
|
||||
exit 0
|
||||
}
|
||||
diff --git a/scripts/deploy/aops-basedatabase.sh b/scripts/deploy/aops-basedatabase.sh
|
||||
index 054bea9..49a80f4 100755
|
||||
--- a/scripts/deploy/aops-basedatabase.sh
|
||||
+++ b/scripts/deploy/aops-basedatabase.sh
|
||||
@@ -133,9 +133,9 @@ function main(){
|
||||
service=$2
|
||||
case $operation in
|
||||
"init")
|
||||
- if [ "${service}" != "zeus" ] && [ "${service}" != "apollo" ]; then
|
||||
- echo "[ERROR] Table initialization service can only be zeus or apollo"
|
||||
- echo "[INFO] e.g 'aops-basedatabase init zeus' or 'aops-basedatabase init apollo'"
|
||||
+ if [ "${service}" != "zeus" ] && [ "${service}" != "apollo" ] && [ "${service}" != "diana" ]; then
|
||||
+ echo "[ERROR] Table initialization service can only be zeus apollo or diana"
|
||||
+ echo "[INFO] e.g 'aops-basedatabase init zeus' 'aops-basedatabase init apollo' or 'aops-basedatabase init diana'"
|
||||
exit 1
|
||||
fi
|
||||
config_file="/etc/aops/$service.ini"
|
||||
--
|
||||
2.33.1.windows.1
|
||||
|
||||
@ -0,0 +1,25 @@
|
||||
From b0dbdbf4c4992308f738d6ea74a9e3e21fc65129 Mon Sep 17 00:00:00 2001
|
||||
From: rabbitali <wenxin32@foxmail.com>
|
||||
Date: Wed, 27 Dec 2023 10:39:30 +0800
|
||||
Subject: [PATCH] Update the exception catching type of the function
|
||||
|
||||
---
|
||||
vulcanus/database/proxy.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/vulcanus/database/proxy.py b/vulcanus/database/proxy.py
|
||||
index 94e9883..4e62527 100644
|
||||
--- a/vulcanus/database/proxy.py
|
||||
+++ b/vulcanus/database/proxy.py
|
||||
@@ -108,7 +108,7 @@ class MysqlProxy(DataBaseProxy):
|
||||
"""
|
||||
try:
|
||||
self._create_session()
|
||||
- except sqlalchemy.exc.SQLAlchemyError as error:
|
||||
+ except DatabaseConnectionFailed as error:
|
||||
LOGGER.error(error)
|
||||
return False
|
||||
|
||||
--
|
||||
2.33.0
|
||||
|
||||
Binary file not shown.
BIN
aops-vulcanus-v1.3.1.tar.gz
Normal file
BIN
aops-vulcanus-v1.3.1.tar.gz
Normal file
Binary file not shown.
@ -1,20 +1,21 @@
|
||||
Name: aops-vulcanus
|
||||
Version: v1.3.0
|
||||
Release: 3
|
||||
Version: v1.3.1
|
||||
Release: 4
|
||||
Summary: A basic tool libraries of aops, including logging, configure and response, etc.
|
||||
License: MulanPSL2
|
||||
URL: https://gitee.com/openeuler/%{name}
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
Patch0001: 0001-optimize-service-start-check-logic.patch
|
||||
Patch0002: 0002-fix-systemctl-startup-service-error.patch
|
||||
Patch0001: 0001-update-ValidateRules.patch
|
||||
Patch0002: 0002-add-error-catch-when-connect-pro.patch
|
||||
Patch0003: 0003-update-the-exception-catching-type-of-the-function.patch
|
||||
|
||||
|
||||
BuildRequires: python3-setuptools
|
||||
Requires: python3-concurrent-log-handler python3-xmltodict python3-pyyaml python3-marshmallow >= 3.13.0
|
||||
Requires: python3-requests python3-xlrd python3-prettytable python3-pygments python3-sqlalchemy
|
||||
Requires: python3-elasticsearch >= 7 python3-prometheus-api-client python3-urllib3 python3-werkzeug
|
||||
Requires: python3-elasticsearch >= 7 python3-elasticsearch < 8 python3-prometheus-api-client python3-urllib3 python3-werkzeug
|
||||
Requires: python3-flask python3-flask-restful python3-PyMySQL python3-kafka-python
|
||||
Requires: python-jwt python-redis
|
||||
Requires: python-jwt python3-redis python3-Flask-APScheduler >= 1.11.0
|
||||
Provides: aops-vulcanus
|
||||
Conflicts: aops-utils
|
||||
|
||||
@ -62,6 +63,34 @@ cp -r scripts %{buildroot}/opt/aops/
|
||||
|
||||
|
||||
%changelog
|
||||
* Wed Dec 27 2023 wenxin<wenxin32@foxmail.com> - v1.3.1-4
|
||||
- update the exception catching type of the function
|
||||
|
||||
* Sat Dec 23 2023 zhuyuncheng<zhuyuncheng@huawei.com> - v1.3.1-3
|
||||
- add Http connection error catch when connecting to prometheus
|
||||
|
||||
* Thu Dec 21 2023 wenxin<wenxin32@foxmail.com> - v1.3.1-2
|
||||
- add IPV4 validation method to ValidateRules
|
||||
|
||||
* Mon Dec 18 2023 gongzhengtang<gong_zhengtang@163.com> - v1.3.1-1
|
||||
- Optimize paging statistics and software dependency versions
|
||||
|
||||
* Tue Nov 14 2023 wenxin<wenxin32@foxmail.com> - v1.3.0-8
|
||||
- update spec file
|
||||
|
||||
* Wed Oct 25 2023 wenxin<wenxin32@foxmail.com> - v1.3.0-7
|
||||
- update timed task args check
|
||||
|
||||
* Wed Oct 25 2023 wenxin<wenxin32@foxmail.com> - v1.3.0-6
|
||||
- since there is no arm-arch package in new repo source, remove changes of the es repo source url
|
||||
|
||||
* Tue Oct 24 2023 wenxin<wenxin32@foxmail.com> - v1.3.0-5
|
||||
- update timed task args check and timeout
|
||||
- update elasticsearch repo source url
|
||||
|
||||
* Wed Oct 18 2023 gongzhengtang<gong_zhengtang@163.com> - v1.3.0-4
|
||||
- it is suitable for version 20.03-LTS-sp3
|
||||
|
||||
* Tue Sep 19 2023 wenxin<shusheng.wen@outlook.com> - v1.3.0-3
|
||||
- fix systemctl startup service problem
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user