-
Notifications
You must be signed in to change notification settings - Fork 70
rattler-build #2321
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
rattler-build #2321
Changes from all commits
9ae8b56
f9f992d
db60f22
83796a7
c5da950
be7811b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,19 +30,22 @@ jobs: | |
| python-version: [3.11] | ||
| numpy-version: [1.25] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/checkout@v6 | ||
| 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 | ||
| sed -ri -e 's/^(name: ).*/\1$envname/' -e '/ python /d' -e 's/(.* numpy) .*/\1=${{ matrix.numpy-version }}/' scripts/cil_development.yml | ||
| - uses: conda-incubator/setup-miniconda@v3 | ||
| - uses: conda-incubator/setup-miniconda@v4 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| environment-file: scripts/cil_development.yml | ||
| use-mamba: true | ||
| mamba-version: "*" | ||
| channels: conda-forge | ||
| activate-environment: ${{ steps.reqs.outputs.envname }} | ||
| environment-file: scripts/cil_development.yml | ||
| run-post: false | ||
| - id: build | ||
| name: build | ||
|
|
@@ -60,35 +63,14 @@ jobs: | |
| sed -i '/${{ steps.reqs.outputs.envname }}/d' ~/.profile | ||
| source ~/.profile | ||
| conda env remove -n "${{ steps.reqs.outputs.envname }}" | ||
| test: | ||
| defaults: {run: {shell: 'bash -el {0}'}} | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| include: | ||
| - {python-version: '3.10', numpy-version: 1.23} | ||
| - {python-version: 3.12, numpy-version: 1.26} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: {fetch-depth: 0, submodules: recursive} | ||
| - name: set requirements | ||
| run: sed -ri -e '/ python /d' -e 's/(.* numpy) .*/\1=${{ matrix.numpy-version }}/' -e 's/cuda*//' -e '/tigre/d' scripts/cil_development.yml | ||
| - uses: conda-incubator/setup-miniconda@v3 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| environment-file: scripts/cil_development.yml | ||
| activate-environment: cil_dev | ||
| - run: pip install . | ||
| - name: test | ||
| run: python -m unittest discover -v ./Wrappers/Python/test | ||
| conda-matrix: | ||
| runs-on: ubuntu-latest | ||
| test-matrix: | ||
| runs-on: ubuntu-slim | ||
| outputs: | ||
| python-version: ${{ steps.matrix.outputs.python-version }} | ||
| numpy-version: ${{ steps.matrix.outputs.numpy-version }} | ||
| os: ${{ steps.matrix.outputs.os }} | ||
| include: ${{ steps.matrix.outputs.include }} | ||
| include-numpy: ${{ steps.matrix.outputs.include-numpy }} | ||
| conda-include: ${{ steps.matrix.outputs.conda-include }} | ||
| steps: | ||
| - id: matrix | ||
| run: | | ||
|
|
@@ -109,113 +91,99 @@ jobs: | |
| fi | ||
| fi | ||
| if $include_max; then | ||
| echo "include=[{'python-version': 3.12, 'os': 'ubuntu'}, {'python-version': 3.12, 'os': 'windows'}]" >> $GITHUB_OUTPUT | ||
| echo "include-numpy=[{'python-version': 3.12, 'numpy-version': 1.26, 'os': 'ubuntu'}, {'python-version': 3.12, 'numpy-version': 1.26, 'os': 'windows'}]" >> $GITHUB_OUTPUT | ||
| echo "include=[{'os': 'ubuntu', 'python-version': 3.12, 'numpy-version': 1.26}, {'os': 'windows', 'python-version': 3.12, 'numpy-version': 1.26}]" >> $GITHUB_OUTPUT | ||
| echo "conda-include=[{'os': 'ubuntu', 'python-version': 3.12}, {'os': 'windows', 'python-version': 3.12}]" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "include=[]" >> $GITHUB_OUTPUT | ||
| echo "include-numpy=[]" >> $GITHUB_OUTPUT | ||
| fi | ||
| conda-build: | ||
| test: | ||
| defaults: {run: {shell: 'bash -el {0}'}} | ||
| runs-on: ${{ matrix.os }}-${{ matrix.os == 'ubuntu' && '24.04' || '2022' }} | ||
| needs: conda-matrix | ||
| needs: test-matrix | ||
| strategy: | ||
| matrix: | ||
| python-version: ${{ fromJson(needs.conda-matrix.outputs.python-version) }} | ||
| os: ${{ fromJson(needs.conda-matrix.outputs.os) }} | ||
| include: ${{ fromJson(needs.conda-matrix.outputs.include) }} | ||
| os: ${{ fromJson(needs.test-matrix.outputs.os) }} | ||
| python-version: ${{ fromJson(needs.test-matrix.outputs.python-version) }} | ||
| numpy-version: ${{ fromJson(needs.test-matrix.outputs.numpy-version) }} | ||
| include: ${{ fromJson(needs.test-matrix.outputs.include) }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| submodules: recursive | ||
| ref: ${{ github.event.pull_request.head.sha || github.ref }} # fix SHA | ||
| - if: matrix.os == 'windows' | ||
| uses: ilammy/msvc-dev-cmd@v1 | ||
| - uses: conda-incubator/setup-miniconda@v3 | ||
| - uses: actions/checkout@v6 | ||
| with: {fetch-depth: 0, submodules: recursive} | ||
| - name: set requirements | ||
| run: sed -ri -e 's/(.* python) .*/\1=${{ matrix.python-version }}/' -e 's/(.* numpy) .*/\1=${{ matrix.numpy-version }}/' -e 's/cuda*/py*/' -e '/tigre/d' scripts/cil_development.yml | ||
| - uses: conda-incubator/setup-miniconda@v4 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| miniforge-version: latest | ||
| use-mamba: true | ||
| mamba-version: "*" | ||
| channels: conda-forge | ||
| conda-remove-defaults: "true" | ||
| - run: conda install conda-build | ||
| - name: conda build | ||
| run: > | ||
| conda build -c conda-forge -c https://software.repos.intel.com/python/conda -c ccpi --override-channels --python=${{ matrix.python-version }} | ||
| --no-test --output-folder dist recipe | ||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: cil-py${{ matrix.python-version }}-${{ matrix.os }} | ||
| path: dist/*/cil-* | ||
| conda-test: | ||
| defaults: {run: {shell: 'bash -el {0}'}} | ||
| activate-environment: cil_dev | ||
| environment-file: scripts/cil_development.yml | ||
| - run: pip install . | ||
| - name: test | ||
| run: python -m unittest discover -v ./Wrappers/Python/test | ||
| conda-build-test: | ||
| runs-on: ${{ matrix.os }}-${{ matrix.os == 'ubuntu' && '24.04' || '2022' }} | ||
| needs: [conda-matrix, conda-build] | ||
| needs: test-matrix | ||
| strategy: | ||
| matrix: | ||
| python-version: ${{ fromJson(needs.conda-matrix.outputs.python-version) }} | ||
| numpy-version: ${{ fromJson(needs.conda-matrix.outputs.numpy-version) }} | ||
| os: ${{ fromJson(needs.conda-matrix.outputs.os) }} | ||
| include: ${{ fromJson(needs.conda-matrix.outputs.include-numpy) }} | ||
| os: ${{ fromJson(needs.test-matrix.outputs.os) }} | ||
| python-version: ${{ fromJson(needs.test-matrix.outputs.python-version) }} | ||
| include: ${{ fromJson(needs.test-matrix.outputs.conda-include) }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: conda-incubator/setup-miniconda@v3 | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| mamba-version: "*" | ||
| channels: conda-forge | ||
| conda-remove-defaults: "true" | ||
| - run: conda install conda-build | ||
| - uses: actions/download-artifact@v4 | ||
| fetch-depth: 0 | ||
| submodules: recursive | ||
| ref: ${{ github.event.pull_request.head.sha || github.ref }} # fix SHA | ||
| - if: matrix.os == 'windows' | ||
| uses: ilammy/msvc-dev-cmd@v1 | ||
| - uses: prefix-dev/rattler-build-action@v0.2.37 | ||
| with: | ||
| name: cil-py${{ matrix.python-version }}-${{ matrix.os }} | ||
| path: dist | ||
| - name: conda test | ||
| run: > | ||
| conda build -c conda-forge -c https://software.repos.intel.com/python/conda -c ccpi --override-channels --python=${{ matrix.python-version }} | ||
| --test dist/*/cil-* --extra-deps numpy=${{ matrix.numpy-version }} | ||
| recipe-path: recipe.yaml | ||
| build-args: --experimental -c conda-forge -c https://software.repos.intel.com/python/conda -c ccpi --variant python=${{ matrix.python-version }} | ||
| artifact-name: conda-py${{ matrix.python-version }}-${{ matrix.os }} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a reason why this is now named 'conda' - it used to be named 'cil'?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it would be better to be consistent with the previous naming: https://anaconda.org/channels/ccpi/packages/cil/files
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The conda file names are unchanged. This is just the GitHub art[ie]fact zip name |
||
| 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: conda-test | ||
| defaults: {run: {working-directory: output}} | ||
| runs-on: ubuntu-slim | ||
| needs: conda-build-test | ||
| 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: cil-py*-*, path: dist, merge-multiple: true} | ||
| - run: mamba install anaconda-client | ||
| - name: anaconda upload -c ccpi | ||
| - uses: actions/checkout@v6 | ||
| - uses: prefix-dev/rattler-build-action@v0.2.37 | ||
| with: {setup-only: true} | ||
| - uses: actions/download-artifact@v8 | ||
| with: {pattern: conda-py*-*, path: output, merge-multiple: true} | ||
| - name: conda upload -c ccpi | ||
| run: > | ||
| anaconda -v -t ${{ secrets.CCPI_CONDA_TOKEN }} upload --force | ||
| --label ${{ startsWith(github.ref, 'refs/tags') && 'main' || 'dev' }} */cil-* | ||
| rattler-build upload anaconda */*.conda -f | ||
| -o ccpi -a ${{ secrets.CCPI_CONDA_TOKEN }} | ||
| -c ${{ startsWith(github.ref, 'refs/tags') && 'main' || 'dev' }} | ||
| - 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-* '${{ secrets.STFC_SSH_HOST }}:${{ secrets.STFC_SSH_CONDA_DIR }}' | ||
| rsync -e 'ssh -o StrictHostKeyChecking=no -i ./key' -R */*.conda '${{ 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 }}"' | ||
| docs: | ||
| defaults: {run: {shell: 'bash -el {0}', working-directory: docs}} | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 | ||
| submodules: recursive | ||
| ref: ${{ github.event.pull_request.head.sha || github.ref }} # fix SHA | ||
| - uses: conda-incubator/setup-miniconda@v3 | ||
| - uses: conda-incubator/setup-miniconda@v4 | ||
| with: | ||
| miniforge-version: latest | ||
| use-mamba: true | ||
| python-version: 3.12 | ||
| mamba-version: "*" | ||
| channels: conda-forge | ||
| conda-remove-defaults: "true" | ||
| conda-remove-defaults: true | ||
| - uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: '3.2' | ||
|
|
@@ -224,18 +192,18 @@ jobs: | |
| - name: install dependencies | ||
| run: | | ||
| mamba install -c conda-forge -yq conda-merge | ||
| sed -ri -e 's/cuda*//' -e '/tigre/d' ../scripts/cil_development.yml | ||
| sed -ri -e 's/(.* python) .*/\1=3.12/' -e 's/cuda*/py*/' -e '/tigre/d' ../scripts/cil_development.yml | ||
| conda-merge ../scripts/cil_development.yml docs_environment.yml > environment.yml | ||
| mamba env update -n test --file environment.yml | ||
| conda list | ||
| - run: pip install .. | ||
| - name: checkout docs | ||
| uses: actions/checkout@v4 | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| path: docs/build | ||
| ref: gh-pages | ||
| - id: pages | ||
| uses: actions/configure-pages@v5 | ||
| uses: actions/configure-pages@v6 | ||
| - name: update web pages (jekyll) | ||
| run: make JEKYLLOPTS="--baseurl ${{ steps.pages.outputs.base_path }}" web-deps web | ||
| env: {JEKYLL_ENV: production} | ||
|
|
@@ -245,7 +213,7 @@ jobs: | |
| docs_dir="${docs_dir//\//_}" | ||
| if test "$docs_dir" = master; then docs_dir=nightly; fi | ||
| make BUILDSUBDIR="$docs_dir" dirhtml | ||
| - uses: actions/upload-artifact@v4 | ||
| - uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: DocumentationHTML | ||
| path: docs/build | ||
|
|
@@ -263,7 +231,7 @@ jobs: | |
| contents: read | ||
| packages: write | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 | ||
| submodules: recursive | ||
|
|
@@ -272,8 +240,8 @@ jobs: | |
| with: | ||
| docker-images: false | ||
| large-packages: false | ||
| - uses: docker/setup-buildx-action@v3 | ||
| - uses: docker/metadata-action@v5 | ||
| - uses: docker/setup-buildx-action@v4 | ||
| - uses: docker/metadata-action@v6 | ||
| id: meta | ||
| with: | ||
| images: ghcr.io/${{ github.repository }} | ||
|
|
@@ -283,13 +251,13 @@ jobs: | |
| type=semver,pattern={{major}}.{{minor}} | ||
| labels: | | ||
| org.opencontainers.image.licenses=Apache-2.0 AND BSD-3-Clause AND GPL-3.0 | ||
| - uses: docker/login-action@v3 | ||
| - uses: docker/login-action@v4 | ||
| if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags') | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
| - uses: docker/build-push-action@v6 | ||
| - uses: docker/build-push-action@v7 | ||
| with: | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max | ||
|
|
@@ -300,7 +268,7 @@ jobs: | |
| run: > | ||
| docker run --rm -v .:/CIL tomographicimaging/cil:test /bin/bash -c | ||
| 'python -m unittest discover -v /CIL/Wrappers/Python/test' | ||
| - uses: docker/build-push-action@v6 | ||
| - uses: docker/build-push-action@v7 | ||
| with: | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max | ||
|
|
@@ -309,6 +277,6 @@ jobs: | |
| tags: ${{ steps.meta.outputs.tags }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
| pass: | ||
| needs: [test-cuda, test, conda-test, docs, docker] | ||
| runs-on: ubuntu-latest | ||
| needs: [test-cuda, test, conda-build-test, docs, docker] | ||
| runs-on: ubuntu-slim | ||
| steps: [{run: echo success}] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| /build* | ||
| /output/ | ||
| __pycache__/ | ||
| /Wrappers/Python/cil-*.dist-info/ | ||
| /Wrappers/Python/cil/include/ | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.