|
| 1 | +# Copyright (c) Facebook, Inc. and its affiliates. |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +name: Linux Build |
| 16 | + |
| 17 | +on: |
| 18 | + workflow_call: |
| 19 | + inputs: |
| 20 | + use-clang: |
| 21 | + description: 'Use Clang to compile the project.' |
| 22 | + default: false |
| 23 | + required: false |
| 24 | + type: boolean |
| 25 | + |
| 26 | +jobs: |
| 27 | + adapters: |
| 28 | + name: Linux release with adapters |
| 29 | + # prevent errors when forks ff their main branch |
| 30 | + if: ${{ github.repository == 'facebookincubator/velox' }} |
| 31 | + runs-on: 8-core-ubuntu |
| 32 | + container: ghcr.io/facebookincubator/velox-dev:adapters |
| 33 | + defaults: |
| 34 | + run: |
| 35 | + shell: bash |
| 36 | + env: |
| 37 | + CCACHE_DIR: "${{ github.workspace }}/.ccache" |
| 38 | + VELOX_DEPENDENCY_SOURCE: SYSTEM |
| 39 | + GTest_SOURCE: BUNDLED |
| 40 | + simdjson_SOURCE: BUNDLED |
| 41 | + xsimd_SOURCE: BUNDLED |
| 42 | + CUDA_VERSION: "12.4" |
| 43 | + USE_CLANG: "${{ inputs.use-clang && 'true' || 'false' }}" |
| 44 | + steps: |
| 45 | + - uses: actions/checkout@v4 |
| 46 | + |
| 47 | + - name: Fix git permissions |
| 48 | + # Usually actions/checkout does this but as we run in a container |
| 49 | + # it doesn't work |
| 50 | + run: git config --global --add safe.directory ${GITHUB_WORKSPACE} |
| 51 | + |
| 52 | + - name: Install Dependencies |
| 53 | + run: | |
| 54 | + # Allows to install arbitrary cuda-version whithout needing to update |
| 55 | + # docker container before. It simplifies testing new/different versions |
| 56 | + if ! yum list installed cuda-nvcc-$(echo ${CUDA_VERSION} | tr '.' '-') 1>/dev/null; then |
| 57 | + source scripts/setup-centos9.sh |
| 58 | + install_cuda ${CUDA_VERSION} |
| 59 | + fi |
| 60 | +
|
| 61 | + - name: Install Minio |
| 62 | + run: | |
| 63 | + MINIO_BINARY="minio-2022-05-26" |
| 64 | + if [ ! -f /usr/local/bin/${MINIO_BINARY} ]; then |
| 65 | + wget https://dl.min.io/server/minio/release/linux-amd64/archive/minio.RELEASE.2022-05-26T05-48-41Z -O ${MINIO_BINARY} |
| 66 | + chmod +x ./${MINIO_BINARY} |
| 67 | + mv ./${MINIO_BINARY} /usr/local/bin/ |
| 68 | + fi |
| 69 | +
|
| 70 | + - uses: assignUser/stash/restore@v1 |
| 71 | + with: |
| 72 | + path: '${{ env.CCACHE_DIR }}' |
| 73 | + key: ccache-linux-adapters-${{ inputs.use-clang && 'clang' || 'gcc' }} |
| 74 | + |
| 75 | + - name: "Zero Ccache Statistics" |
| 76 | + run: | |
| 77 | + ccache -sz |
| 78 | +
|
| 79 | + - name: Make Release Build |
| 80 | + env: |
| 81 | + MAKEFLAGS: 'NUM_THREADS=8 MAX_HIGH_MEM_JOBS=4 MAX_LINK_JOBS=4' |
| 82 | + CUDA_ARCHITECTURES: 70 |
| 83 | + CUDA_COMPILER: /usr/local/cuda-${CUDA_VERSION}/bin/nvcc |
| 84 | + # Set compiler to GCC 12 |
| 85 | + CUDA_FLAGS: "-ccbin /opt/rh/gcc-toolset-12/root/usr/bin" |
| 86 | + run: | |
| 87 | + EXTRA_CMAKE_FLAGS=( |
| 88 | + "-DVELOX_ENABLE_BENCHMARKS=ON" |
| 89 | + "-DVELOX_ENABLE_ARROW=ON" |
| 90 | + "-DVELOX_ENABLE_PARQUET=ON" |
| 91 | + "-DVELOX_ENABLE_HDFS=ON" |
| 92 | + "-DVELOX_ENABLE_S3=ON" |
| 93 | + "-DVELOX_ENABLE_GCS=ON" |
| 94 | + "-DVELOX_ENABLE_ABFS=ON" |
| 95 | + "-DVELOX_ENABLE_REMOTE_FUNCTIONS=ON" |
| 96 | + "-DVELOX_ENABLE_GPU=ON" |
| 97 | + "-DVELOX_MONO_LIBRARY=ON" |
| 98 | + ) |
| 99 | + if [[ "${USE_CLANG}" = "true" ]]; then scripts/setup-centos9.sh install_clang15; export CC=/usr/bin/clang-15; export CXX=/usr/bin/clang++-15; CUDA_FLAGS="-ccbin /usr/lib64/llvm15/bin/clang++-15"; fi |
| 100 | + make release EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS[*]}" |
| 101 | +
|
| 102 | + - name: Ccache after |
| 103 | + run: ccache -s |
| 104 | + |
| 105 | + - uses: assignUser/stash/save@v1 |
| 106 | + with: |
| 107 | + path: '${{ env.CCACHE_DIR }}' |
| 108 | + key: ccache-linux-adapters-${{ inputs.use-clang && 'clang' || 'gcc' }} |
| 109 | + |
| 110 | + - name: Run Tests |
| 111 | + # Some of the adapters dependencies are in the 'adapters' conda env |
| 112 | + shell: mamba run --no-capture-output -n adapters /usr/bin/bash -e {0} |
| 113 | + env: |
| 114 | + LIBHDFS3_CONF: "${{ github.workspace }}/scripts/hdfs-client.xml" |
| 115 | + working-directory: _build/release |
| 116 | + run: | |
| 117 | + export CLASSPATH=`/usr/local/hadoop/bin/hdfs classpath --glob` |
| 118 | + ctest -j 8 --label-exclude cuda_driver --output-on-failure --no-tests=error |
| 119 | +
|
| 120 | + ubuntu-debug: |
| 121 | + runs-on: 8-core-ubuntu |
| 122 | + # prevent errors when forks ff their main branch |
| 123 | + if: ${{ github.repository == 'facebookincubator/velox' }} |
| 124 | + name: "Ubuntu debug with resolve_dependency" |
| 125 | + env: |
| 126 | + CCACHE_DIR: "${{ github.workspace }}/.ccache" |
| 127 | + USE_CLANG: "${{ inputs.use-clang && 'true' || 'false' }}" |
| 128 | + defaults: |
| 129 | + run: |
| 130 | + shell: bash |
| 131 | + working-directory: velox |
| 132 | + steps: |
| 133 | + |
| 134 | + - name: Get Ccache Stash |
| 135 | + uses: assignUser/stash/restore@v1 |
| 136 | + with: |
| 137 | + path: '${{ env.CCACHE_DIR }}' |
| 138 | + key: ccache-ubuntu-debug-default-${{ inputs.use-clang && 'clang' || 'gcc' }} |
| 139 | + |
| 140 | + - name: Ensure Stash Dirs Exists |
| 141 | + working-directory: ${{ github.workspace }} |
| 142 | + run: | |
| 143 | + mkdir -p '${{ env.CCACHE_DIR }}' |
| 144 | +
|
| 145 | + - uses: actions/checkout@v4 |
| 146 | + with: |
| 147 | + path: velox |
| 148 | + |
| 149 | + - name: Install Dependencies |
| 150 | + run: | |
| 151 | + source scripts/setup-ubuntu.sh && install_apt_deps |
| 152 | +
|
| 153 | + - name: Clear CCache Statistics |
| 154 | + run: | |
| 155 | + ccache -sz |
| 156 | +
|
| 157 | + - name: Make Debug Build |
| 158 | + env: |
| 159 | + VELOX_DEPENDENCY_SOURCE: BUNDLED |
| 160 | + ICU_SOURCE: SYSTEM |
| 161 | + MAKEFLAGS: "NUM_THREADS=8 MAX_HIGH_MEM_JOBS=4 MAX_LINK_JOBS=3" |
| 162 | + EXTRA_CMAKE_FLAGS: "-DVELOX_ENABLE_ARROW=ON -DVELOX_ENABLE_PARQUET=ON" |
| 163 | + run: | |
| 164 | + if [[ "${USE_CLANG}" = "true" ]]; then export CC=/usr/bin/clang-15; export CXX=/usr/bin/clang++-15; fi |
| 165 | + make debug |
| 166 | +
|
| 167 | + - name: CCache after |
| 168 | + run: | |
| 169 | + ccache -vs |
| 170 | +
|
| 171 | + - uses: assignUser/stash/save@v1 |
| 172 | + with: |
| 173 | + path: '${{ env.CCACHE_DIR }}' |
| 174 | + key: ccache-ubuntu-debug-default-${{ inputs.use-clang && 'clang' || 'gcc' }} |
| 175 | + |
| 176 | + - name: Run Tests |
| 177 | + run: | |
| 178 | + cd _build/debug && ctest -j 8 --output-on-failure --no-tests=error |
0 commit comments