Skip to content

Commit

Permalink
Add native worker-specific github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
mshang816 authored and highker committed Aug 18, 2022
1 parent 2353f98 commit ea0a447
Show file tree
Hide file tree
Showing 5 changed files with 163 additions and 11 deletions.
File renamed without changes.
141 changes: 141 additions & 0 deletions .github/workflows/test-native-specific.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: test native-specific

on:
pull_request:
paths:
- 'presto-native-execution/**'

jobs:
native-specific-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '12.5.1'

- name: Update submodules
run: make -C presto-native-execution submodules

- name: Setup MacOS cache
id: presto_cpp_macos_dep_cache
uses: actions/cache@v3
with:
path: ~/deps
key: ${{ runner.os }}-presto-native-macos-cache-${{ hashFiles('.github/workflows/test-native-specific.yml') }}-${{ hashFiles('presto-native-execution/scripts/setup-macos.sh') }}-${{ hashFiles('presto-native-execution/velox/scripts/setup-macos.sh') }}
restore-keys: |
${{ runner.os }}-presto-native-macos-cache-
- name: Initiate MacOS cache
if: steps.presto_cpp_macos_dep_cache.outputs.cache-hit != 'true'
run: |
set -xu
mkdir ~/deps ~/deps-src
git clone --depth 1 https://github.com/Homebrew/brew ~/deps
PATH=~/deps/bin:${PATH}
DEPENDENCY_DIR=~/deps-src INSTALL_PREFIX=~/deps PROMPT_ALWAYS_RESPOND=n ${GITHUB_WORKSPACE}/presto-native-execution/scripts/setup-macos.sh
# Calculate the prefix path before we delete brew's repos and taps.
echo "$(pwd)/deps;$(brew --prefix [email protected]);$(brew --prefix icu4c)" > ~/deps/PREFIX_PATH
rm -rf ~/deps/.git ~/deps/Library/Taps/ # Reduce cache size by 70%.
rm -rf ~/deps-src
- name: Setup MacOS ccache cache
id: presto_cpp_macos_ccache
uses: actions/cache@v3
with:
path: ~/.ccache
key: ${{ runner.os }}-presto-native-macos-ccache-${{ steps.get-date.outputs.date }}
restore-keys: |
${{ runner.os }}-presto-native-macos-ccache-
- name: Initiate ccache for MacOS
if: steps.presto_cpp_macos_ccache.outputs.cache-hit != 'true'
run: |
mkdir -p ~/.ccache
export PATH=~/deps/bin:${PATH}
export CCACHE_DIR=$(realpath ~/.ccache)
ccache -sz -M 5Gi
- name: Build presto_cpp on MacOS
run: |
export PATH=~/deps/bin:${PATH}
export CCACHE_DIR=$(realpath ~/.ccache)
ccache -s
cd ${GITHUB_WORKSPACE}/presto-native-execution
cmake -B _build/debug -GNinja -DTREAT_WARNINGS_AS_ERRORS=1 -DENABLE_ALL_WARNINGS=1 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=$(cat ~/deps/PREFIX_PATH) -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
ninja -C _build/debug
ccache -s
native-specific-linux:
runs-on: ubuntu-latest
container: prestocpp/prestocpp-avx-circleci:mikesh-20220804

env:
CC: /opt/rh/gcc-toolset-9/root/bin/gcc
CXX: /opt/rh/gcc-toolset-9/root/bin/g++

steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
submodules: true
fetch-depth: 0

- name: Update submodules
run: make -C presto-native-execution submodules

- name: Format check
run: presto-native-execution/velox/scripts/check.py format master

- name: Header check
run: presto-native-execution/velox/scripts/check.py header master

- name: Get date for ccache
id: get-date
run: |
echo "::set-output name=date::$(/bin/date -u "+%Y%m%d")"
shell: bash

- name: Setup ccache cache
id: presto_cpp_ccache
uses: actions/cache@v3
with:
path: ~/.ccache
key: ${{ runner.os }}-presto-native-ccache-${{ steps.get-date.outputs.date }}
restore-keys: |
${{ runner.os }}-presto-native-ccache-
- name: Initiate ccache
if: steps.presto_cpp_ccache.outputs.cache-hit != 'true'
run: |
mkdir -p ~/.ccache
export CCACHE_DIR=$(realpath ~/.ccache)
ccache -sz -M 5Gi
- name: Install S3 adapter dependencies
run: |
mkdir ~/adapter-deps ~/adapter-deps/install
source /opt/rh/gcc-toolset-9/enable
set -xu
DEPENDENCY_DIR=~/adapter-deps PROMPT_ALWAYS_RESPOND=n ${GITHUB_WORKSPACE}/presto-native-execution/velox/scripts/setup-adapters.sh
- name: Build presto_cpp
run: |
source /opt/rh/gcc-toolset-9/enable
export CCACHE_DIR=$(realpath ~/.ccache)
ccache -s
cd ${GITHUB_WORKSPACE}/presto-native-execution
cmake -B _build/release -GNinja -DAWSSDK_ROOT_DIR=~/adapter-deps/install -DTREAT_WARNINGS_AS_ERRORS=1 -DENABLE_ALL_WARNINGS=1 -DCMAKE_BUILD_TYPE=Release -DPRESTO_ENABLE_PARQUET=ON -DPRESTO_ENABLE_S3=ON -DCMAKE_PREFIX_PATH=/usr/local -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
ninja -C _build/release -j 2
ccache -s
11 changes: 11 additions & 0 deletions .github/workflows/test-native.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: test native

on:
Expand Down
File renamed without changes.
22 changes: 11 additions & 11 deletions presto-native-execution/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,24 +76,24 @@ presto_protocol: #: Build the presto_protocol serde library
TypeSignature: #: Build the Presto TypeSignature parser
cd presto_cpp/main/types; $(MAKE) TypeSignature

format-fix: #: Fix formatting issues in the main branch
velox/scripts/check.py format main --fix
format-fix: #: Fix formatting issues in the master branch
velox/scripts/check.py format master --fix

format-check: #: Check for formatting issues on the main branch
format-check: #: Check for formatting issues on the master branch
clang-format --version
velox/scripts/check.py format main
velox/scripts/check.py format master

header-fix: #: Fix license header issues in the main branch
velox/scripts/check.py header main --fix
header-fix: #: Fix license header issues in the master branch
velox/scripts/check.py header master --fix

header-check: #: Check for license header issues on the man branch
velox/scripts/check.py header main
velox/scripts/check.py header master

tidy-fix: cmake #: Fix clang-tidy issues in the main branch
velox/scripts/check.py tidy main --fix
tidy-fix: cmake #: Fix clang-tidy issues in the master branch
velox/scripts/check.py tidy master --fix

tidy-check: cmake #: Check clang-tidy issues in the main branch
velox/scripts/check.py tidy main
tidy-check: cmake #: Check clang-tidy issues in the master branch
velox/scripts/check.py tidy master

circleci-container: #: Build the linux container for CircleCi
$(MAKE) linux-container CONTAINER_NAME=circleci
Expand Down

0 comments on commit ea0a447

Please sign in to comment.