|
| 1 | +name: Build conda |
| 2 | +description: Build conda |
| 3 | +inputs: |
| 4 | + label: |
| 5 | + description: "Label" |
| 6 | + default: "" |
| 7 | + required: false |
| 8 | + cuda: |
| 9 | + description: "cuda" |
| 10 | + default: "" |
| 11 | + required: false |
| 12 | + raft: |
| 13 | + description: "raft" |
| 14 | + default: "" |
| 15 | + required: false |
| 16 | + compiler_version: |
| 17 | + description: "compiler_version" |
| 18 | + default: "" |
| 19 | + required: false |
| 20 | +runs: |
| 21 | + using: composite |
| 22 | + steps: |
| 23 | + - name: Choose shell |
| 24 | + shell: bash |
| 25 | + id: choose_shell |
| 26 | + run: | |
| 27 | + # if runner.os != 'Windows' use bash, else use pwsh |
| 28 | + if [ "${{ runner.os }}" != "Windows" ]; then |
| 29 | + echo "shell=bash" >> "$GITHUB_OUTPUT" |
| 30 | + else |
| 31 | + echo "shell=pwsh" >> "$GITHUB_OUTPUT" |
| 32 | + fi |
| 33 | + - name: Setup miniconda |
| 34 | + uses: conda-incubator/setup-miniconda@v3.0.3 |
| 35 | + with: |
| 36 | + python-version: '3.11' |
| 37 | + miniconda-version: latest |
| 38 | + - name: Install conda build tools |
| 39 | + shell: ${{ steps.choose_shell.outputs.shell }} |
| 40 | + run: | |
| 41 | + # conda config --set solver libmamba |
| 42 | + # conda config --set verbosity 3 |
| 43 | + conda update -y -q conda |
| 44 | + conda install -y -q conda-build |
| 45 | + - name: Enable anaconda uploads |
| 46 | + if: inputs.label != '' |
| 47 | + shell: ${{ steps.choose_shell.outputs.shell }} |
| 48 | + env: |
| 49 | + PACKAGE_TYPE: inputs.label |
| 50 | + run: | |
| 51 | + conda install -y -q anaconda-client |
| 52 | + conda config --set anaconda_upload yes |
| 53 | + - name: Conda build (CPU) |
| 54 | + if: inputs.label == '' && inputs.cuda == '' |
| 55 | + shell: ${{ steps.choose_shell.outputs.shell }} |
| 56 | + working-directory: conda |
| 57 | + run: | |
| 58 | + conda build faiss --python 3.11 -c pytorch |
| 59 | + - name: Conda build (CPU) w/ anaconda upload |
| 60 | + if: inputs.label != '' && inputs.cuda == '' |
| 61 | + shell: ${{ steps.choose_shell.outputs.shell }} |
| 62 | + working-directory: conda |
| 63 | + env: |
| 64 | + PACKAGE_TYPE: inputs.label |
| 65 | + run: | |
| 66 | + conda build faiss --user pytorch --label ${{ inputs.label }} -c pytorch |
| 67 | + - name: Conda build (GPU) |
| 68 | + if: inputs.label == '' && inputs.cuda != '' && inputs.raft == '' |
| 69 | + shell: ${{ steps.choose_shell.outputs.shell }} |
| 70 | + working-directory: conda |
| 71 | + run: | |
| 72 | + conda build faiss-gpu --variants '{ "cudatoolkit": "${{ inputs.cuda }}", "c_compiler_version": "${{ inputs.compiler_version }}", "cxx_compiler_version": "${{ inputs.compiler_version }}" }' \ |
| 73 | + -c pytorch -c nvidia/label/cuda-${{ inputs.cuda }} -c nvidia |
| 74 | + - name: Conda build (GPU) w/ anaconda upload |
| 75 | + if: inputs.label != '' && inputs.cuda != '' && inputs.raft == '' |
| 76 | + shell: ${{ steps.choose_shell.outputs.shell }} |
| 77 | + working-directory: conda |
| 78 | + env: |
| 79 | + PACKAGE_TYPE: inputs.label |
| 80 | + run: | |
| 81 | + conda build faiss-gpu --variants '{ "cudatoolkit": "${{ inputs.cuda }}", "c_compiler_version": "${{ inputs.compiler_version }}", "cxx_compiler_version": "${{ inputs.compiler_version }}" }' \ |
| 82 | + --user pytorch --label ${{ inputs.label }} -c pytorch -c nvidia/label/cuda-${{ inputs.cuda }} -c nvidia |
| 83 | + - name: Conda build (GPU w/ RAFT) |
| 84 | + if: inputs.label == '' && inputs.cuda != '' && inputs.raft != '' |
| 85 | + shell: ${{ steps.choose_shell.outputs.shell }} |
| 86 | + working-directory: conda |
| 87 | + run: | |
| 88 | + conda build faiss-gpu-raft --variants '{ "cudatoolkit": "${{ inputs.cuda }}", "c_compiler_version": "${{ inputs.compiler_version }}", "cxx_compiler_version": "${{ inputs.compiler_version }}" }' \ |
| 89 | + -c pytorch -c nvidia/label/cuda-${{ inputs.cuda }} -c nvidia -c rapidsai -c rapidsai-nightly -c conda-forge |
| 90 | + - name: Conda build (GPU w/ RAFT) w/ anaconda upload |
| 91 | + if: inputs.label != '' && inputs.cuda != '' && inputs.raft != '' |
| 92 | + shell: ${{ steps.choose_shell.outputs.shell }} |
| 93 | + working-directory: conda |
| 94 | + env: |
| 95 | + PACKAGE_TYPE: inputs.label |
| 96 | + run: | |
| 97 | + conda build faiss-gpu-raft --variants '{ "cudatoolkit": "${{ inputs.cuda }}", "c_compiler_version": "${{ inputs.compiler_version }}", "cxx_compiler_version": "${{ inputs.compiler_version }}" }' \ |
| 98 | + --user pytorch --label ${{ inputs.label }} -c pytorch -c nvidia/label/cuda-${{ inputs.cuda }} -c nvidia -c rapidsai -c rapidsai-nightly -c conda-forge |
0 commit comments