Skip to content

Commit df07725

Browse files
committed
Update agent version to 1.8.3
Changes: - amplify.agent.common.runner migrated to latest PEP 3143 implementation, - added support for packaging Ubuntu 24.04 "noble", - fixed package building for RHEL 9.
1 parent 0b04168 commit df07725

File tree

13 files changed

+73
-14
lines changed

13 files changed

+73
-14
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
The NGINX Amplify Agent is a Python application that provides system and NGINX metric collection. It is part of NGINX Amplify — a free configuration monitoring tool for NGINX.
44

5-
Please check the list of the supported operating systems [here](https://docs.nginx.com/amplify/faq/nginx-amplify-agent/#what-operating-systems-are-supported).
5+
Please check the list of the supported operating systems [here](https://docs.nginx.com/nginx-amplify/faq/nginx-amplify-agent/#what-operating-systems-are-supported).
66

7-
This repository is not for installation purposes. To install the agent, please follow [this](https://docs.nginx.com/amplify/nginx-amplify-agent/install/installing-amplify-agent/) document.
7+
This repository is not for installation purposes. To install the agent, please follow [this](https://docs.nginx.com/nginx-amplify/nginx-amplify-agent/install/installing-amplify-agent/) document.
88

99
For more information about NGINX Amplify, please check the official documentation [here](https://docs.nginx.com/nginx-amplify/).

amplify/agent/common/context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def __init__(self):
3737

3838
# define vars
3939
self.cpu_last_check = 0
40-
self.version_semver = (1, 8, 2)
40+
self.version_semver = (1, 8, 3)
4141
self.version_build = 1
4242
self.uuid = None
4343
self.version = '%s-%s' % ('.'.join(map(str, self.version_semver)), self.version_build)

amplify/agent/common/runner.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,42 @@
11
# -*- coding: utf-8 -*-
22
import signal
33

4-
from daemon import runner
4+
import daemon
5+
from daemon.pidfile import PIDLockFile
56

67
from amplify.agent.common.context import context
78

89
__author__ = "Mike Belov"
910
__copyright__ = "Copyright (C) Nginx, Inc. All rights reserved."
1011
__license__ = ""
11-
__maintainer__ = "Mike Belov"
12-
__email__ = "dedm@nginx.com"
12+
__maintainer__ = "Andrei Belov"
13+
__email__ = "a.belov@f5.com"
1314

1415

15-
class Runner(runner.DaemonRunner):
16+
class Runner:
1617
def __init__(self, app):
17-
super(Runner, self).__init__(app)
18-
1918
def cleanup(signum, frame):
2019
app.stop()
2120

21+
self.daemon_context = daemon.DaemonContext()
22+
2223
self.app = app
2324
self.daemon_context.detach_process = True
25+
self.daemon_context.pidfile = PIDLockFile('/var/run/amplify-agent/amplify-agent.pid')
2426
self.daemon_context.files_preserve = context.get_file_handlers()
2527
self.daemon_context.signal_map = {
2628
signal.SIGTERM: cleanup
2729
}
30+
self._open_streams_from_app_stream_paths(app)
2831

2932
def _open_streams_from_app_stream_paths(self, app):
3033
self.daemon_context.stdin = open(app.stdin_path, 'rt')
3134
self.daemon_context.stdout = open(app.stdout_path, 'w+t')
3235
self.daemon_context.stderr = open(app.stderr_path, 'w+t')
36+
37+
def do_action(self):
38+
"""
39+
Stub function to mock old DaemonRunner behavior
40+
"""
41+
with self.daemon_context:
42+
self.app.run()

packages/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ case "$os" in
467467
incr_step
468468

469469
case "$codename" in
470-
buster|bullseye|bookworm|bionic|focal|jammy)
470+
buster|bullseye|bookworm|bionic|focal|jammy|noble)
471471
check_python 3
472472
python_supported=3
473473
;;

packages/nginx-amplify-agent/deb/debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
nginx-amplify-agent (1.8.3-1) stable; urgency=low
2+
3+
* migrated to the most recent daemonizing logic (PEP 3143)
4+
5+
-- Andrei Belov <a.belov@f5.com> Wed, 8 Jan 2025 16:08:40 +0400
6+
17
nginx-amplify-agent (1.8.2-1) stable; urgency=low
28

39
* pyMySQL updated to 1.1.1
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Source: nginx-amplify-agent
2+
Homepage: https://github.com/nginxinc/nginx-amplify-agent
3+
Maintainer: NGINX Packaging <nginx-packaging@f5.com>
4+
Section: python
5+
Priority: optional
6+
Build-Depends: debhelper (>= 13),
7+
dpkg-dev (>= 1.22),
8+
python3,
9+
dh-python
10+
Standards-Version: 4.5.0
11+
12+
Package: nginx-amplify-agent
13+
Description: Agent for NGINX Amplify monitoring platform
14+
The NGINX Amplify Agent is a small, Python application that provides
15+
system and NGINX metric collection. It is part of NGINX Amplify -
16+
the monitoring and configuration assistance service for NGINX.
17+
.
18+
This package installs and runs NGINX Amplify Agent daemon.
19+
.
20+
See http://nginx.com/amplify for more information
21+
Architecture: any
22+
Depends: ${misc:Depends},
23+
${python3:Depends},
24+
python3-daemon,
25+
python3-setproctitle,
26+
python3-greenlet,
27+
python3-gevent,
28+
python3-requests,
29+
python3-ujson,
30+
python3-netifaces,
31+
python3-pymysql,
32+
python3-psutil,
33+
lsb-release,
34+
adduser

packages/nginx-amplify-agent/requirements-rhel9.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ rstr==3.0.0
77
python-daemon==2.2.4
88
ujson==5.4.0
99
PyMySQL==1.1.1
10+
setuptools<=70.3.0
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
netaddr==0.8.0
2+
flup==1.0.3
3+
crossplane==0.5.8
4+
rstr==3.0.0

packages/nginx-amplify-agent/rpm/nginx-amplify-agent.spec

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@ fi
157157

158158

159159
%changelog
160+
* Wed Jan 8 2025 Andrei Belov <a.belov@f5.com> 1.8.3-1
161+
- 1.8.3-1
162+
- migrated to the most recent daemonizing logic (PEP 3143)
163+
160164
* Mon May 27 2024 Andrei Belov <a.belov@f5.com> 1.8.2-1
161165
- 1.8.2-1
162166
- pyMySQL updated to 1.1.1

packages/nginx-amplify-agent/setup-py310.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
setup(
3535
name="nginx-amplify-agent",
36-
version="1.8.2",
36+
version="1.8.3",
3737
author="Mike Belov",
3838
author_email="dedm@nginx.com",
3939
description="NGINX Amplify Agent",

packages/nginx-amplify-agent/setup-py39.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
setup(
3535
name="nginx-amplify-agent",
36-
version="1.8.2",
36+
version="1.8.3",
3737
author="Mike Belov",
3838
author_email="dedm@nginx.com",
3939
description="NGINX Amplify Agent",

packages/nginx-amplify-agent/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
setup(
3535
name="nginx-amplify-agent",
36-
version="1.8.2",
36+
version="1.8.3",
3737
author="Mike Belov",
3838
author_email="dedm@nginx.com",
3939
description="NGINX Amplify Agent",

packages/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.8.2-1
1+
1.8.3-1

0 commit comments

Comments
 (0)