Skip to content
Open
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
54 changes: 41 additions & 13 deletions .github/workflows/build-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
description: 'Pypi version'
release_version:
description: 'Version of flux to build'
default: "0.68.0"
default: "0.88.0"
rc:
description: 'Release candidate to build (for wheel)'
default: "0"
Expand All @@ -18,18 +18,37 @@ on:
repo:
description: 'Repository to build from'
default: "https://github.com/flux-framework/flux-core"
glibc:
description: 'Oldest glibc to support, as a manylinux tag version'
default: "2_17"

jobs:
build-manual:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
include:
# Maybe time to stop supporting...
- python: "3.8"
base: jammy
- python: "3.9"
base: jammy
- python: "3.10"
base: jammy
- python: "3.11"
base: jammy
- python: "3.12"
base: jammy
- python: "3.13"
base: jammy
# Update to noble for 3.14
- python: "3.14"
base: noble
container:
image: fluxrm/testenv:jammy
image: fluxrm/testenv:${{ matrix.base }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- name: Setup Python
env:
python_version: ${{ matrix.python }}
Expand All @@ -38,8 +57,8 @@ jobs:

- name: Build Flux Core Branch
env:
FLUX_RELEASE_VERSION: ${{ inputs.release_version }}
FLUX_VERSION: ${{ inputs.version }}
FLUX_RELEASE_VERSION: ${{ inputs.release_version || '0.88.0' }}
FLUX_VERSION: ${{ inputs.version || inputs.release_version || '0.88.0' }}
run: /bin/bash .github/scripts/setup.sh

- name: Build Python Bindings
Expand All @@ -56,7 +75,7 @@ jobs:
if [[ "${FLUX_BRANCH}" == "" ]]; then
FLUX_BRANCH="master"
fi
git clone -b ${FLUX_BRANCH} ${FLUX_REPO} /tmp/flux-core
git clone -b ${FLUX_BRANCH} ${FLUX_REPO} /tmp/flux-core
mv /tmp/flux-core/src/bindings/python/flux ./flux
/opt/conda/envs/build/bin/python3 setup.py sdist
sudo ldconfig
Expand All @@ -65,23 +84,33 @@ jobs:
env:
build_number: ${{ inputs.rc }}
python_version: ${{ matrix.python }}
MANYLINUX_GLIBC: ${{ inputs.glibc || '2_17' }}
run: |
/bin/bash ./docker/build-wheels.sh ${build_number} ${python_version}
ls ./dist

- name: Upload distributions
- name: Test Install
shell: bash
run: |
PIP_INSTALL="/opt/conda/envs/build/bin/python3 -m pip install"
${PIP_INSTALL} ./dist/*.whl || ${PIP_INSTALL} ./dist/*.whl --break-system-packages
cd /tmp
/opt/conda/envs/build/bin/python3 -c "import flux, _flux._core, _flux._hostlist, _flux._idset; print(flux.__file__)"

- name: Upload Artifacts
if: success()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.python }}
path: ./dist

upload:
runs-on: ubuntu-latest
needs: [build-manual]
needs: [build]
if: (github.event_name == 'workflow_dispatch')
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8
# If name unspecified, all artifacts download for run

- name: Show Files
Expand All @@ -97,7 +126,6 @@ jobs:
ls ./dist

- name: Build and publish
if: (github.event_name != 'pull_request')
env:
TWINE_USERNAME: ${{ secrets.PYPI_USER }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASS }}
Expand Down
29 changes: 0 additions & 29 deletions .github/workflows/test-build.yaml

This file was deleted.

4 changes: 3 additions & 1 deletion docker/build-wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
here=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
build_number=${1:-0}
version=${2:-3.11}
glibc=${MANYLINUX_GLIBC:-2_17}

# This is intended to run in the container
echo "Building Python version ${version}"
Expand All @@ -14,5 +15,6 @@ export PYTHONPATH=/opt/conda/envs/build/lib/python${version}/site-packages

# Build the bindings for this python version!
/opt/conda/envs/build/bin/python3 setup.py sdist
/opt/conda/envs/build/bin/python3 setup.py bdist_wheel --plat-name=any --build-number=${build_number}
arch=$(/opt/conda/envs/build/bin/python3 -c 'import sysconfig; print(sysconfig.get_platform().replace("-", "_").replace(".", "_").split("linux_", 1)[1])')
/opt/conda/envs/build/bin/python3 setup.py bdist_wheel --plat-name=manylinux_${glibc}_${arch} --build-number=${build_number}
unset PYTHONPATH
6 changes: 3 additions & 3 deletions docker/install-mamba.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ PYTHON_VERSION=${1:-3.11}
sudo apt-get update && sudo apt-get install -y curl

# Install mamba for different python versions
# Python - instead of a system python we install mamba
curl -L https://github.com/conda-forge/miniforge/releases/download/24.3.0-0/Mambaforge-24.3.0-0-Linux-x86_64.sh > mambaforge.sh

# Does not build 3.8
Expand All @@ -18,6 +17,7 @@ sudo /opt/conda/bin/mamba activate build

# This is intended to run in the container
echo "Building Python version ${version}"
/opt/conda/envs/build/bin/python3 -m pip install cffi ply six pyyaml jsonschema
PIP_INSTALL="/opt/conda/envs/build/bin/python3 -m pip install"
${PIP_INSTALL} cffi ply six pyyaml jsonschema || ${PIP_INSTALL} cffi ply six pyyaml jsonschema --break-system-packages
sudo chown -R $(id -u) /opt/conda
/opt/conda/envs/build/bin/python3 -m pip install --upgrade pkginfo
${PIP_INSTALL} --upgrade pkginfo || ${PIP_INSTALL} --upgrade pkginfo --break-system-packages