Skip to content

Commit

Permalink
Merge branch 'develop' into issue2183
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolargo committed Dec 21, 2023
2 parents e936a38 + 380888a commit 7025098
Show file tree
Hide file tree
Showing 134 changed files with 9,221 additions and 8,759 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@ jobs:
--outdir dist/
- name: Publish distribution package to Test PyPI
uses: pypa/gh-action-pypi-publish@master
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true
repository-url: https://test.pypi.org/legacy/
skip-existing: true

- name: Publish distribution package to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
Expand Down
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,11 @@ test-min: ## Run unit tests in minimal environment
test-min-with-upgrade: venv-min-upgrade ## Upgrade deps and run unit tests in minimal environment
./venv-min/bin/python ./unitest.py

test-restful-api: ## Run unit tests of the RESTful API
./venv/bin/python ./unitest-restful.py

# ===================================================================
# Linters and profilers
# Linters, profilers and cyber security
# ===================================================================

format: ## Format the code
Expand All @@ -99,7 +102,7 @@ codespell: ## Run codespell to fix common misspellings in text files
./venv-dev/bin/codespell -S .git,./docs/_build,./Glances.egg-info,./venv*,./glances/outputs,*.svg -L hart,bu,te,statics

semgrep: ## Run semgrep to find bugs and enforce code standards
./venv-dev/bin/semgrep --config=auto --lang python --use-git-ignore ./glances
./venv-dev/bin/semgrep scan --config=auto

profiling: ## How to start the profiling of the Glances software
@echo "Please complete and run: sudo ./venv-dev/bin/py-spy record -o ./docs/_static/glances-flame.svg -d 60 -s --pid <GLANCES PID>"
Expand All @@ -123,6 +126,10 @@ memory-profiling: ## Profile memory usage
./venv-dev/bin/mprof plot --output ./docs/_static/glances-memory-profiling-without-history.png
rm -f mprofile_*.dat

# Trivy installation: https://aquasecurity.github.io/trivy/latest/getting-started/installation/
trivy: ## Run Trivy to find vulnerabilities in container images
trivy fs .

# ===================================================================
# Docs
# ===================================================================
Expand Down
13 changes: 12 additions & 1 deletion NEWS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@ Version 4.0.0

Under development: https://github.com/nicolargo/glances/issues?q=is%3Aopen+is%3Aissue+milestone%3A%22Glances+4.0.0%22

**BREAKING CHANGES:**

* The Glances API version 3 is replaced by the version 4. So Restfull API URL is now /api/4/ #2610
* Alias definition change in the configuration file #1735
Glances version 3.x and lower:
sda1_alias=InternalDisk
sdb1_alias=ExternalDisk
Glances version 4.x and higher:
alias=sda1:InternalDisk,sdb1:ExternalDisk
* Alias can now be used to redefine FS name #1735

===============
Version 3.4.0.3
===============
Expand Down Expand Up @@ -899,7 +910,7 @@ Processes list Nice value:

[processlist]
# Nice priorities range from -20 to 19.
# Configure nice levels using a comma separated list.
# Configure nice levels using a comma-separated list.
#
# Nice: Example 1, non-zero is warning (default behavior)
nice_warning=-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19
Expand Down
10 changes: 6 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,19 @@ Optional dependencies:

- ``batinfo`` (for battery monitoring)
- ``bernhard`` (for the Riemann export module)
- ``bottle`` (for Web server mode)
- ``cassandra-driver`` (for the Cassandra export module)
- ``chevron`` (for the action script feature)
- ``docker`` (for the Containers Docker monitoring support)
- ``elasticsearch`` (for the Elastic Search export module)
- ``FastAPI`` and ``Uvicorn`` (for Web server mode)
- ``graphitesender`` (For the Graphite export module)
- ``hddtemp`` (for HDD temperature monitoring support) [Linux-only]
- ``influxdb`` (for the InfluxDB version 1 export module)
- ``influxdb-client`` (for the InfluxDB version 2 export module)
- ``jinja2`` (for templating, used under the hood by FastAPI)
- ``kafka-python`` (for the Kafka export module)
- ``netifaces`` (for the IP plugin)
- ``orjson`` (fast JSON library, used under the hood by FastAPI)
- ``py3nvml`` (for the GPU plugin)
- ``pycouchdb`` (for the CouchDB export module)
- ``pika`` (for the RabbitMQ/ActiveMQ export module)
Expand Down Expand Up @@ -207,10 +209,10 @@ Get the Glances container:
The following tags are availables:

