Repository navigation
Add continuous distributions to dpnp.random.Generator
#12147
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build Sphinx | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| types: [opened, synchronize, reopened, closed] | |
| permissions: read-all | |
| # A newer run, or the close of the PR, supersedes an in-progress one. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| # Pinned: Miniforge3 26.9.4-0 fails 'conda init' on Windows runners | |
| MINIFORGE_VERSION: '26.7.2-1' | |
| GH_EVENT_PUSH_UPSTREAM: ${{ github.ref == 'refs/heads/master' && github.event_name == 'push' && | |
| github.event.ref == 'refs/heads/master' && github.event.repository && !github.event.repository.fork }} | |
| GH_EVENT_PR_OPEN: ${{ github.event_name == 'pull_request' && github.event.action != 'closed' }} | |
| PUBLISH_DIR: doc/_build/html/ | |
| defaults: | |
| run: | |
| shell: bash -el {0} | |
| jobs: | |
| build-and-deploy: | |
| name: Build and Deploy Docs | |
| # A closed PR only needs the clean job | |
| if: github.event.action != 'closed' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 90 | |
| permissions: | |
| # Needed to deploy static files to GitHub Pages | |
| contents: write | |
| # Needed to add a comment to a pull request's issue | |
| pull-requests: write | |
| env: | |
| environment-file: 'environments/environment.yml' | |
| build-with-oneapi-env: 'environments/build_with_oneapi.yml' | |
| building-docs-env: 'environments/building_docs.yml' | |
| oneapi-pkgs-env: '' | |
| # Enable env when it's required to use only conda packages without OneAPI installation | |
| # oneapi-pkgs-env: '${{ github.workspace }}/environments/oneapi_pkgs.yml' | |
| dpctl-pkg-txt: 'environments/dpctl_pkg.txt' | |
| steps: | |
| - name: Free Disk Space (Ubuntu) | |
| uses: jlumbroso/free-disk-space@ceedf095f4ec1a097402bc6bd80831f2e1a6fde6 # v2.0.0 | |
| with: | |
| docker-images: false | |
| - name: Add Intel repository | |
| if: env.oneapi-pkgs-env == '' | |
| run: | | |
| wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | |
| < GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null | |
| rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | |
| echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list | |
| sudo apt update | |
| - name: Install Intel OneAPI | |
| if: env.oneapi-pkgs-env == '' | |
| run: | | |
| sudo apt install hwloc \ | |
| intel-oneapi-mkl \ | |
| intel-oneapi-umf \ | |
| intel-oneapi-mkl-devel \ | |
| intel-oneapi-tbb-devel \ | |
| intel-oneapi-libdpstd-devel \ | |
| intel-oneapi-compiler-dpcpp-cpp | |
| # required by sphinxcontrib-spelling extension | |
| - name: Install enchant package | |
| run: | | |
| sudo apt-get install enchant-2 | |
| # CuPy, imported for the comparison table, needs libcuda.so.1; conda ships the rest of CUDA | |
| - name: Install NVIDIA driver library | |
| run: | | |
| sudo apt-get install -y libnvidia-compute-580 | |
| - name: Checkout repo | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| fetch-depth: 0 | |
| # Blobless: all commits and tags for git describe, no gh-pages blobs | |
| filter: blob:none | |
| - name: Install conda-merge tool | |
| uses: BSFishy/pip-action@8f2d471d809dc20b6ada98c91910b6ae6243f318 # v1 | |
| with: | |
| packages: conda-merge | |
| - name: Merge conda env files | |
| run: | | |
| conda-merge ${{ env.build-with-oneapi-env }} ${{ env.building-docs-env }} ${{ env.oneapi-pkgs-env }} > ${{ env.environment-file }} | |
| cat ${{ env.environment-file }} | |
| - name: Setup miniconda | |
| uses: ./.github/actions/setup-miniconda | |
| with: | |
| miniforge-version: ${{ env.MINIFORGE_VERSION }} | |
| environment-file: ${{ env.environment-file }} | |
| activate-environment: 'docs' | |
| # We can't install dpctl as a conda package when the environment is created through | |
| # installing of Intel OneAPI packages because the dpctl conda package has a runtime | |
| # dependency on DPC++ RT one. Whereas the DPC++ RT package has been already installed | |
| # by the apt command above and its version has been matched with the DPC++ compiler. | |
| # In case where we install the DPC++ compiler with the apt (including DPC++ RT) and | |
| # install the DPC++ RT conda package while resolving dependencies, this can lead | |
| # to a versioning error, i.e. compatibility issue as the DPC++ compiler only guarantees | |
| # backwards compatibility, not forward compatibility (DPC++ RT may not run a binary built | |
| # with a newer version of the DPC++ compiler). | |
| # Installing dpctl via the pip manager has no such limitation, as the package has no | |
| # run dependency on the DPC++ RT pip package, so this is why the step is necessary here. | |
| - name: Install dpctl | |
| if: env.oneapi-pkgs-env == '' | |
| run: | | |
| pip install -r ${{ env.dpctl-pkg-txt }} | |
| - name: Conda info | |
| run: | | |
| mamba info | |
| mamba list | |
| - name: Build library | |
| run: | | |
| [ -f /opt/intel/oneapi/setvars.sh ] && source /opt/intel/oneapi/setvars.sh | |
| python scripts/build_locally.py | |
| - name: Run a spelling checker for docs | |
| run: | | |
| [ -f /opt/intel/oneapi/setvars.sh ] && source /opt/intel/oneapi/setvars.sh | |
| make spelling | |
| working-directory: doc | |
| - name: Build docs | |
| run: | | |
| [ -f /opt/intel/oneapi/setvars.sh ] && source /opt/intel/oneapi/setvars.sh | |
| make html | |
| working-directory: doc | |
| - name: Set a project number to current release | |
| run: | | |
| PROJECT_NUMBER=$(git describe --tags --abbrev=0) | |
| export PROJECT_NUMBER | |
| echo "PROJECT_NUMBER=${PROJECT_NUMBER}" | |
| echo "PROJECT_NUMBER=$PROJECT_NUMBER" >> "$GITHUB_ENV" | |
| - name: Build backend docs | |
| uses: mattnotmitt/doxygen-action@b84fe17600245bb5db3d6c247cc274ea98c15a3b # v1.12 | |
| with: | |
| working-directory: 'dpnp/backend/doc' | |
| - name: Copy backend docs | |
| run: cp -r dpnp/backend/doc/html ${{ env.PUBLISH_DIR }}/backend_doc | |
| # Detect if this is a fork PR | |
| - name: Check if fork PR | |
| id: check_fork | |
| run: | | |
| IS_FORK="false" | |
| if [ "${{ github.event_name }}" == "pull_request" ] && [ "${{ github.event.pull_request.head.repo.fork }}" == "true" ]; then | |
| IS_FORK="true" | |
| fi | |
| echo "is_fork=$IS_FORK" >> "$GITHUB_OUTPUT" | |
| echo "Is fork PR: $IS_FORK" | |
| # Upload artifact for fork PRs | |
| - name: Upload docs artifact (Fork PRs) | |
| if: env.GH_EVENT_PR_OPEN == 'true' && steps.check_fork.outputs.is_fork == 'true' | |
| uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 | |
| with: | |
| name: pr-${{ github.event.number }}-docs | |
| path: ${{ env.PUBLISH_DIR }} | |
| retention-days: 30 | |
| # The step is only used to build docs while pushing a PR to "master" | |
| - name: Deploy docs | |
| if: env.GH_EVENT_PUSH_UPSTREAM == 'true' | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| COMMIT_MESSAGE: ${{ github.event.head_commit.message }} | |
| run: .github/scripts/update_gh_pages.sh publish "${PUBLISH_DIR}" . "${COMMIT_MESSAGE}" | |
| # The step is only used to build docs while pushing to PR branch | |
| - name: Publish pull-request docs | |
| if: env.GH_EVENT_PR_OPEN == 'true' && steps.check_fork.outputs.is_fork == 'false' | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| PR_NUM: ${{ github.event.number }} | |
| PR_TITLE: ${{ github.event.pull_request.title }} | |
| run: .github/scripts/update_gh_pages.sh publish "${PUBLISH_DIR}" "pull/${PR_NUM}" "${PR_TITLE}" | |
| # The step is only used to build docs while pushing to PR branch | |
| # Note: Fork PRs have read-only GITHUB_TOKEN and cannot post comments | |
| # See: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#workflows-in-forked-repositories | |
| - name: Comment with URL to published pull-request docs | |
| if: env.GH_EVENT_PR_OPEN == 'true' && steps.check_fork.outputs.is_fork == 'false' | |
| env: | |
| PR_NUM: ${{ github.event.number }} | |
| uses: mshick/add-pr-comment@ec328af66588ab8f77cdeb2c264f14aba45bbf59 # v3.12.0 | |
| with: | |
| message-id: url_to_docs | |
| message: | | |
| View rendered docs @ https://intelpython.github.io/dpnp/pull/${{ env.PR_NUM }}/index.html | |
| allow-repeats: false | |
| # The job is only used to build docs when PR is closed (action from PR branch) | |
| clean: | |
| if: | | |
| github.event_name == 'pull_request' && github.event.action == 'closed' && | |
| github.event.pull_request.head.repo && !github.event.pull_request.head.repo.fork | |
| permissions: | |
| # Needed to remove docs for closed pull request from the repo | |
| contents: write | |
| # Needed to modify a comment in the pull request's issue | |
| pull-requests: write | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Remove docs [PR closed] | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| PR_NUM: ${{ github.event.number }} | |
| run: | | |
| .github/scripts/update_gh_pages.sh remove \ | |
| "Removing docs for closed pull request ${PR_NUM}" "pull/${PR_NUM}" | |
| - name: Modify the comment with URL to official documentation | |
| uses: mshick/add-pr-comment@ec328af66588ab8f77cdeb2c264f14aba45bbf59 # v3.12.0 | |
| with: | |
| message-id: url_to_docs | |
| find: | | |
| View rendered docs @.+ | |
| replace: | | |
| View rendered docs @ https://intelpython.github.io/dpnp/index.html |