From 61e891dbe0b21a75ec309ec21abb81122c1e26ef Mon Sep 17 00:00:00 2001 From: Vadim Soltan Date: Mon, 16 Jun 2025 09:22:46 -0400 Subject: [PATCH 1/4] Reverted runner os version to avoid glibc library issue. --- .github/workflows/build-and-publish-docker.yml | 4 ++-- .github/workflows/update_compatible_version.yml | 2 +- docs/compatible_version.ndjson | 1 + pyproject.toml | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-publish-docker.yml b/.github/workflows/build-and-publish-docker.yml index c6f31da8..283f5961 100644 --- a/.github/workflows/build-and-publish-docker.yml +++ b/.github/workflows/build-and-publish-docker.yml @@ -23,7 +23,7 @@ on: jobs: get-version: name: Get pilot cli version - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 outputs: cli_version: ${{steps.get-version.outputs.cli_version}} steps: @@ -39,7 +39,7 @@ jobs: build-and-push-docker-image: needs: [get-version] name: Build Docker images and push to repositories - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: Checkout code uses: actions/checkout@v3 diff --git a/.github/workflows/update_compatible_version.yml b/.github/workflows/update_compatible_version.yml index 2f85d6e0..f1a35732 100644 --- a/.github/workflows/update_compatible_version.yml +++ b/.github/workflows/update_compatible_version.yml @@ -9,7 +9,7 @@ on: jobs: update-compatible-versions: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: Checkout repository diff --git a/docs/compatible_version.ndjson b/docs/compatible_version.ndjson index 08339c06..127ef959 100644 --- a/docs/compatible_version.ndjson +++ b/docs/compatible_version.ndjson @@ -12,3 +12,4 @@ {"Cli Version": "3.19.3", "Pilot Release Version": "2.15.2", "Compatible Version": "2.15.2"} {"Cli Version": "3.19.4", "Pilot Release Version": "2.15.2", "Compatible Version": "2.15.2"} {"Cli Version": "3.19.5", "Pilot Release Version": "2.15.2", "Compatible Version": "2.15.2"} +{"Cli Version": "3.19.6", "Pilot Release Version": "2.15.2", "Compatible Version": "2.15.2"} diff --git a/pyproject.toml b/pyproject.toml index 24ed0290..204702be 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "app" -version = "3.19.5" +version = "3.19.6" description = "This service is designed to support pilot platform" authors = ["Indoc Systems"] From 4fb353c7c5f66acd596f47e3c7d9ec2936ef9b9d Mon Sep 17 00:00:00 2001 From: Vadim Soltan Date: Mon, 16 Jun 2025 14:31:49 -0400 Subject: [PATCH 2/4] All workflows 20.04 --- .github/workflows/build-and-publish.yml | 2 +- .github/workflows/run-tests.yml | 2 +- pyproject.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index 6321b157..d40ea28b 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -17,7 +17,7 @@ on: jobs: pre-build-setup: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 if: github.event.pull_request.merged == true # Runs only if PR is merged outputs: diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index bd29d336..a67bcff6 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -11,7 +11,7 @@ on: jobs: tests: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: Checkout repository uses: actions/checkout@v3 diff --git a/pyproject.toml b/pyproject.toml index 204702be..85872206 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "app" -version = "3.19.6" +version = "3.19.7" description = "This service is designed to support pilot platform" authors = ["Indoc Systems"] From 279ee3e719898fee4775e7d1f661d43ad93b378a Mon Sep 17 00:00:00 2001 From: Vadim Soltan Date: Mon, 16 Jun 2025 16:40:36 -0400 Subject: [PATCH 3/4] Ubuntu 20.04 with manual python and dep install. --- .github/workflows/build-and-publish.yml | 133 +++++++++++++++--------- .github/workflows/run-tests.yml | 2 +- 2 files changed, 82 insertions(+), 53 deletions(-) diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index d40ea28b..ee29ad36 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -17,7 +17,7 @@ on: jobs: pre-build-setup: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest if: github.event.pull_request.merged == true # Runs only if PR is merged outputs: @@ -83,61 +83,90 @@ jobs: with: name: release-message - - name: Download Release Message Artifact - uses: actions/download-artifact@v4 - with: - name: release-message - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: 3.10.12 - - - name: Install Poetry - uses: snok/install-poetry@v1 - with: - version: 1.8.3 - virtualenvs-create: true - virtualenvs-in-project: true - installer-parallel: true + - name: Set up Docker + uses: docker/setup-buildx-action@v2 - - name: Set up cache - id: cached-poetry-dependencies - uses: actions/cache@v3 - with: - path: .venv - key: venv-linux-${{ hashFiles('**/poetry.lock') }} - - - name: Ensure cache is healthy - if: steps.cached-poetry-dependencies.outputs.cache-hit == 'true' - run: timeout 10s poetry run pip --version || rm -rf .venv - - - name: Install dependencies - run: poetry install --no-interaction - - - name: Build default binary - run: poetry run pyinstaller -F --distpath ./app/bundled_app/linux --specpath ./app/build/linux --workpath ./app/build/linux --paths=./.venv/lib/python3.10/site-packages ./app/pilotcli.py -n ${{ github.sha }} - - - name: Rename default output file - run: mv "./app/bundled_app/linux/${{ github.sha }}" "./app/bundled_app/linux/pilotcli_linux" - - - name: Enable cloud mode - run: touch ./app/ENABLE_CLOUD_MODE - - - name: Build cloud binary - run: poetry run pyinstaller -F --distpath ./app/bundled_app/linux --specpath ./app/build/linux --workpath ./app/build/linux --paths=./.venv/lib/python3.9/site-packages --add-binary=$(pwd)/app/ENABLE_CLOUD_MODE:. ./app/pilotcli.py -n ${{ github.sha }} - - - name: Rename cloud output file - run: mv "./app/bundled_app/linux/${{ github.sha }}" "./app/bundled_app/linux/pilotcli_cloud" - - - name: Set version in env - run: poetry run echo "TAG_VERSION=`poetry version --short`" >> $GITHUB_ENV + - name: Create Docker build script + run: | + cat > build_script.sh << 'EOF' + #!/bin/bash + set -e + + # Install Poetry + export POETRY_HOME=/opt/poetry + export PATH=$POETRY_HOME/bin:$PATH + + # Install dependencies and build binaries + cd /github/workspace + poetry install --no-interaction + + # Build default binary + poetry run pyinstaller -F \ + --distpath ./app/bundled_app/linux \ + --specpath ./app/build/linux \ + --workpath ./app/build/linux \ + --paths=./.venv/lib/python3.10/site-packages \ + ./app/pilotcli.py -n $GITHUB_SHA + + # Rename default output file + mv "./app/bundled_app/linux/$GITHUB_SHA" "./app/bundled_app/linux/pilotcli_linux" + + # Enable cloud mode + touch ./app/ENABLE_CLOUD_MODE + + # Build cloud binary + poetry run pyinstaller -F \ + --distpath ./app/bundled_app/linux \ + --specpath ./app/build/linux \ + --workpath ./app/build/linux \ + --paths=./.venv/lib/python3.10/site-packages \ + --add-binary=$(pwd)/app/ENABLE_CLOUD_MODE:. \ + ./app/pilotcli.py -n $GITHUB_SHA + + # Rename cloud output file + mv "./app/bundled_app/linux/$GITHUB_SHA" "./app/bundled_app/linux/pilotcli_cloud" + + # Set version in env + echo "TAG_VERSION=$(poetry version --short)" > /github/workspace/version.txt + + # Ensure permissions are correct + chmod -R 777 /github/workspace/app/bundled_app + EOF + + chmod +x build_script.sh + + - name: Build binaries with Ubuntu 20.04 Docker + run: | + mkdir -p ./app/bundled_app/linux + mkdir -p ./app/build/linux + + docker run --rm \ + -v ${{ github.workspace }}:/github/workspace \ + -v ${{ github.workspace }}/build_script.sh:/build_script.sh \ + -e GITHUB_SHA=${{ github.sha }} \ + -w /github/workspace \ + ubuntu:20.04 bash -c " + set -e + export DEBIAN_FRONTEND=noninteractive + apt-get update + apt-get install -y software-properties-common curl build-essential + add-apt-repository -y ppa:deadsnakes/ppa + apt-get update + apt-get install -y python3.10 python3.10-venv python3.10-dev + curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10 + curl -sSL https://install.python-poetry.org | python3.10 - + export PATH=\"/root/.local/bin:\$PATH\" + /build_script.sh + " + + # Load version from file created in container + echo "TAG_VERSION=$(cat version.txt | cut -d'=' -f2)" >> $GITHUB_ENV - name: Create Release id: create_release uses: softprops/action-gh-release@v1 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ env.TAG_VERSION }} name: Release ${{ needs.pre-build-setup.outputs.branch }} ${{ env.TAG_VERSION }} @@ -195,7 +224,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: ${{ needs.push-binary-linux.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + upload_url: ${{ needs.push-binary-linux.outputs.upload_url }} asset_path: ./app/bundled_app/macos/${{ github.sha }} asset_name: pilotcli_macos asset_content_type: application/octet-stream @@ -246,7 +275,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: ${{ needs.push-binary-linux.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + upload_url: ${{ needs.push-binary-linux.outputs.upload_url }} asset_path: ./app/bundled_app/windows/${{ github.sha }}.exe asset_name: pilotcli_windows.exe asset_content_type: application/octet-stream diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index a67bcff6..bd29d336 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -11,7 +11,7 @@ on: jobs: tests: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v3 From 6fbbc4b45116e733a4ae9e3151a2d11c7d2ade5b Mon Sep 17 00:00:00 2001 From: Vadim Soltan Date: Mon, 16 Jun 2025 16:46:04 -0400 Subject: [PATCH 4/4] Old 20.04 remove --- .github/workflows/build-and-publish-docker.yml | 4 ++-- .github/workflows/update_compatible_version.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-publish-docker.yml b/.github/workflows/build-and-publish-docker.yml index 283f5961..c6f31da8 100644 --- a/.github/workflows/build-and-publish-docker.yml +++ b/.github/workflows/build-and-publish-docker.yml @@ -23,7 +23,7 @@ on: jobs: get-version: name: Get pilot cli version - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest outputs: cli_version: ${{steps.get-version.outputs.cli_version}} steps: @@ -39,7 +39,7 @@ jobs: build-and-push-docker-image: needs: [get-version] name: Build Docker images and push to repositories - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 diff --git a/.github/workflows/update_compatible_version.yml b/.github/workflows/update_compatible_version.yml index f1a35732..2f85d6e0 100644 --- a/.github/workflows/update_compatible_version.yml +++ b/.github/workflows/update_compatible_version.yml @@ -9,7 +9,7 @@ on: jobs: update-compatible-versions: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Checkout repository