Skip to content
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

[native] Convert CircleCI jobs for PrestoC++ to Github actions #24236

Merged
merged 1 commit into from
Dec 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/prestocpp-format-and-header-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: prestocpp-format-and-header-check

on:
workflow_dispatch:
pull_request:
paths:
- 'presto-native-execution/**'
- '.github/workflows/prestocpp-format-and-header-check.yml'

jobs:
prestocpp-format-and-header-check:
runs-on: ubuntu-latest
container:
image: public.ecr.aws/oss-presto/velox-dev:check
steps:
- uses: actions/checkout@v4

- name: Fix git permissions
# Usually actions/checkout does this but as we run in a container
# it doesn't work
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}

- name: Check formatting
run: |
git fetch origin master
cd presto-native-execution
make format-check

- name: Check license headers
run: |
git fetch origin master
cd presto-native-execution
make header-check
91 changes: 91 additions & 0 deletions .github/workflows/prestocpp-linux-adapters-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: prestocpp-linux-adapters-build

on:
workflow_dispatch:
# Disable the automatic execution on PR because it currently will run out of disk space and
# we will address this subsequently.
# - use smaller image - in the works
# - remove the adapters downloaded files after install - JWT needs fixing because of the cmake files end up
#pull_request:
# paths:
# - 'presto-native-execution/scripts/**'
# - '.github/workflows/prestocpp-linux-adapters-build.yml'

jobs:
prestocpp-linux-adapters-build:
runs-on: ubuntu-22.04
container:
image: prestodb/presto-native-dependency:0.290-20241014120930-e1fc090
env:
CCACHE_DIR: "${{ github.workspace }}/ccache"
steps:
- uses: actions/checkout@v4

- name: Fix git permissions
# Usually actions/checkout does this but as we run in a container
# it doesn't work
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}

- name: Update submodules
run: |
cd presto-native-execution
make submodules

- name: Build all adapter dependencies
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove this job. I am adding the adapters to the dependency image.
#24251

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This job is here so we can check if changes in scripts trigger a failure with the adapters. The triggers is only changes in the script dir.
I can change it to specifically only trigger on changes to setup-adapter.sh. We don't want to find out issues when building the image after having changed the setup-adapters. I think it is useful to have. It won't run very often.

Copy link
Contributor Author

@czentgr czentgr Dec 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, lets make it to run when we update velox or setup-adapters.sh.
The job is one of the quicker ones. That way we don't get nasty surprises.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But we don't need to install /velox/scripts/setup-adapters.sh since that is tested on the Velox CI.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also don't need this on a Velox update then.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking if we could have a situation that isn't tested in Velox but might be used in PrestoC++. But I guess we'd need a full adapters build and PrestoC++ build. Which was what one CircleCI job originally did.

run: |
mkdir -p ${GITHUB_WORKSPACE}/adapter-deps/install
mkdir -p ${GITHUB_WORKSPACE}/adapter-deps/download
source /opt/rh/gcc-toolset-12/enable
set -xu
cd presto-native-execution
export DEPENDENCY_DIR=${GITHUB_WORKSPACE}/adapter-deps/download
export INSTALL_PREFIX=${GITHUB_WORKSPACE}/adapter-deps/install
PROMPT_ALWAYS_RESPOND=n ./velox/scripts/setup-adapters.sh
PROMPT_ALWAYS_RESPOND=n ./scripts/setup-adapters.sh

- name: Install Github CLI for using apache/infrastructure-actions/stash
run: |
curl -L https://github.com/cli/cli/releases/download/v2.63.2/gh_2.63.2_linux_amd64.rpm > gh_2.63.2_linux_amd64.rpm
rpm -iv gh_2.63.2_linux_amd64.rpm

- uses: apache/infrastructure-actions/stash/restore@4ab8682fbd4623d2b4fc1c98db38aba5091924c3
with:
path: '${{ env.CCACHE_DIR }}'
key: ccache-prestocpp-linux-adapters-build

- name: Zero ccache statistics
run: ccache -sz

- name: Build engine
run: |
source /opt/rh/gcc-toolset-12/enable
cd presto-native-execution
cmake \
-B _build/release \
-GNinja \
-DTREAT_WARNINGS_AS_ERRORS=1 \
-DENABLE_ALL_WARNINGS=1 \
-DCMAKE_BUILD_TYPE=Release \
-DPRESTO_ENABLE_PARQUET=ON \
-DPRESTO_ENABLE_S3=ON \
-DPRESTO_ENABLE_GCS=ON \
-DPRESTO_ENABLE_ABFS=OFF \
-DPRESTO_ENABLE_HDFS=ON \
-DPRESTO_ENABLE_REMOTE_FUNCTIONS=ON \
-DPRESTO_ENABLE_JWT=ON \
-DPRESTO_STATS_REPORTER_TYPE=PROMETHEUS \
-DPRESTO_MEMORY_CHECKER_TYPE=LINUX_MEMORY_CHECKER \
-DPRESTO_ENABLE_TESTING=OFF \
-DCMAKE_PREFIX_PATH=/usr/local \
-DThrift_ROOT=/usr/local \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DMAX_LINK_JOBS=4
ninja -C _build/release -j 4

- name: Ccache after
run: ccache -s

- uses: apache/infrastructure-actions/stash/save@4ab8682fbd4623d2b4fc1c98db38aba5091924c3
with:
path: '${{ env.CCACHE_DIR }}'
key: ccache-prestocpp-linux-adapters-build
Loading
Loading