diff --git a/projects/rocprofiler-compute/CMakeLists.txt b/projects/rocprofiler-compute/CMakeLists.txt index f06c00cfda..4dc5614090 100644 --- a/projects/rocprofiler-compute/CMakeLists.txt +++ b/projects/rocprofiler-compute/CMakeLists.txt @@ -626,6 +626,12 @@ add_custom_target( "src/${PACKAGE_NAME},cmake/Dockerfile,cmake/rocm_install.sh,docker/docker-entrypoint.sh,src/rocprof_compute_analyze/convertor/mongodb/convert" ) +set(STANDALONEBINARY_EXTRACT_DIR + "/tmp" + CACHE PATH + "Prefix path for standalone binary extraction" +) + # Standalone binary creation add_custom_target( standalonebinary @@ -647,6 +653,8 @@ add_custom_target( # https://nuitka.net/user-documentation/common-issue-solutions.html#fork-bombs-self-execution COMMAND ${Python3_EXECUTABLE} -m nuitka --mode=onefile --no-deployment-flag=self-execution + --product-name=${STANDALONEBINARY_EXTRACT_DIR} + --onefile-tempdir-spec=/{PRODUCT}/rocprof_compute_standalonebinary_{PID} --include-data-files=${PROJECT_SOURCE_DIR}/VERSION*=./ --enable-plugin=no-qt --include-data-files=src/lib/rocprofiler_compute_tool.cpp=lib/rocprofiler_compute_tool.cpp --include-package=dash_svg --include-package-data=dash_svg diff --git a/projects/rocprofiler-compute/docker/Dockerfile.standalone b/projects/rocprofiler-compute/docker/Dockerfile.standalone index a2bf836ba5..29df2b0453 100644 --- a/projects/rocprofiler-compute/docker/Dockerfile.standalone +++ b/projects/rocprofiler-compute/docker/Dockerfile.standalone @@ -13,11 +13,16 @@ RUN yum install -y python39 python39-devel && \ curl -sS https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \ python3 get-pip.py +# Should be absolute path to where the standalone binary will extract its contents +ENV ROCPROF_COMPUTE_BINARY_EXTRACT_DIR=/tmp + CMD ["/bin/bash", "-c", "\ python3 -m pip install -r requirements.txt \ && python3 -m pip install nuitka patchelf \ && git rev-parse HEAD > VERSION.sha \ && python3 -m nuitka --mode=onefile --no-deployment-flag=self-execution \ + --product-name=${ROCPROF_COMPUTE_BINARY_EXTRACT_DIR} \ + --onefile-tempdir-spec=/{PRODUCT}/rocprof_compute_standalonebinary_{PID} \ --enable-plugin=no-qt \ --include-data-files=VERSION*=./ \ --include-data-files=src/lib/rocprofiler_compute_tool.cpp=lib/rocprofiler_compute_tool.cpp \