Skip to content

Commit

Permalink
fix: installation of padddle on Windows, syntax error in entrypoint.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
0x3878f committed Jan 17, 2025
1 parent f79e69c commit 7d7fce6
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 39 deletions.
44 changes: 9 additions & 35 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,50 +15,24 @@ jobs:
strategy:
matrix:
python-version: [ '3.8']
architecture: [ 'x64' ]

architecture: [ 'x86_64']
steps:
# Checkout the latest branch of Paddle2ONNX.
- name: Checkout Paddle2ONNX
uses: actions/checkout@v4
with:
submodules: true

# Setup Python
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
- name: Build on manylinux_2_28_x86_64
uses: docker://quay.io/pypa/manylinux_2_28_x86_64:latest
with:
python-version: ${{ matrix.python-version }}
entrypoint: bash
args: .github/workflows/scripts/entrypoint.sh ${{ matrix.python-version }}

# Clone protobuf repository and checkout to v21.12
- name: Clone protobuf
run: |
git clone https://github.com/protocolbuffers/protobuf.git
cd protobuf
git checkout v21.12
# Build and install protobuf
- name: Build and install protobuf
run: |
cd protobuf
git submodule update --init --recursive
mkdir build
cd build
cmake ../cmake -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/installed_protobuf -Dprotobuf_BUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=14
cmake --build . --target install
# Install Python dependencies
- name: Install Python dependencies
run: |
python -m pip install -q --upgrade pip
python -m pip install setuptools wheel build
# Build package
- name: Build package
run: |
export PATH="${{ github.workspace }}/installed_protobuf/bin:$PATH"
export PIP_EXTRA_INDEX_URL="https://www.paddlepaddle.org.cn/packages/nightly/cpu/"
python -m build --wheel
- name: Setup Python 3.8
uses: actions/setup-python@v5
with:
python-version: '3.8'

# Install Paddle2ONNX
- name: Install Paddle2ONNX
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release_linux_aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
# setting up qemu for enabling aarch64 binary execution on x86 machine
- uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0

- name: Build on manylinux2014_aarch64
- name: Build on manylinux_2_28_aarch64
uses: docker://quay.io/pypa/manylinux_2_28_aarch64
with:
entrypoint: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release_linux_x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
with:
submodules: true

- name: Build on manylinux2014_x86_64
- name: Build on manylinux_2_28_x86_64
uses: docker://quay.io/pypa/manylinux_2_28_x86_64:latest
with:
entrypoint: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ $PYTHON_COMMAND -m build --wheel || { echo "Building wheels failed."; exit 1; }
# find -exec does not preserve failed exit codes, so use an output file for failures
failed_wheels=$PWD/failed-wheels
rm -f "$failed_wheels"
find . -type f -iname "*-linux*.whl" -exec sh -c "auditwheel repair '{}' -w \$(dirname '{}') --exclude libpaddle.so' || { echo 'Repairing wheels failed.'; auditwheel show '{}' >> '$failed_wheels'; }" \;
find . -type f -iname "*-linux*.whl" -exec sh -c "auditwheel repair '{}' -w \$(dirname '{}') --exclude libpaddle.so || { echo 'Repairing wheels failed.'; auditwheel show '{}' >> '$failed_wheels'; }" \;

if [[ -f "$failed_wheels" ]]; then
echo "Repairing wheels failed:"
Expand Down
2 changes: 1 addition & 1 deletion tests/run.bat
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ set PY_CMD=%1
%PY_CMD% -m pip install onnx onnxruntime tqdm filelock
%PY_CMD% -m pip install six hypothesis
REM %PY_CMD% -m pip install --pre paddlepaddle -i https://www.paddlepaddle.org.cn/packages/nightly/cpu/
%PY_CMD% -m pip install https://paddle2onnx.bj.bcebos.com/paddle_windows/paddlepaddle_gpu-0.0.0-cp310-cp310-win_amd64.wh
%PY_CMD% -m pip install https://paddle2onnx.bj.bcebos.com/paddle_windows/paddlepaddle_gpu-0.0.0-cp310-cp310-win_amd64.whl

REM Enable development mode and run tests
set ENABLE_DEV=ON
Expand Down

0 comments on commit 7d7fce6

Please sign in to comment.