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
77 changes: 55 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: build
on:
release:
types: [published]
release: {types: [published]}
push:
branches: [master]
tags: ['**']
Expand All @@ -13,8 +12,7 @@ jobs:
runs-on: [self-hosted, python, cuda]
strategy:
matrix:
python-version: [3.11]
numpy-version: [1.25]
python-version: [3.12] # penultimate supported
steps:
- uses: actions/checkout@v4
with: {fetch-depth: 0, submodules: recursive}
Expand All @@ -33,13 +31,13 @@ jobs:
run: |
conda activate "${{ steps.reqs.outputs.envname }}"
which cmake || conda install -yq cmake
cmake -S . -B ./build_proj -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_MATLAB_WRAPPER=OFF -DBUILD_PYTHON_WRAPPER=ON -DBUILD_CUDA=ON -DCMAKE_INSTALL_PREFIX=./install
cmake -S . -B ./build_proj -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_PYTHON_WRAPPER=ON -DBUILD_CUDA=ON -DCMAKE_INSTALL_PREFIX=./install
cmake --build ./build_proj --target install
pip install ./src/Python
- name: test
run: |
conda activate "${{ steps.reqs.outputs.envname }}"
PYTHONPATH=./src/Python python -m unittest discover ./test
PYTHONPATH=./src/Python python -m unittest discover -v -s ./test
- if: always()
name: Post Run conda-incubator/setup-miniconda@v3
shell: bash
Expand All @@ -52,51 +50,86 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.10', 3.11]
numpy-version: [1.23, 1.26]
python-version: ['3.10', 3.13] # min & max supported
os: [ubuntu-latest, windows-latest]
include:
- python-version: 3.12 # needs numpy>=1.26
numpy-version: 1.26
os: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: {fetch-depth: 0, submodules: recursive}
- uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python-version }}
conda-remove-defaults: "true"
- name: build
run: |
cmake -S . -B ./build_proj -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_MATLAB_WRAPPER=OFF -DBUILD_PYTHON_WRAPPER=ON -DBUILD_CUDA=OFF -DCMAKE_INSTALL_PREFIX=./install
cmake -S . -B ./build_proj -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_PYTHON_WRAPPER=ON -DBUILD_CUDA=OFF -DCMAKE_INSTALL_PREFIX=./install
cmake --build ./build_proj --target install
pip install ./src/Python
- name: test
run: PYTHONPATH=./src/Python python -m unittest discover ./test
run: PYTHONPATH=./src/Python python -m unittest discover -v -s ./test
conda:
defaults: {run: {shell: 'bash -el {0}'}}
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
python-version: [3.11] # penultimate supported
numpy-version: [1.25]
python-version: ['3.10', 3.11, 3.12] # parallelise conda_build_config.yaml
os: [ubuntu, windows]
include:
- {python-version: 3.13, os: ubuntu}
steps:
- uses: actions/checkout@v4
with: {fetch-depth: 0, submodules: recursive}
- if: matrix.os == 'windows'
uses: ilammy/msvc-dev-cmd@v1
- uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python-version }}
mamba-version: "*"
channels: conda-forge
conda-remove-defaults: "true"
- name: conda build & test
working-directory: recipe
run: |
conda install boa
conda mambabuild . -c conda-forge -c ccpi --python=${{ matrix.python-version }} --numpy=${{ matrix.numpy-version }} --output-folder .
if test ${{ matrix.python-version }} = 3.13; then
BUILD_DEP=conda-build
BUILD_CMD="conda build"
else
BUILD_DEP=boa
BUILD_CMD="conda mambabuild -c conda-forge -c ccpi --python=${{ matrix.python-version }} --output-folder dist"
fi
conda install conda-verify $BUILD_DEP
$BUILD_CMD --no-test recipe
$BUILD_CMD --test dist/*/ccpi-regulariser-*-cpu_h*.tar.bz2
- name: Upload artifact of the conda package
uses: actions/upload-artifact@v4
with:
name: ccpi-regulariser-package
path: recipe/linux-64/ccpi-regulariser*
name: ccpi-regulariser_py${{ matrix.python-version }}-${{ matrix.os }}
path: dist/*/ccpi-regulariser-*.tar.bz2
conda-upload:
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags')
defaults: {run: {shell: 'bash -el {0}', working-directory: dist}}
runs-on: ubuntu-latest
needs: [test-cuda, test, conda]
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
mamba-version: "*"
channels: conda-forge
conda-remove-defaults: "true"
- uses: actions/download-artifact@v4
with: {pattern: ccpi-regulariser_py*-*, path: dist, merge-multiple: true}
- run: conda install anaconda-client
- name: anaconda upload -c ccpi
run: >
anaconda -v -t ${{ secrets.CCPI_CONDA_TOKEN }} upload --force
--label ${{ startsWith(github.ref, 'refs/tags') && 'main' || 'dev' }} */ccpi-regulariser-*.tar.bz2
- if: startsWith(github.ref, 'refs/tags')
name: conda upload -c tomography.stfc.ac.uk/conda
run: |
echo '${{ secrets.STFC_SSH_KEY }}' > ./key
chmod 600 ./key
rsync -e 'ssh -o StrictHostKeyChecking=no -i ./key' -R */cil-*.tar.bz2 '${{ secrets.STFC_SSH_HOST }}:${{ secrets.STFC_SSH_CONDA_DIR }}'
ssh -o StrictHostKeyChecking=no -i ./key ${{ secrets.STFC_SSH_HOST }} \
'bash -lic "conda index --bz2 --zst --run-exports --channeldata --rss -n ccpi ${{ secrets.STFC_SSH_CONDA_DIR }}"'
pass:
needs: [test-cuda, test, conda]
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/build_proj/
/install/
/dist/
__pycache__/
/src/Python/build/
/src/Python/*.egg*/
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.23...4.1)

