From b6ac94417befc06005a9acd6fb2baa86ad8b6852 Mon Sep 17 00:00:00 2001 From: Vojta Tuma Date: Fri, 28 Feb 2025 10:19:59 +0100 Subject: [PATCH 1/4] PyWrapWheel: docker user We change the docker user so that agent cleanup step doesnt fail on insufficient rights --- .github/workflows/python-wrapper-wheel.yml | 24 +++++++++------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/.github/workflows/python-wrapper-wheel.yml b/.github/workflows/python-wrapper-wheel.yml index 4959a59..b118153 100644 --- a/.github/workflows/python-wrapper-wheel.yml +++ b/.github/workflows/python-wrapper-wheel.yml @@ -28,25 +28,23 @@ jobs: runs-on: [self-hosted, Linux, platform-builder-Rocky-8.6] container: image: eccr.ecmwf.int/wheelmaker/2_28:latest + options: --user github-actions credentials: username: ${{ secrets.ECMWF_DOCKER_REGISTRY_USERNAME }} password: ${{ secrets.ECMWF_DOCKER_REGISTRY_ACCESS_TOKEN }} steps: # NOTE we dont use action checkout because it doesnt cleanup after itself correctly - - run: git clone --depth=1 --branch="${GITHUB_REF#refs/heads/}" https://github.com/$GITHUB_REPOSITORY /proj - - run: cd /proj && /buildscripts/prepare_deps.sh ./python_wrapper/buildconfig "${{ matrix.python_version }}" - - run: cd /proj && if [[ -f ./python_wrapper/pre-compile.sh ]] ; then ./python_wrapper/pre-compile.sh ; fi - - run: cd /proj && /buildscripts/compile.sh ./python_wrapper/buildconfig - - run: cd /proj && if [[ -f ./python_wrapper/post-compile.sh ]] ; then ./python_wrapper/post-compile.sh ; fi - - run: cd /proj && GITHUB_BRANCH="${GITHUB_REF}" PYTHONPATH=/buildscripts /buildscripts/wheel-linux.sh ./python_wrapper/buildconfig "${{ matrix.python_version }}" - - run: cd /proj && if [[ -f ./python_wrapper/post-build.sh ]] ; then ./python_wrapper/post-build.sh ; fi - - run: cd /proj && /buildscripts/test-wheel.sh ./python_wrapper/buildconfig "${{ matrix.python_version }}" - - run: cd /proj && PYTHONPATH=/buildscripts /buildscripts/upload-pypi.sh ./python_wrapper/buildconfig + - run: git clone --depth=1 --branch="${GITHUB_REF#refs/heads/}" https://github.com/$GITHUB_REPOSITORY /src/proj + - run: cd /src/proj && /buildscripts/prepare_deps.sh ./python_wrapper/buildconfig "${{ matrix.python_version }}" + - run: cd /src/proj && if [[ -f ./python_wrapper/pre-compile.sh ]] ; then ./python_wrapper/pre-compile.sh ; fi + - run: cd /src/proj && /buildscripts/compile.sh ./python_wrapper/buildconfig + - run: cd /src/proj && GITHUB_BRANCH="${GITHUB_REF}" PYTHONPATH=/buildscripts /buildscripts/wheel-linux.sh ./python_wrapper/buildconfig "${{ matrix.python_version }}" + - run: cd /src/proj && if [[ -f ./python_wrapper/post-build.sh ]] ; then ./python_wrapper/post-build.sh ; fi + - run: cd /src/proj && /buildscripts/test-wheel.sh ./python_wrapper/buildconfig "${{ matrix.python_version }}" + - run: cd /src/proj && PYTHONPATH=/buildscripts /buildscripts/upload-pypi.sh ./python_wrapper/buildconfig env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} - # NOTE temporary thing until all the mess gets cleared - - run: rm -rf ./* ./.git ./.github macos-wheel: name: Build macos wheel strategy: @@ -82,7 +80,7 @@ jobs: if [[ -f ./python_wrapper/post-compile.sh ]] ; then ./python_wrapper/post-compile.sh ; fi - run: | cd proj - rm -rf /tmp/buildvenv && uv venv --python python"${{ matrix.python_version }}" /tmp/buildvenv && source /tmp/buildvenv/bin/activate && uv pip install build twine delocate setuptools requests + rm -rf /tmp/buildvenv && uv venv --python python"${{ matrix.python_version }}" /tmp/buildvenv && source /tmp/buildvenv/bin/activate && uv pip install build twine==6.0.1 delocate setuptools requests # NOTE twine version forced due to metadata issue, cf wheelmaker Dockerfile GITHUB_BRANCH="${GITHUB_REF}" PYTHONPATH=$GITHUB_WORKSPACE/ci-utils/wheelmaker/buildscripts $GITHUB_WORKSPACE/ci-utils/wheelmaker/buildscripts/wheel-linux.sh ./python_wrapper/buildconfig "${{ matrix.python_version }}" if [[ -f ./python_wrapper/post-build.sh ]] ; then ./python_wrapper/post-build.sh ; fi $GITHUB_WORKSPACE/ci-utils/wheelmaker/buildscripts/test-wheel.sh ./python_wrapper/buildconfig "${{ matrix.python_version }}" @@ -90,5 +88,3 @@ jobs: env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} - # NOTE temporary thing until all the mess gets cleared - - run: rm -rf ./* ./.git ./.github From e00a4d92401eadbf4bd3aef1ccadc58b7ab19528 Mon Sep 17 00:00:00 2001 From: Vojta Tuma Date: Fri, 28 Feb 2025 16:48:27 +0100 Subject: [PATCH 2/4] PyWrapWheel: fix macos ecbuild path --- .github/workflows/python-wrapper-wheel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-wrapper-wheel.yml b/.github/workflows/python-wrapper-wheel.yml index b118153..baa6395 100644 --- a/.github/workflows/python-wrapper-wheel.yml +++ b/.github/workflows/python-wrapper-wheel.yml @@ -76,7 +76,7 @@ jobs: - run: | cd proj if [[ -f ./python_wrapper/pre-compile.sh ]] ; then ./python_wrapper/pre-compile.sh ; fi - PATH="$PATH:$GITHUB_WORKSPACE/ecbuild/bin/" $GITHUB_WORKSPACE/ci-utils/wheelmaker/buildscripts/compile.sh ./python_wrapper/buildconfig + PATH="$GITHUB_WORKSPACE/ecbuild/bin/:$PATH" $GITHUB_WORKSPACE/ci-utils/wheelmaker/buildscripts/compile.sh ./python_wrapper/buildconfig if [[ -f ./python_wrapper/post-compile.sh ]] ; then ./python_wrapper/post-compile.sh ; fi - run: | cd proj From a558fca3a0658ff7532d0bb59ed286398f42d4f2 Mon Sep 17 00:00:00 2001 From: Vojta Tuma Date: Mon, 3 Mar 2025 12:04:17 +0100 Subject: [PATCH 3/4] PyWrapWheel: fix unbound variable --- .github/workflows/python-wrapper-wheel.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-wrapper-wheel.yml b/.github/workflows/python-wrapper-wheel.yml index baa6395..4ad7f29 100644 --- a/.github/workflows/python-wrapper-wheel.yml +++ b/.github/workflows/python-wrapper-wheel.yml @@ -40,7 +40,7 @@ jobs: - run: cd /src/proj && /buildscripts/compile.sh ./python_wrapper/buildconfig - run: cd /src/proj && GITHUB_BRANCH="${GITHUB_REF}" PYTHONPATH=/buildscripts /buildscripts/wheel-linux.sh ./python_wrapper/buildconfig "${{ matrix.python_version }}" - run: cd /src/proj && if [[ -f ./python_wrapper/post-build.sh ]] ; then ./python_wrapper/post-build.sh ; fi - - run: cd /src/proj && /buildscripts/test-wheel.sh ./python_wrapper/buildconfig "${{ matrix.python_version }}" + - run: cd /src/proj && GITHUB_BRANCH="${GITHUB_REF}" /buildscripts/test-wheel.sh ./python_wrapper/buildconfig "${{ matrix.python_version }}" - run: cd /src/proj && PYTHONPATH=/buildscripts /buildscripts/upload-pypi.sh ./python_wrapper/buildconfig env: TWINE_USERNAME: __token__ @@ -83,7 +83,7 @@ jobs: rm -rf /tmp/buildvenv && uv venv --python python"${{ matrix.python_version }}" /tmp/buildvenv && source /tmp/buildvenv/bin/activate && uv pip install build twine==6.0.1 delocate setuptools requests # NOTE twine version forced due to metadata issue, cf wheelmaker Dockerfile GITHUB_BRANCH="${GITHUB_REF}" PYTHONPATH=$GITHUB_WORKSPACE/ci-utils/wheelmaker/buildscripts $GITHUB_WORKSPACE/ci-utils/wheelmaker/buildscripts/wheel-linux.sh ./python_wrapper/buildconfig "${{ matrix.python_version }}" if [[ -f ./python_wrapper/post-build.sh ]] ; then ./python_wrapper/post-build.sh ; fi - $GITHUB_WORKSPACE/ci-utils/wheelmaker/buildscripts/test-wheel.sh ./python_wrapper/buildconfig "${{ matrix.python_version }}" + GITHUB_BRANCH="${GITHUB_REF}" $GITHUB_WORKSPACE/ci-utils/wheelmaker/buildscripts/test-wheel.sh ./python_wrapper/buildconfig "${{ matrix.python_version }}" PYTHONPATH=$GITHUB_WORKSPACE/ci-utils/wheelmaker/buildscripts $GITHUB_WORKSPACE/ci-utils/wheelmaker/buildscripts/upload-pypi.sh ./python_wrapper/buildconfig env: TWINE_USERNAME: __token__ From 659aed7ea911f5ce741acb2fd06a5961bfa6e88f Mon Sep 17 00:00:00 2001 From: Vojta Tuma Date: Mon, 3 Mar 2025 12:30:39 +0100 Subject: [PATCH 4/4] PyWrapWheel: fix missing post compile --- .github/workflows/python-wrapper-wheel.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/python-wrapper-wheel.yml b/.github/workflows/python-wrapper-wheel.yml index 4ad7f29..31bf331 100644 --- a/.github/workflows/python-wrapper-wheel.yml +++ b/.github/workflows/python-wrapper-wheel.yml @@ -38,6 +38,7 @@ jobs: - run: cd /src/proj && /buildscripts/prepare_deps.sh ./python_wrapper/buildconfig "${{ matrix.python_version }}" - run: cd /src/proj && if [[ -f ./python_wrapper/pre-compile.sh ]] ; then ./python_wrapper/pre-compile.sh ; fi - run: cd /src/proj && /buildscripts/compile.sh ./python_wrapper/buildconfig + - run: cd /src/proj && if [[ -f ./python_wrapper/post-compile.sh ]] ; then ./python_wrapper/post-compile.sh ; fi - run: cd /src/proj && GITHUB_BRANCH="${GITHUB_REF}" PYTHONPATH=/buildscripts /buildscripts/wheel-linux.sh ./python_wrapper/buildconfig "${{ matrix.python_version }}" - run: cd /src/proj && if [[ -f ./python_wrapper/post-build.sh ]] ; then ./python_wrapper/post-build.sh ; fi - run: cd /src/proj && GITHUB_BRANCH="${GITHUB_REF}" /buildscripts/test-wheel.sh ./python_wrapper/buildconfig "${{ matrix.python_version }}"