From 93b80a2211d22a414ac613369e46be44a7d66fdd Mon Sep 17 00:00:00 2001 From: Min Yeol Lim Date: Mon, 15 Dec 2025 17:24:10 -0800 Subject: [PATCH 1/4] Set Alpine base image tag to 3.23.0 to address security vulnerabilities Signed-off-by: Min Yeol Lim --- container.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/container.Dockerfile b/container.Dockerfile index 6fbe8e162..95fc1bca3 100644 --- a/container.Dockerfile +++ b/container.Dockerfile @@ -1,4 +1,4 @@ -FROM alpine AS gprofiler +FROM alpine:3.23.0 AS gprofiler ARG ARCH ARG EXE_PATH=build/${ARCH}/gprofiler From 582372213ce5ad3a8e8d248ddcda30c4c685c17c Mon Sep 17 00:00:00 2001 From: Min Yeol Lim Date: Mon, 15 Dec 2025 20:08:25 -0800 Subject: [PATCH 2/4] Revert it to see if the test errors still happen Signed-off-by: Min Yeol Lim --- container.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/container.Dockerfile b/container.Dockerfile index 95fc1bca3..c3d0145a5 100644 --- a/container.Dockerfile +++ b/container.Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.23.0 AS gprofiler +FROM alpine:3.22.2 AS gprofiler ARG ARCH ARG EXE_PATH=build/${ARCH}/gprofiler From 5eceaf312a3e4d9d40d2c32f5928abb5f23b5c66 Mon Sep 17 00:00:00 2001 From: Min Yeol Lim Date: Mon, 15 Dec 2025 22:45:24 -0800 Subject: [PATCH 3/4] Add backports module to address test errors Signed-off-by: Min Yeol Lim --- container.Dockerfile | 2 +- pyinstaller.spec | 2 +- requirements.txt | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/container.Dockerfile b/container.Dockerfile index c3d0145a5..95fc1bca3 100644 --- a/container.Dockerfile +++ b/container.Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.22.2 AS gprofiler +FROM alpine:3.23.0 AS gprofiler ARG ARCH ARG EXE_PATH=build/${ARCH}/gprofiler diff --git a/pyinstaller.spec b/pyinstaller.spec index 60f77b8e4..03f0558f6 100644 --- a/pyinstaller.spec +++ b/pyinstaller.spec @@ -6,7 +6,7 @@ a = Analysis(scripts=['pyi_build.py'], pathex=['/app'], binaries=[], datas=[('gprofiler/resources', 'gprofiler/resources')], - hiddenimports=[], + hiddenimports=['backports.tarfile'], hookspath=[], runtime_hooks=[], excludes=['readline'], diff --git a/requirements.txt b/requirements.txt index fe062cb84..01f0d2033 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,3 +13,4 @@ WMI==1.5.1; sys.platform == "win32" ./granulate-utils/ humanfriendly==10.0 beautifulsoup4==4.13.3 +backports.tarfile==1.2.0 From 7db5027f9f25a067b67238d9986561ab0400a471 Mon Sep 17 00:00:00 2001 From: Min Yeol Lim Date: Tue, 16 Dec 2025 17:04:48 -0800 Subject: [PATCH 4/4] Clean up disk space to avoid disk error during tests Signed-off-by: Min Yeol Lim --- .github/workflows/build-test-deploy.yml | 5 +++++ tests/conftest.py | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-test-deploy.yml b/.github/workflows/build-test-deploy.yml index bdfd23f72..0bdb10a39 100644 --- a/.github/workflows/build-test-deploy.yml +++ b/.github/workflows/build-test-deploy.yml @@ -274,6 +274,11 @@ jobs: - name: Extract resources from gProfiler executable run: sudo ./output/gprofiler_x86_64 extract-resources --resources-dest=./gprofiler/resources + - name: Clean Docker resources + run: | + docker system prune -f --volumes + df -h + # used in the tests - name: Import gProfiler image run: docker image load < output/gprofiler_x86_64.img diff --git a/tests/conftest.py b/tests/conftest.py index 5d4cb0fae..5c9bc266a 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -408,7 +408,14 @@ def application_docker_image( ) if application_image_tag == "musl": pytest.xfail("This test does not work on aarch64 https://github.com/intel/gprofiler/issues/743") - yield build_image(docker_client, **application_docker_image_configs[image_name(runtime, application_image_tag)]) + image = build_image(docker_client, **application_docker_image_configs[image_name(runtime, application_image_tag)]) + yield image + + # Clean up the test image after test completes to free disk space for subsequent tests + try: + docker_client.images.remove(image.id, force=True) + except Exception: + pass # Image might be in use by other tests or already removed @fixture