Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the create-linux-wheels #51

Merged
merged 1 commit into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 18 additions & 8 deletions .github/workflows/create-linux-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,17 @@ jobs:
if: github.repository == 'PelionIoT/manifest-tool'
steps:
- uses: actions/checkout@v4
- run: ./build_manylinux_wheels.sh

- name: Build wheels
run: ./build_manylinux_wheels.sh

- name: Upload manylinux wheels
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-manylinux
path: dist/*.*
if-no-files-found: error

create-tar-gz:
runs-on: ubuntu-22.04
if: github.repository == 'PelionIoT/manifest-tool'
Expand All @@ -33,24 +38,29 @@ jobs:
- run: pip install build
- run: python -m build
- name: Upload .tar.gz -file
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-tar-gz
path: dist/*.tar.gz
if-no-files-found: error
# From internal - do not upload, just build to make sure
# all is OK.
create-wheels-for-manylinux-internal:
runs-on: ubuntu-22.04
if: github.repository == 'PelionIoT/manifest-tool-internal'
steps:
- uses: actions/checkout@v4
- run: ./build_manylinux_wheels.sh

- name: Build wheels
run: ./build_manylinux_wheels.sh

- name: Integration with slack
uses: act10ns/slack@v2
with:
status: ${{ job.status }}
channel: '#testing_device'
if: always()
channel: '#testing_build'
if: failure()

create-tar-gz-int:
runs-on: ubuntu-22.04
if: github.repository == 'PelionIoT/manifest-tool-internal'
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/pr-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ jobs:
if: github.repository == 'PelionIoT/manifest-tool'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.9'
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.8'
- run: python -m pip install wheel --user
Expand All @@ -54,16 +54,16 @@ jobs:
if: github.repository == 'PelionIoT/manifest-tool-internal'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.9'
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.8'
- run: python -m pip install wheel --user
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/static-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
sudo apt-get install black pycodestyle pydocstyle shellcheck python3
black --version
rm -rf install-misspell.sh # cause some findings
scripts-internal/pysh-check/pysh-check.sh --workdir .
scripts-internal/pysh-check/pysh-check.sh --workdir . | tee pysh-check.log

- name: Archive production artifacts
if: always()
Expand Down
6 changes: 2 additions & 4 deletions build_manylinux_wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ mkdir -p dist
rm -rf dist/*

# https://github.com/pypa/manylinux
PLAT="manylinux1_x86_64" && docker run --rm -e PLAT="$PLAT" -v "$(pwd)":/io quay.io/pypa/"$PLAT" /io/build_manylinux_wheels_entry_point.sh |& tee "$PLAT.log" &

PLAT="manylinux2010_x86_64" && docker run --rm -e PLAT="$PLAT" -v "$(pwd)":/io quay.io/pypa/"$PLAT" /io/build_manylinux_wheels_entry_point.sh |& tee "$PLAT.log" &

PLAT="manylinux2014_x86_64" && docker run --rm -e PLAT="$PLAT" -v "$(pwd)":/io quay.io/pypa/"$PLAT" /io/build_manylinux_wheels_entry_point.sh |& tee "$PLAT.log" &

# EoL 1st Jan, 2023
Expand All @@ -37,6 +33,8 @@ docker run --rm --privileged tonistiigi/binfmt:latest --install all &

PLAT="manylinux2014_aarch64" && docker run --rm -e PLAT="$PLAT" -v "$(pwd)":/io quay.io/pypa/"$PLAT" /io/build_manylinux_wheels_entry_point.sh |& tee "$PLAT.log" &

PLAT="musllinux_1_2_x86_64" && docker run --rm -e PLAT="$PLAT" -v "$(pwd)":/io quay.io/pypa/"$PLAT" /io/build_manylinux_wheels_entry_point.sh |& tee "$PLAT.log" &

wait

sudo chown -R "$USER":"$USER" dist/
13 changes: 12 additions & 1 deletion build_manylinux_wheels_entry_point.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
# ----------------------------------------------------------------------------
# Copyright 2020-2023 Izuma Networks
# Copyright 2020-2024 Izuma Networks
#
# SPDX-License-Identifier: Apache-2.0
#
Expand All @@ -23,6 +23,7 @@ mkdir /work
cd /work

# Clone from shared dir
git config --global --add safe.directory /io/.git
git clone /io manifest-tool
cd manifest-tool

Expand Down Expand Up @@ -78,6 +79,15 @@ for PYBIN in /opt/python/cp3*/bin; do
"${PYBIN}/pip" wheel . --no-deps -w wheelhouse/"$PLAT"
done

# Turns out we need rust to build the wheels nowaydays
# Check if cargo is available
if command -v cargo; then
echo "Cargo is available => we assume rust is available."
else
echo "Cargo is not available - install rust with rustup"
curl -sSf https://sh.rustup.rs | sh -s -- -y
fi

# Bundle external shared libraries into the wheels
for whl in wheelhouse/"$PLAT"/*-linux_x86_64.whl; do
repair_wheel "$whl"
Expand All @@ -100,6 +110,7 @@ for PYBIN in /opt/python/cp3*/bin; do
echo '------------------------------------------------------------'
echo "${PYBIN}"
echo '------------------------------------------------------------'
"${PYBIN}/python" -m pip install --upgrade pip
"${PYBIN}/pip" install --prefer-binary -r requirements.txt
"${PYBIN}/pip" install manifest-tool --no-index -f wheelhouse/
"${PYBIN}/manifest-tool" --version
Expand Down
4 changes: 3 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
## 2.6.2
- Copyright in `update_default_resoruces.c` created with Izuma Networks and current year.
- Updated `cryptography` to version `43.0.1`.
- Updated `requests` to version `2.32.0`.
- Updated `requests` to version `2.32.2`.
- Drop `manylinux_1` and `manylinux_2010`, add `musllinux_1_2` as `manylinux` platforms.
- Add updating of pip in wheels building with manylinux.

## 2.6.1
- Drop support for Python 3.7.
Expand Down
4 changes: 2 additions & 2 deletions dev-README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ the release creation time.
1. Create a PR with the changes to master. Merge it after successful PR checks and approval.
1. Check that the `PR-checker` workflow passes on the master branch. It runs all the tox tests on all the OSes.
1. Check that the `create-Linux-wheels` workflow passes on the master branch. It builds the Linux wheels and uploads them as an artifact.
1. Download the `wheels.zip` artifact to your local machine from the `create-Linux-wheels` workflow.
1. Extract the `wheels.zip` to a folder - <dist-folder>
1. Download the `wheels-manylinux.zip` and `wheels-tar-gz.zip `artifacts to your local machine from the `create-Linux-wheels` workflow.
1. Extract both zip files to a `<dist-folder>` folder.
1. Install `twine`: `pip install twine`.
1. Publish to https://test.pypi.org and check:
```
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ asn1ate>=0.5,<=0.6.0
cryptography==43.0.1
jsonschema>=2.6.0,<=3.2.0
pyasn1>=0.3.1,<=0.4.8
requests==2.32
requests==2.32.3
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ----------------------------------------------------------------------------
# Copyright 2019-2021 Pelion
# Copyright (c) 2022-2023 Izuma Networks
# Copyright (c) 2022-2024 Izuma Networks
#
# SPDX-License-Identifier: Apache-2.0
#
Expand Down
1 change: 1 addition & 0 deletions tests/dev_tool/test_dev_init.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# ----------------------------------------------------------------------------
# Copyright 2019-2021 Pelion
# Copyright 2022-2024 Izuma Networks
#
# SPDX-License-Identifier: Apache-2.0
#
Expand Down
Loading