Skip to content

Commit

Permalink
Updates github actions for release pipeline (#1639)
Browse files Browse the repository at this point in the history
* Updates github action configs

* Update conda release scripts

* Fix conda build recipe and release pipeline

* Update conda recipe

* Missing conda build config file
  • Loading branch information
sunqm committed Mar 20, 2023
1 parent 9e0b87b commit 95b15d9
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 40 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-20.04]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install and Test
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
yum install -y epel-release && \
yum-config-manager --enable epel && \
yum install -y openblas-devel gcc cmake curl && \
cd ./pyscf/lib && curl -o deps.tar.gz -L "https://github.com/pyscf/pyscf-build-deps/blob/master/pyscf-2.2a-aarch64-deps.tar.gz?raw=true" && \
cd ./pyscf/lib && curl -o deps.tar.gz -L "https://github.com/pyscf/pyscf-build-deps/blob/master/pyscf-2.2-aarch64-deps.tar.gz?raw=true" && \
tar xzf deps.tar.gz && \
mkdir build && cd build && \
cmake -DBUILD_LIBXC=OFF -DBUILD_XCFUN=OFF -DBUILD_LIBCINT=OFF .. && \
Expand All @@ -80,9 +80,9 @@ jobs:
matrix:
python-version: ["3.7"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install and Test
Expand Down
43 changes: 18 additions & 25 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
release-pypi-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Build wheels
uses: docker://pyscf/pyscf-pypa-env:latest
with:
Expand All @@ -37,16 +37,16 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
pyver: [cp36-cp36m, cp37-cp37m, cp38-cp38, cp39-cp39, cp310-cp310]
pyver: [cp36-cp36m, cp37-cp37m, cp38-cp38, cp39-cp39, cp310-cp310, cp311-cp311]
fail-fast: false
env:
img: quay.io/pypa/manylinux2014_aarch64
img: quay.io/pypa/manylinux2014_aarch64:2023-03-12-25fd859
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2
- name: Build Wheel
run: |
docker run --rm -v ${{ github.workspace }}:/src/pyscf:rw --workdir=/src/pyscf \
Expand All @@ -59,7 +59,7 @@ jobs:
export dst=${GITHUB_WORKSPACE:-/src/pyscf}/linux-wheels && \
export CMAKE_CONFIGURE_ARGS="-DWITH_F12=OFF" && \
mkdir -p /root/wheelhouse $src/linux-wheels && \
sed -i "/ if basename(fn) not in needed_libs:/s/basename.*libs/1/" /opt/_internal/pipx/venvs/auditwheel/lib/python3.9/site-packages/auditwheel/wheel_abi.py && \
sed -i "/ if basename(fn) not in needed_libs:/s/basename.*libs/1/" /opt/_internal/pipx/venvs/auditwheel/lib/python*/site-packages/auditwheel/wheel_abi.py && \
/opt/python/${{ matrix.pyver }}/bin/pip wheel -v --no-deps --no-clean -w /root/wheelhouse $src && \
export whl=`ls /root/wheelhouse/pyscf-*-linux_*.whl` && \
auditwheel -v repair "$whl" --lib-sdir /lib -w $dst'
Expand All @@ -80,7 +80,7 @@ jobs:
release-pypi-sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Build sdist
run: |
python3 setup.py sdist
Expand All @@ -103,11 +103,11 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Build wheels
Expand All @@ -128,26 +128,22 @@ jobs:
release-conda-linux:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup conda
uses: s-weigand/setup-conda@v1
with:
update-conda: true
python-version: ${{ matrix.python-version }}
conda-channels: anaconda, conda-forge
- run: conda --version
- run: which python
- name: Publish to conda
run: |
$CONDA/bin/conda install -y anaconda-client conda-build
$CONDA/bin/conda build --output-folder . conda
export ANACONDA_API_TOKEN=${{ secrets.ANACONDA_TOKEN }}
$CONDA/bin/conda config --set anaconda_upload yes
$CONDA/bin/anaconda upload linux-64/*.tar.bz2
conda install -y anaconda-client conda-build
conda config --set anaconda_upload yes
conda build --output-folder . conda
# Disable macos conda release for Error during compling:
# MACOSX_DEPLOYMENT_TARGET mismatch: now "10.9" but "10.15" during configure
Expand All @@ -158,9 +154,9 @@ jobs:
# python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
# fail-fast: false
# steps:
# - uses: actions/checkout@v2
# - uses: actions/checkout@v3
# - name: Setup conda
# uses: actions/setup-python@v2
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}
# - name: Publish to conda
Expand All @@ -172,14 +168,11 @@ jobs:
# $CONDA/bin/anaconda upload linux-64/*.tar.bz2

release-docker:
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
needs: release-pypi-linux
strategy:
matrix:
os: [ubuntu-18.04]
steps:
- name: Login to Docker Hub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: pyscf
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down
7 changes: 7 additions & 0 deletions conda/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
python:
- 3.6
- 3.7
- 3.8
- 3.9
- 3.10
- 3.11
11 changes: 6 additions & 5 deletions conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,24 @@ build:

requirements:
build:
- python {{ python }}
- cmake
- make
- mkl
- {{ compiler('c') }}
- {{ compiler('cxx') }}
host:
- python
run:
- python
- mkl
- numpy>=1.13
- scipy!=1.5
- h5py>=2.7

test:
commands:
- test -f ${PREFIX}/lib/python*/site-packages/pyscf/lib/libcvhf.so
# python version in testing environment is often changed to a different
# version than the building
# - python -c "import pyscf.lib"
imports:
- pyscf.lib

about:
home: "{{ data['url'] }}"
Expand Down
1 change: 0 additions & 1 deletion docker/pypa-env/Dockerfile

This file was deleted.

26 changes: 26 additions & 0 deletions docker/pypa-env/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#FROM quay.io/pypa/manylinux2014_x86_64:latest
#RUN yum install -y openblas-devel.x86_64
#
FROM quay.io/pypa/manylinux2010_x86_64:2022-08-05-4535177

# libquadmath from devtoolset-8-libquadmath-devel.x86_64 was not built with -fPIC.
# Remove libquadmath-devel and restore the system default libquadmath.so
RUN yum remove -y devtoolset-8-libquadmath-devel.x86_64 && \
yum install -y libquadmath.x86_64 && \
ln -fs libquadmath.so.0 /usr/lib64/libquadmath.so

RUN yum install -y openblas-devel.x86_64 gcc && \
yum clean all && \
rm -rf /var/cache/yum

RUN /opt/_internal/tools/bin/pip3 install --no-cache-dir cmake

COPY build-wheels.sh /build-wheels.sh
CMD ['/build-wheels.sh']

# # openblas in quay.io/pypa/manylinux1_x86_64 has a bug that causes segfault
# # (issue https://github.com/pyscf/pyscf/issues/1095). openblas r0-3.3 fixed
# # the bug
# COPY --from 0 /usr/lib64/libopenblas.so /usr/lib64/libopenblas.so.0
# RUN rm -f libopenblas-r0.2.18.so && \
# ln -fs /usr/lib64/libopenblas.so.0 /usr/lib64/libopenblas.so
6 changes: 3 additions & 3 deletions docker/pypa-env/build-wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ else
fi

# In certain versions of auditwheel, some .so files was excluded.
sed -i '/ if basename(fn) not in needed_libs:/s/basename.*libs/1/' /opt/_internal/pipx/venvs/auditwheel/lib/python3.9/site-packages/auditwheel/wheel_abi.py
sed -i '/ if basename(fn) not in needed_libs:/s/basename.*libs/1/' /opt/_internal/pipx/venvs/auditwheel/lib/python*/site-packages/auditwheel/wheel_abi.py

# Compile wheels
for PYVERSION in cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310; do
for PYVERSION in cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311; do
PYBIN=/opt/python/$PYVERSION/bin
"${PYBIN}/pip" wheel -v --no-deps --no-clean -w /root/wheelhouse $src

# Bundle external shared libraries into the wheels
whl=`ls /root/wheelhouse/pyscf-*-$PYVERSION-linux*_x86_64.whl`
whl=`ls /root/wheelhouse/pyscf-*-$PYVERSION-*linux*_x86_64.whl`
auditwheel -v repair "$whl" --lib-sdir /lib -w $dst
done

0 comments on commit 95b15d9

Please sign in to comment.