From 89040ff6f78ac821a301b92c81fb901643a734df Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Mon, 16 Jun 2025 23:00:53 +0200 Subject: [PATCH] fix: add python symlink, use absolute python env path when running backends (#5664) * fix: add python symlink, use absolute python env path when running backends Signed-off-by: Ettore Di Giacinto * fix(ci): do not push images when building PRs Signed-off-by: Ettore Di Giacinto --------- Signed-off-by: Ettore Di Giacinto --- .github/workflows/image_build.yml | 4 ++-- Dockerfile | 2 +- backend/python/common/libbackend.sh | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/image_build.yml b/.github/workflows/image_build.yml index 4388a9fe..63e27e3a 100644 --- a/.github/workflows/image_build.yml +++ b/.github/workflows/image_build.yml @@ -223,7 +223,7 @@ jobs: password: ${{ secrets.dockerPassword }} - name: Login to DockerHub - # if: github.event_name != 'pull_request' + if: github.event_name != 'pull_request' uses: docker/login-action@v3 with: registry: quay.io @@ -282,7 +282,7 @@ jobs: file: ./Dockerfile cache-from: type=gha platforms: ${{ inputs.platforms }} - push: true + #push: true tags: ${{ steps.meta_pull_request.outputs.tags }} labels: ${{ steps.meta_pull_request.outputs.labels }} ## End testing image diff --git a/Dockerfile b/Dockerfile index 52f52cde..3bfc4a38 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,7 @@ RUN apt-get update && \ curl libssl-dev \ git \ git-lfs \ - unzip upx-ucl python3 && \ + unzip upx-ucl python3 python-is-python3 && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* diff --git a/backend/python/common/libbackend.sh b/backend/python/common/libbackend.sh index 6013cf76..f8e411c7 100644 --- a/backend/python/common/libbackend.sh +++ b/backend/python/common/libbackend.sh @@ -176,13 +176,13 @@ function startBackend() { ensureVenv if [ ! -z ${BACKEND_FILE} ]; then - exec python ${BACKEND_FILE} $@ + exec ${EDIR}/venv/bin/python ${BACKEND_FILE} $@ elif [ -e "${MY_DIR}/server.py" ]; then - exec python ${MY_DIR}/server.py $@ + exec ${EDIR}/venv/bin/python ${MY_DIR}/server.py $@ elif [ -e "${MY_DIR}/backend.py" ]; then - exec python ${MY_DIR}/backend.py $@ + exec ${EDIR}/venv/bin/python ${MY_DIR}/backend.py $@ elif [ -e "${MY_DIR}/${BACKEND_NAME}.py" ]; then - exec python ${MY_DIR}/${BACKEND_NAME}.py $@ + exec ${EDIR}/venv/bin/python ${MY_DIR}/${BACKEND_NAME}.py $@ fi }