From f0fc27f9522a6bee1f06c5629d8b1c82ca23946c Mon Sep 17 00:00:00 2001 From: Bharath Vignesh J K <52282402+RazCrimson@users.noreply.github.com> Date: Sun, 19 May 2024 06:57:11 +0530 Subject: [PATCH 1/7] chg: pyproject.toml - remove black config --- pyproject.toml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c5fb7e4a..6dac1fbf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,3 @@ -[tool.black] -line-length = 120 -skip-string-normalization = true -exclude = '\./glances/outputs/static/*' - [tool.ruff] line-length = 120 target-version = "py38" From 53621f413ba6f89d80618eeeae2da03f3041d679 Mon Sep 17 00:00:00 2001 From: Bharath Vignesh J K <52282402+RazCrimson@users.noreply.github.com> Date: Sun, 19 May 2024 06:59:03 +0530 Subject: [PATCH 2/7] chg: deps - remove unused deps - scandir & wifi --- optional-requirements.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/optional-requirements.txt b/optional-requirements.txt index d9d86a1b..fa15f44b 100644 --- a/optional-requirements.txt +++ b/optional-requirements.txt @@ -32,10 +32,8 @@ pysnmp-lextudio; python_version >= "3.7" python-dateutil pyzmq requests -scandir; python_version < "3.5" six sparklines statsd uvicorn; python_version >= "3.8" -wifi zeroconf==0.131.0 # Waiting correction for ARMv7: https://github.com/python-zeroconf/python-zeroconf/issues/1372 From 6743eea32dc4f6e256230fef1da7b8595d9175aa Mon Sep 17 00:00:00 2001 From: Bharath Vignesh J K <52282402+RazCrimson@users.noreply.github.com> Date: Sun, 19 May 2024 07:01:33 +0530 Subject: [PATCH 3/7] chg: requirements.txt(s) - remove unnecessary version constraints - drop duplicated deps already present in base requirements.txt --- doc-requirements.txt | 1 - docker-requirements.txt | 5 ++--- optional-requirements.txt | 15 +++++++-------- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/doc-requirements.txt b/doc-requirements.txt index 804d5398..61334af4 100644 --- a/doc-requirements.txt +++ b/doc-requirements.txt @@ -2,4 +2,3 @@ reuse setuptools>=65.5.1 # not directly required, pinned by Snyk to avoid a vulnerability sphinx sphinx_rtd_theme -ujson diff --git a/docker-requirements.txt b/docker-requirements.txt index feac4040..d73baf4f 100644 --- a/docker-requirements.txt +++ b/docker-requirements.txt @@ -1,9 +1,8 @@ # install with base requirements file -r requirements.txt -docker>=6.1.1; python_version >= "3.7" -packaging; python_version >= "3.7" -podman; python_version >= "3.6" +docker>=6.1.1 +podman python-dateutil requests six diff --git a/optional-requirements.txt b/optional-requirements.txt index fa15f44b..13089cdc 100644 --- a/optional-requirements.txt +++ b/optional-requirements.txt @@ -7,33 +7,32 @@ cassandra-driver chevron docker>=6.1.1 elasticsearch -fastapi; python_version >= "3.8" +fastapi graphitesender hddtemp influxdb>=1.0.0 # For InfluxDB < 1.8 -influxdb-client; python_version >= "3.7" # For InfluxDB >= 1.8 +influxdb-client # For InfluxDB >= 1.8 jinja2 kafka-python netifaces -nvidia-ml-py; python_version >= "3.5" -packaging; python_version >= "3.7" +nvidia-ml-py paho-mqtt pika -podman; python_version >= "3.6" +podman potsdb prometheus_client pycouchdb pydantic pygal pymdstat -pymongo; python_version >= "3.7" +pymongo pySMART.smartx -pysnmp-lextudio; python_version >= "3.7" +pysnmp-lextudio python-dateutil pyzmq requests six sparklines statsd -uvicorn; python_version >= "3.8" +uvicorn zeroconf==0.131.0 # Waiting correction for ARMv7: https://github.com/python-zeroconf/python-zeroconf/issues/1372 From e07bacf9a3efb2b174dc75c10c67ad661625674d Mon Sep 17 00:00:00 2001 From: Bharath Vignesh J K <52282402+RazCrimson@users.noreply.github.com> Date: Sun, 19 May 2024 07:22:37 +0530 Subject: [PATCH 4/7] chg: build workflow - use latest official docker meta action --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 88385df1..b4ffdbce 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -123,7 +123,7 @@ jobs: - name: Retrieve Repository Docker metadata id: docker_meta - uses: crazy-max/ghaction-docker-meta@v5.0.0 + uses: docker/metadata-action@v5 with: images: ${{ env.DEFAULT_DOCKER_IMAGE }} labels: | From c5ea3d292cb6206c1b4f367e9288fed72d9aa7aa Mon Sep 17 00:00:00 2001 From: Bharath Vignesh J K <52282402+RazCrimson@users.noreply.github.com> Date: Sun, 19 May 2024 07:33:44 +0530 Subject: [PATCH 5/7] chg: build workflow - use newer cache exporter - gha Ref: https://docs.docker.com/build/cache/backends --- .github/workflows/build.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b4ffdbce..efd08fbb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -129,13 +129,6 @@ jobs: labels: | org.opencontainers.image.url=https://nicolargo.github.io/glances/ - - name: Cache Docker layers - uses: actions/cache@v4 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ env.NODE_ENV }}-${{ matrix.os }}-${{ matrix.tag.tag }} - restore-keys: ${{ runner.os }}-buildx-${{ env.NODE_ENV }}-${{ matrix.os }} - - name: Set up QEMU uses: docker/setup-qemu-action@v3 with: @@ -166,5 +159,5 @@ jobs: platforms: ${{ matrix.os != 'ubuntu' && env.DOCKER_PLATFORMS || env.DOCKER_PLATFORMS_UBUNTU }} target: ${{ matrix.tag.target }} labels: ${{ steps.docker_meta.outputs.labels }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache,mode=max + cache-from: type=gha + cache-to: type=gha,mode=max From f6ddc5cf4965e333f7344465ca9062fab4df3721 Mon Sep 17 00:00:00 2001 From: Bharath Vignesh J K <52282402+RazCrimson@users.noreply.github.com> Date: Sun, 19 May 2024 08:40:37 +0530 Subject: [PATCH 6/7] chg: build workflow - use scope to prevent multiple os caches from overwriting each other --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index efd08fbb..90dcfd1e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -160,4 +160,6 @@ jobs: target: ${{ matrix.tag.target }} labels: ${{ steps.docker_meta.outputs.labels }} cache-from: type=gha - cache-to: type=gha,mode=max + # GHA default behaviour overwrites last build cache. Causes alpine and ubuntu cache to overwrite each other. + # Use `scope` with the os name to prevent that + cache-to: 'type=gha,mode=max,scope=${{ matrix.os }}' From 9ab3199e1339157992c088dbb7a6e2daa08a31cb Mon Sep 17 00:00:00 2001 From: Bharath Vignesh J K <52282402+RazCrimson@users.noreply.github.com> Date: Sun, 19 May 2024 09:37:53 +0530 Subject: [PATCH 7/7] fix: build workflow - missing scope on `cache-from` --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 90dcfd1e..024a37bc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -159,7 +159,7 @@ jobs: platforms: ${{ matrix.os != 'ubuntu' && env.DOCKER_PLATFORMS || env.DOCKER_PLATFORMS_UBUNTU }} target: ${{ matrix.tag.target }} labels: ${{ steps.docker_meta.outputs.labels }} - cache-from: type=gha # GHA default behaviour overwrites last build cache. Causes alpine and ubuntu cache to overwrite each other. # Use `scope` with the os name to prevent that + cache-from: 'type=gha,scope=${{ matrix.os }}' cache-to: 'type=gha,mode=max,scope=${{ matrix.os }}'