project(RGL)
#https://stackoverflow.com/questions/13298504/using-cmake-with-setup-py
Expand Down
154 changes: 0 additions & 154 deletions build/FindAnacondaEnvironment.cmake

This file was deleted.

4 changes: 0 additions & 4 deletions build/build-install.sh

This file was deleted.

2 changes: 0 additions & 2 deletions build/jenkins-build.sh

This file was deleted.

28 changes: 0 additions & 28 deletions build/run.sh

This file was deleted.

10 changes: 5 additions & 5 deletions recipe/bld.bat
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
mkdir "%SRC_DIR%\test"
ROBOCOPY /E "%RECIPE_DIR%\..\test" "%SRC_DIR%\test"
if exist "%RECIPE_DIR%\..\build_proj" (
rd /s /q "%RECIPE_DIR%\..\build_proj"
if exist "%SRC_DIR%\build_proj" (
rd /s /q "%SRC_DIR%\build_proj"
)

:: -G "Visual Studio 16 2019" specifies the the generator
:: -T v142 specifies the toolset
:: -DCUDA_TOOLKIT_ROOT_DIR="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8" to the cmake command to specify the CUDA toolkit version

cmake -S "%SRC_DIR%" -B "%RECIPE_DIR%\..\build_proj" -G "Visual Studio 16 2019" -T "v142" -DCUDA_TOOLKIT_ROOT_DIR="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8" -DBUILD_PYTHON_WRAPPERS=ON -DCONDA_BUILD=ON -DBUILD_CUDA=ON -DCMAKE_BUILD_TYPE="RelWithDebInfo" -DLIBRARY_INC="%CONDA_PREFIX%" -DCMAKE_INSTALL_PREFIX="%RECIPE_DIR%\..\install"
cmake --build "%RECIPE_DIR%\..\build_proj" --target install --config RelWithDebInfo
%PYTHON% -m pip install "%SRC_DIR%\src\Python"
cmake -S "%SRC_DIR%" -B "%SRC_DIR%\build_proj" -G Ninja -DBUILD_PYTHON_WRAPPERS=ON -DBUILD_CUDA=%BUILD_CUDA% -DCMAKE_BUILD_TYPE="RelWithDebInfo" -DCMAKE_INSTALL_PREFIX="%SRC_DIR%\install" %CMAKE_ARGS%
cmake --build "%SRC_DIR%\build_proj" --target install --config RelWithDebInfo
%PYTHON% -m pip install -vv "%SRC_DIR%\src\Python"

if errorlevel 1 exit 1
9 changes: 6 additions & 3 deletions recipe/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
set -xe
cp -rv "$RECIPE_DIR/../test" "$SRC_DIR/"
if test -d "$SRC_DIR/build_proj"; then
rm -rf "$SRC_DIR/build_proj"
fi

cmake -S "$SRC_DIR" -B "$RECIPE_DIR/../build_proj" -DBUILD_PYTHON_WRAPPER=ON -DCONDA_BUILD=ON -DBUILD_CUDA=ON -DCMAKE_BUILD_TYPE="RelWithDebInfo" -DLIBRARY_INC=$CONDA_PREFIX -DCMAKE_INSTALL_PREFIX="$RECIPE_DIR/../install"
cmake --build "$RECIPE_DIR/../build_proj" --target install
$PYTHON -m pip install "$SRC_DIR/src/Python"
cmake -S "$SRC_DIR" -B "$SRC_DIR/build_proj" -G Ninja -DBUILD_PYTHON_WRAPPER=ON -DBUILD_CUDA=${BUILD_CUDA:-OFF} -DCMAKE_BUILD_TYPE="RelWithDebInfo" -DCMAKE_INSTALL_PREFIX="$SRC_DIR/install" ${CMAKE_ARGS}
cmake --build "$SRC_DIR/build_proj" --target install
$PYTHON -m pip install -vv "$SRC_DIR/src/Python"
Loading
Loading