- *latest-full* for a full Alpine Glances image (latest release) with all dependencies
- *latest* for a basic Alpine Glances (latest release) version with minimal dependencies (Bottle and Docker)
- *latest* for a basic Alpine Glances (latest release) version with minimal dependencies (FastAPI and Docker)
- *dev* for a basic Alpine Glances image (based on development branch) with all dependencies (Warning: may be instable)
- *ubuntu-latest-full* for a full Ubuntu Glances image (latest release) with all dependencies
- *ubuntu-latest* for a basic Ubuntu Glances (latest release) version with minimal dependencies (Bottle and Docker)
- *ubuntu-latest* for a basic Ubuntu Glances (latest release) version with minimal dependencies (FastAPI and Docker)
- *ubuntu-dev* for a basic Ubuntu Glances image (based on development branch) with all dependencies (Warning: may be instable)

Run last version of Glances container in *console mode*:
Expand Down Expand Up @@ -319,7 +321,7 @@ Start Termux on your device and enter:
$ apt update
$ apt upgrade
$ apt install clang python
$ pip install bottle
$ pip install fastapi uvicorn orjson jinja2
$ pip install glances
And start Glances:
Expand Down
28 changes: 12 additions & 16 deletions conf/glances.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ history_size=1200
# Theme name for the Curses interface: black or white
curse_theme=black
# Limit the number of processes to display (for the WebUI)
max_processes_display=30
max_processes_display=25
# Set the URL prefix (for the WebUI and the API)
# Example: url_prefix=/glances/ => http://localhost/glances/
# The final / is mandatory
Expand Down Expand Up @@ -167,8 +167,6 @@ tx_critical=90
#hide=docker.*,lo
# Define the list of wireless network interfaces to be show (comma-separated)
#show=docker.*
# WLAN 0 alias
#wlan0_alias=Wireless
# It is possible to overwrite the bitrate thresholds per interface
# WLAN 0 Default limits (in bits per second aka bps) for interface bitrate
#wlan0_rx_careful=4000000
Expand All @@ -179,6 +177,8 @@ tx_critical=90
#wlan0_tx_warning=900000
#wlan0_tx_critical=1000000
#wlan0_tx_log=True
# Alias for network interface name
alias=wlp2s0:WIFI

[ip]
disable=False
Expand Down Expand Up @@ -218,8 +218,8 @@ disable=False
hide=loop.*,/dev/loop.*
# Define the list of disks to be show (comma-separated)
#show=sda.*
# Alias for sda1
#sda1_alias=InternalDisk
# Alias for sda1 and sdb1
alias=sda1:InternalDisk,sdb1:ExternalDisk

[fs]
disable=False
Expand All @@ -236,6 +236,8 @@ warning=70
critical=90
# Allow additional file system types (comma-separated FS type)
#allow=shm
# Alias for root file system
alias=/:Root

[irq]
# Documentation: https://glances.readthedocs.io/en/latest/aoa/irq.html
Expand Down Expand Up @@ -307,13 +309,7 @@ battery_careful=80
battery_warning=90
battery_critical=95
# Sensors alias
#temp1_alias=Motherboard 0
#temp2_alias=Motherboard 1
#core 0_temperature_core_alias=CPU Core 0 temp
#core 0_fans_speed_alias=CPU Core 0 fan
#or
#core 0_alias=CPU Core 0
#core 1_alias=CPU Core 1
#alias=core 0:CPU Core 0,core 1:CPU Core 1

[processcount]
disable=False
Expand All @@ -336,7 +332,7 @@ mem_warning=70
mem_critical=90
#
# Nice priorities range from -20 to 19.
# Configure nice levels using a comma separated list.
# Configure nice levels using a comma-separated list.
#
# Nice: Example 1, non-zero is warning (default behavior)
nice_warning=-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19
Expand Down Expand Up @@ -394,10 +390,10 @@ port_default_gateway=True

[containers]
disable=False
# Only show specific containers (comma separated list of container name or regular expression)
# Only show specific containers (comma-separated list of container name or regular expression)
# Comment this line to display all containers (default configuration)
; show=telegraf
# Hide some containers (comma separated list of container name or regular expression)
# Hide some containers (comma-separated list of container name or regular expression)
# Comment this line to display all containers (default configuration)
; hide=telegraf
# Define the maximum docker size name (default is 20 chars)
Expand Down Expand Up @@ -428,7 +424,7 @@ disable=False
[alert]
disable=False
# Maximum number of alerts to display (default is 10)
; max_events=10
;max_events=10

