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/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 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 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