From acf11f39a621fe6d4fc77e3ca564f3702b049ec4 Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Tue, 26 Mar 2024 17:23:51 +0000 Subject: [PATCH 1/2] CI: add self-hosted CUDA runners --- .github/workflows/build.yml | 39 ++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a0463dc..6c7fa7f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,6 +8,43 @@ on: pull_request: branches: [master] jobs: + test-cuda: + defaults: {run: {shell: 'bash -el {0}'}} + runs-on: [self-hosted, python, cuda] + strategy: + matrix: + python-version: [3.9] + numpy-version: [1.22] + steps: + - uses: actions/checkout@v4 + with: {fetch-depth: 0, submodules: recursive} + - id: reqs + name: set requirements + run: | + envname="${GITHUB_REPOSITORY##*/}-${GITHUB_RUN_ID}.${GITHUB_RUN_NUMBER}" + echo "envname=$envname" >> $GITHUB_OUTPUT + - uses: conda-incubator/setup-miniconda@v3 + with: + python-version: ${{ matrix.python-version }} + activate-environment: ${{ steps.reqs.outputs.envname }} + run-post: false + - id: build + name: build + run: | + conda activate "${{ steps.reqs.outputs.envname }}" + 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 --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 + - if: always() + name: Post Run conda-incubator/setup-miniconda@v3 + run: | + conda deactivate + sed -i '/${{ steps.reqs.outputs.envname }}/d' ~/.profile + conda env remove -n "${{ steps.reqs.outputs.envname }}" test: defaults: {run: {shell: 'bash -el {0}'}} runs-on: ubuntu-latest @@ -57,6 +94,6 @@ jobs: name: ccpi-regulariser-package path: recipe/linux-64/ccpi-regulariser* pass: - needs: [test, conda] + needs: [test-cuda, test, conda] runs-on: ubuntu-latest steps: [{run: echo success}] From 620c9b8c909cb0e135f46e65b8707420cbe393cf Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Thu, 28 Mar 2024 14:13:45 +0000 Subject: [PATCH 2/2] install cmake --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6c7fa7f..dcb7bfa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,6 +32,7 @@ jobs: name: build 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 --build ./build_proj --target install pip install ./src/Python