##############################################################################
# Client/server
Expand Down
2 changes: 1 addition & 1 deletion docker-compose/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM nicolargo/glances:latest as glancesminimal
FROM glances:local-alpine-minimal as glancesminimal
COPY glances.conf /glances/conf/glances.conf
CMD python -m glances -C /glances/conf/glances.conf $GLANCES_OPT
19 changes: 10 additions & 9 deletions docker-compose/docker-compose-with-traefik.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,16 @@ services:
- "/run/user/1000/podman/podman.sock:/run/user/1000/podman/podman.sock:ro"
- "./glances.conf:/glances/conf/glances.conf"
environment:
- GLANCES_OPT: "-C /glances/conf/glances.conf -w"
- TZ: "${TZ}"
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
- TZ=${TZ}
- "GLANCES_OPT=-C /glances/conf/glances.conf -w"
# Uncomment for GPU compatibilty (Nvidia) inside the container
# deploy:
# resources:
# reservations:
# devices:
# - driver: nvidia
# count: 1
# capabilities: [gpu]
labels:
- "traefik.port=61208"
- "traefik.frontend.rule=Host:glances.docker.localhost"
19 changes: 10 additions & 9 deletions docker-compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ services:
- "/run/user/1000/podman/podman.sock:/run/user/1000/podman/podman.sock:ro"
- "./glances.conf:/glances/conf/glances.conf"
environment:
- GLANCES_OPT: "-C /glances/conf/glances.conf -w"
- TZ: "${TZ}"
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
- TZ=${TZ}
- "GLANCES_OPT=-C /glances/conf/glances.conf -w"
# Uncomment for GPU compatibilty (Nvidia) inside the container
# deploy:
# resources:
# reservations:
# devices:
# - driver: nvidia
# count: 1
# capabilities: [gpu]
8 changes: 4 additions & 4 deletions docker-compose/glances.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ history_size=1200
# Theme name for the Curses interface: black or white
curse_theme=black
# Limit the number of processes to display (for the WebUI)
max_processes_display=30
max_processes_display=25
# Set the URL prefix (for the WebUI and the API)
# Example: url_prefix=/glances/ => http://localhost/glances/
# The final / is mandatory
Expand Down Expand Up @@ -340,7 +340,7 @@ mem_warning=70
mem_critical=90
#
# Nice priorities range from -20 to 19.
# Configure nice levels using a comma separated list.
# Configure nice levels using a comma-separated list.
#
# Nice: Example 1, non-zero is warning (default behavior)
nice_warning=-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19
Expand Down Expand Up @@ -398,10 +398,10 @@ port_default_gateway=True

[containers]
disable=False
# Only show specific containers (comma separated list of container name or regular expression)
# Only show specific containers (comma-separated list of container name or regular expression)
# Comment this line to display all containers (default configuration)
; show=telegraf
# Hide some containers (comma separated list of container name or regular expression)
# Hide some containers (comma-separated list of container name or regular expression)
# Comment this line to display all containers (default configuration)
; hide=telegraf
# Define the maximum docker size name (default is 20 chars)
Expand Down
2 changes: 1 addition & 1 deletion docker-files/alpine.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ EXPOSE 61209 61208

# Define default command.
WORKDIR /app
CMD /venv/bin/python3 -m glances -C /etc/glances.conf $GLANCES_OPT
CMD /venv/bin/python3 -m glances $GLANCES_OPT

################################################################################
# RELEASE: minimal
Expand Down
2 changes: 1 addition & 1 deletion docker-files/ubuntu.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ EXPOSE 61209 61208

# Define default command.
WORKDIR /app
CMD /venv/bin/python3 -m glances -C /etc/glances.conf $GLANCES_OPT
CMD /venv/bin/python3 -m glances $GLANCES_OPT

################################################################################
# RELEASE: minimal
Expand Down
4 changes: 2 additions & 2 deletions docker-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ podman; python_version >= "3.6"
packaging; python_version >= "3.7"
python-dateutil
six
urllib3<2.0 # See issue https://github.com/nicolargo/glances/issues/2392
requests # See issue - https://github.com/nicolargo/glances/issues/2233
urllib3<2.0 # See issue https://github.com/nicolargo/glances/issues/2617
requests
4 changes: 2 additions & 2 deletions docs/_static/glances-flame.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions docs/aoa/containers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ under the ``[containers]`` section:
[containers]
disable=False
# Only show specific containers (comma separated list of container name or regular expression)
# Only show specific containers (comma-separated list of container name or regular expression)
show=thiscontainer,andthisone,andthoseones.*
# Hide some containers (comma separated list of container name or regular expression)
# Hide some containers (comma-separated list of container name or regular expression)
hide=donotshowthisone,andthose.*
# Show only specific containers (comma separated list of container name or regular expression)
# Show only specific containers (comma-separated list of container name or regular expression)
#show=showthisone,andthose.*
# Define the maximum containers size name (default is 20 chars)
max_name_size=20
Expand Down
2 changes: 1 addition & 1 deletion docs/aoa/ps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ In curses/standalone mode, you can select a process using ``UP`` and ``DOWN`` an
.. note::
Limit for CPU and MEM percent values can be overwritten in the
configuration file under the ``[processlist]`` section. It is also
possible to define limit for Nice values (comma separated list).
possible to define limit for Nice values (comma-separated list).
For example: nice_warning=-20,-19,-18

Accumulated per program — key 'j'
Expand Down
Loading

0 comments on commit 7025098

Please sign in to comment.