summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile65
1 files changed, 51 insertions, 14 deletions
diff --git a/Makefile b/Makefile
index b5aa1388..57d96606 100644
--- a/Makefile
+++ b/Makefile
@@ -66,13 +66,13 @@ test: ## Run unit tests
./venv/bin/python ./unitest.py
./venv/bin/python ./unitest-restful.py
./venv/bin/python ./unitest-xmlrpc.py
- ./venv/bin/python -m black ./glances --check --exclude outputs/static
+ ./venv-dev/bin/python -m black ./glances --check --exclude outputs/static
test-with-upgrade: venv-upgrade venv-dev-upgrade ## Upgrade deps and run unit tests
./venv/bin/python ./unitest.py
./venv/bin/python ./unitest-restful.py
./venv/bin/python ./unitest-xmlrpc.py
- ./venv/bin/python -m black ./glances --check --exclude outputs/static
+ ./venv/bin-dev/python -m black ./glances --check --exclude outputs/static
test-min: ## Run unit tests in minimal environment
./venv-min/bin/python ./unitest.py
@@ -104,10 +104,25 @@ codespell: ## Run codespell to fix common misspellings in text files
semgrep: ## Run semgrep to find bugs and enforce code standards
./venv-dev/bin/semgrep scan --config=auto
-profiling: ## How to start the profiling of the Glances software
- @echo "Start a Glances instance and get its PID"
- @echo "Run: sudo ./venv-dev/bin/py-spy record -o ./docs/_static/glances-flame.svg -d 60 -s --pid <GLANCES PID>"
- @echo "Open the SVG file (./docs/_static/glances-flame.svg) with a Web browser"
+profiling-gprof: ## Callgraph profiling (need "apt install graphviz")
+ @echo "Start Glances for 30 iterations (more or less 1 mins, please do not exit !)"
+ sleep 3
+ ./venv/bin/python -m cProfile -o ./glances.cprof ./run.py --stop-after 30
+ ./venv-dev/bin/gprof2dot -f pstats ./glances.cprof | dot -Tsvg -o ./docs/_static/glances-cgraph.svg
+ rm -f ./glances.cprof
+
+profiling-pyinstrument: ## PyInstrument profiling
+ @echo "Start Glances for 30 iterations (more or less 1 mins, please do not exit !)"
+ sleep 3
+ ./venv/bin/pip install pyinstrument
+ ./venv/bin/python -m pyinstrument -r html -o ./docs/_static/glances-pyinstrument.html -m glances --stop-after 30
+
+profiling-pyspy: ## Flame profiling (currently not compatible with Python 3.12)
+ @echo "Start Glances for 30 iterations (more or less 1 mins, please do not exit !)"
+ sleep 3
+ ./venv-dev/bin/py-spy record -o ./docs/_static/glances-flame.svg -d 60 -s -- ./venv/bin/python ./run.py --stop-after 30
+
+profiling: profiling-gprof profiling-pyinstrument profiling-pyspy ## Profiling of the Glances software
trace-malloc: ## Trace the malloc() calls
@echo "Malloc test is running, please wait ~30 secondes..."
@@ -184,19 +199,32 @@ snapcraft:
# ===================================================================
# Docker
+# Need Docker Buildx package (apt install docker-buildx on Ubuntu)
# ===================================================================
docker: docker-alpine docker-ubuntu ## Generate local docker images
-docker-alpine: ## Generate local docker images (Alpine)
- docker build --target full -f ./docker-files/alpine.Dockerfile -t glances:local-alpine-full .
- docker build --target minimal -f ./docker-files/alpine.Dockerfile -t glances:local-alpine-minimal .
- docker build --target dev -f ./docker-files/alpine.Dockerfile -t glances:local-alpine-dev .
+docker-alpine: docker-alpine-full docker-alpine-minimal docker-alpine-dev ## Generate local docker images (Alpine)
+
+docker-alpine-full: ## Generate local docker image (Alpine full)
+ docker buildx build --target full -f ./docker-files/alpine.Dockerfile -t glances:local-alpine-full .
+
+docker-alpine-minimal: ## Generate local docker image (Alpine minimal)
+ docker buildx build --target minimal -f ./docker-files/alpine.Dockerfile -t glances:local-alpine-minimal .
+
+docker-alpine-dev: ## Generate local docker image (Alpine dev)
+ docker buildx build --target dev -f ./docker-files/alpine.Dockerfile -t glances:local-alpine-dev .
-docker-ubuntu: ## Generate local docker images (Ubuntu)
- docker build --target full -f ./docker-files/ubuntu.Dockerfile -t glances:local-ubuntu-full .
- docker build --target minimal -f ./docker-files/ubuntu.Dockerfile -t glances:local-ubuntu-minimal .
- docker build --target dev -f ./docker-files/ubuntu.Dockerfile -t glances:local-ubuntu-dev .
+docker-ubuntu: docker-ubuntu-full docker-ubuntu-minimal docker-ubuntu-dev ## Generate local docker images (Ubuntu)
+
+docker-ubuntu-full: ## Generate local docker image (Ubuntu full)
+ docker buildx build --target full -f ./docker-files/ubuntu.Dockerfile -t glances:local-ubuntu-full .
+
+docker-ubuntu-minimal: ## Generate local docker image (Ubuntu minimal)
+ docker buildx build --target minimal -f ./docker-files/ubuntu.Dockerfile -t glances:local-ubuntu-minimal .
+
+docker-ubuntu-dev: ## Generate local docker image (Ubuntu dev)
+ docker buildx build --target dev -f ./docker-files/ubuntu.Dockerfile -t glances:local-ubuntu-dev .
# ===================================================================
# Run
@@ -211,6 +239,9 @@ run-debug: ## Start Glances in debug console mode (also called standalone)
run-local-conf: ## Start Glances in console mode with the system conf file
./venv/bin/python -m glances
+run-local-conf-hide-public: ## Start Glances in console mode with the system conf file and hide public information
+ ./venv/bin/python -m glances --hide-public-info
+
run-min: ## Start minimal Glances in console mode (also called standalone)
./venv-min/bin/python -m glances -C ./conf/glances.conf
@@ -241,6 +272,12 @@ run-docker-ubuntu-dev: ## Start Glances Ubuntu Docker dev in console mode
run-webserver: ## Start Glances in Web server mode
./venv/bin/python -m glances -C ./conf/glances.conf -w
+run-webserver-local-conf: ## Start Glances in Web server mode with the system conf file
+ ./venv/bin/python -m glances -w
+
+run-webserver-local-conf-hide-public: ## Start Glances in Web server mode with the system conf file and hide public info
+ ./venv/bin/python -m glances -w --hide-public-info
+
run-restapiserver: ## Start Glances in REST API server mode
./venv/bin/python -m glances -C ./conf/glances.conf -w --disable-webui