Skip to content

feat: Add tasks to manage the connector's dependencies for the worker. - #9

Merged
20001020ycx merged 24 commits into
y-scope:mainfrom
20001020ycx:feat/2026-05-22-velox-connector-taskfile
Jun 22, 2026
Merged

20001020ycx merged 24 commits into
y-scope:mainfrom
20001020ycx:feat/2026-05-22-velox-connector-taskfile

Conversation

@20001020ycx

@20001020ycx 20001020ycx commented May 22, 2026 •

Copy link
Copy Markdown
Collaborator

Description

This PR adds Taskfiles for building the C++ plugin - the worker-side of the Presto CLP connector. See the updated README for usage instructions.

The goal of adding the Taskfile layer is managing the dependencies required for compiling the Velox connector. Specifically, these are the dependencies needed for compiling CLP core, since Velox's symbols are resolved at runtime (see #4 for details). The layout of the Taskfile takes log-surgeon's Taskfile infra as the reference.

Note: even though we left Velox's symbols to be resolved at runtime, the include files of Velox's dependency may still be transitively included when compiling the plugin. As of this PR, we assume the build environment is either installed with all Velox's dependency in system or a docker container with Presto dev env image. We defer these header file dependency used for compilation to another PR.

Some design notes for reviewer:

Although indeed that this PR only concerns of the CLP's dependencies, there is a subtlety worth explaining: the Presto worker and CLP may use different versions of the same library. Take fmt as an example, which did create conflict when Presto is at 0.293 and CLP is at 0.10.0, if the Presto worker uses fmt vA and CLP uses fmt vB, leaving CLP's fmt symbol unresolved at run time would lead to undefined failure. The solution is to statically link every CLP dependency into the plugin and hide all its symbols, so the plugin carries its own copies and the Presto worker never sees them. Such solution is reflected in the deps.yaml as all dependencies were compiled with -fpic and linked statically with our plugin.

Finally, I would like to make a few comments regarding what dependencies we include and exclude at deps.yaml compared with deps taskfile from the CLP repo.

  1. We only build the CLP components that the plugin needs; the plugin enables most CLP_BUILD_CLP_S_* target and disables CLP_BUILD_EXECUTABLES and CLP_BUILDING_TESTING, see here for the plugin option we set. The dependencies required for each CLP target are listed here.
  2. Included dependencies are selected because they are what required by our enabled CLP_BUILD_CLP_S_* targets.
  3. Excluded dependencies are toggled off because:
    • CLP_BUILD_EXECUTABLES=OFF: lz4, mongocxx, sqlite3, yaml-cppp, and zlib
    • CLP_BUILD_TESTING=OFF: catch2 and liblzma
    • There's one dependency, utfcpp, where I don't see how CLP's CMake references it - no CLP_NEED_UTFCPP or find_package(utfcpp) found in the CLP repo; excluded it here for lighter management.

Breaking changes

None

Validation performed

Compilation Verification

  1. Pull the dependency image

    docker pull prestodb/presto-native-dependency:0.299-202606161331-03dfaf88
  2. From the repository root (with submodules initialized via
    git submodule update --init --recursive), start a container with the repo mounted:

    docker run --rm -it -v "$(pwd)":/workspace -w /workspace \
      prestodb/presto-native-dependency:0.299-202606161331-03dfaf88 bash
  3. Inside the container, install Task (not included in the image):

    sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin
  4. Build, pinning the compiler to the image's GCC 11:

    CC=/usr/bin/gcc CXX=/usr/bin/g++ task velox-connector:build
  5. The plugin is produced at build/velox-connector/libclp-plugin-velox-connector.so.

Constraint Verification

We first show that this plugin shared library is self-contained, as all symbols from CLP are resolved statically. This is the constraint we have enforced when building the shared library.

nm -u libclp-plugin-velox-connector.so | grep -Ev "GLIBC|GCC|CXXABI" shows all unresolved symbols from the compiled shared library, only 104 remains unresolved:

U ERR_error_string@OPENSSL_3.0.0
...
U _ZN5folly13CacheLocality6systemISt6atomicEERKS0_v
...
U _ZN6google10LogMessage6streamEv
...
U _ZN8facebook5velox10BaseVector14createInternalERKSt10shared_ptrIKNS0_4TypeEEiPNS0_6memory10MemoryPoolE
...
U curl_easy_cleanup@CURL_OPENSSL_4

All unresolved symbols fall into two categories: (1) folly, glog, and velox symbols are the expected result because we include the Velox header, and will be provided by the Presto worker at the runtime, and (2) OpenSSL and CURL symbols are following CLP convention, as CLP assumes these are provided by the system.

Checklist

  • The PR satisfies the contribution guidelines.
  • Necessary docs have been updated, OR no docs need to be updated.
  • The description has been filled out.
  • The breaking changes section has been filled out.
  • The validation performed section has been filled out.
  • The PR title:
    • follows the Conventional Commits specification.
    • uses one of the commit types from here.
    • is in imperative form (e.g., "Add new node types.").
    • references the GitHub issues that the PR resolves (if any) using the (fixes #N) or
      (resolves #N) syntax in the title.

Summary by CodeRabbit

Release Notes

  • New Features

    • Added build and dependency management capabilities for the Velox connector plugin with automated installation workflows.
  • Documentation

    • Added comprehensive setup, prerequisites, and build instructions for the Velox connector plugin.
  • Chores

    • Enhanced build system configuration and added new build cleanup utilities.

@coderabbitai

coderabbitai Bot commented May 22, 2026 •

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This pull request establishes the complete build infrastructure for the Velox Connector plugin. It integrates a new velox-connector Taskfile into the root Taskfile with build directory variables, defines tasks to download and install 13 C++ dependencies with coordinated CMake configuration, configures CMakeLists.txt to resolve dependency roots through Taskfile-generated settings, orchestrates generate and build tasks, and documents the build process and prerequisites.

Changes

Velox Connector Build System

Layer / File(s) Summary
Root Taskfile integration
taskfile.yaml
Registers the velox-connector Taskfile include and adds G_VELOX_CONNECTOR_BUILD_DIR and G_DEPS_CPP_DIR variables to coordinate build output and dependency installation paths.
C++ dependency installation tasks
taskfiles/velox-connector/deps.yaml
Defines 13 coordinated dependency installation tasks (absl, antlr-runtime, boost, date, fmt, log-surgeon, microsoft-gsl, msgpack-cxx, nlohmann-json, simdjson, spdlog, ystdlib, zstd) with per-dependency build options, external library integration, and shared CMake settings generation into a common directory.
CMake dependency resolution
velox-connector/CMakeLists.txt
Configures CMake to default DEPS_CPP_DIR to the Taskfile-installed deps location and includes auto-generated all-deps.cmake to resolve find_package() calls against preinstalled dependency roots; adds CLP_BUILD_CLP_S_FILTER build option.
Build task orchestration
taskfiles/velox-connector/main.yaml
Defines clean, generate, and build tasks: generate depends on deps:install-all and runs CMake configuration; build depends on generate and runs CMake build targeting the connector plugin; clean removes the build directory.
Documentation and cleanup
velox-connector/README.md, taskfiles/lint.yaml
Adds project README documenting prerequisites (CMake 3.28+, C++20 compiler, Task), build commands, and expected output location; extends lint Taskfile with a clean task to remove the virtual environment directory.

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • kirkrodrigues
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title mentions 'tasks to manage the connector's dependencies' which aligns with the core change—adding Taskfiles and build infrastructure for the Velox connector dependency management.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@20001020ycx
20001020ycx marked this pull request as ready for review May 25, 2026 18:19
@20001020ycx
20001020ycx requested a review from a team as a code owner May 25, 2026 18:19

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@velox-connector/README.md`:
- Line 26: The README.md file is missing a trailing newline and triggers
markdownlint MD047; open the README.md (contains the line "[Task]:
https://taskfile.dev") and ensure the file ends with exactly one newline
character by adding a single newline at EOF so the file terminates with one and
only one newline.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 208b6fb1-e5bd-4171-b249-2c21f62d949c

📥 Commits

Reviewing files that changed from the base of the PR and between 616971f and b6fb0a3.

📒 Files selected for processing (7)
  • .gitmodules
  • velox-connector/CMakeLists.txt
  • velox-connector/README.md
  • velox-connector/taskfile.yaml
  • velox-connector/taskfiles/deps.yaml
  • velox-connector/taskfiles/velox-connector.yaml
  • velox-connector/tools/yscope-dev-utils

Comment thread velox-connector/README.md Outdated
@20001020ycx
20001020ycx requested a review from gibber9809 May 25, 2026 18:29

@gibber9809 gibber9809 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice work! Just a few small comments on a few of the dependencies we're pulling in.

On my end I think I'm probably also going to update my work for integrating libarchive into clp-s to add a flag that allows libarchive to be excluded from the build -- we shouldn't need libarchive for anything here, and including it would force us to do a lot more dependency management.

Comment on lines +122 to +128
- "filesystem"
- "iostreams"
- "process"
- "program_options"
- "regex"
- "system"
- "url"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we can get away with just regex and url actually. We don't need program_options since we aren't building executables, and I don't think clp-s uses any of the other boost libraries directly or indirectly.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Looks like these targets are hard coded by clp's cmake.

Getting rid of any of the target results in below error when running the cmake configuration:

CMake Error at build/deps/cpp/boost-install/lib/cmake/Boost-1.87.0/BoostConfig.cmake:141 (find_package):
  Could not find a configuration file for package "boost_program_options"
  that exactly matches requested version "1.87.0".

  The following configuration files were considered but not accepted:

    /usr/local/lib/cmake/boost_program_options-1.84.0/boost_program_options-config.cmake, version: 1.84.0

Call Stack (most recent call first):
  build/deps/cpp/boost-install/lib/cmake/Boost-1.87.0/BoostConfig.cmake:262 (boost_find_component)
  /usr/local/share/cmake-3.28/Modules/FindBoost.cmake:594 (find_package)
  build/velox-connector/_deps/clp-src/components/core/CMakeLists.txt:166 (find_package)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I see, let's leave it for now then.

Comment thread velox-connector/taskfiles/deps.yaml Outdated
@20001020ycx
20001020ycx requested a review from gibber9809 May 28, 2026 17:36
@20001020ycx

Copy link
Copy Markdown
Collaborator Author

Addressed the comments, good catch on the dependency, lighter management is always better. Did another pass on the dependencies and seems that all are MUST have now.

In the new commit, also moved yscope-dev-utils to the parent folder as this will be shared across both presto-connector and velox-connector.

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown

Actionable comments posted: 0

gibber9809
gibber9809 previously approved these changes May 28, 2026

@gibber9809 gibber9809 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. For the PR title, maybe we could do something like

feat: Add taskfiles for managing Presto CLP connector dependencies.

to be a bit more specific.

@20001020ycx 20001020ycx changed the title feat: Add taskfiles for worker-side of Presto CLP connector. feat: Add taskfiles for managing worker-side of Presto CLP connector dependencies. May 28, 2026
@20001020ycx

Copy link
Copy Markdown
Collaborator Author

Added worker-side to be more specific.

LGTM. For the PR title, maybe we could do something like

feat: Add taskfiles for managing Presto CLP connector dependencies.

to be a bit more specific.

@20001020ycx

20001020ycx commented May 28, 2026 •

Copy link
Copy Markdown
Collaborator Author

Addressed the comments, good catch on the dependency, lighter management is always better. Did another pass on the dependencies and seems that all are MUST have now.

In the new commit, also moved yscope-dev-utils to the parent folder as this will be shared across both presto-connector and velox-connector.

Also did a pass on the list of CLP-S' target that we compile for the Velox connector, it turns out that there's two more target that can be eliminated as well.

CLP_BUILD_CLP_S_ARCHIVEWRITER: Plugin never performs write operation. Added in the new commit.

CLP_BUILD_CLP_S_ENABLE_CURL: Plugin never uses CURL, setting this off can get rid of dynamic dependencies on CURL and OpenSSL::Crypto. However, this flag is not introduced until this PR, which is merged after the current CLP hash pointed by the Velox connector's cmake list. Since updating the CLP hash require more testing, we will defer this in another PR. Tracked at #11 .
We do need CURL for S3, forget about this. Our ClpIrCursor/ClpArchiveCursor does call try_create_network_reader(), which is guard by CLP_BUILD_CLP_S_ENABLE_CURL by this PR. Setting it off we cause compilation failure.

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown

Actionable comments posted: 0

gibber9809
gibber9809 previously approved these changes May 28, 2026

@gibber9809 gibber9809 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Last flag change also LGTM.

- Create root taskfile.yaml with lint, velox-connector, and utils includes
- Move velox-connector/taskfiles/ to taskfiles/velox-connector/
- Rename velox-connector.yaml to main.yaml (namespace already provides prefix)
- Move lint taskfile to taskfiles/lint.yaml
- Move lint-requirements.txt to root
- Add root .gitignore with build/ and .task/ entries
- Add README.md with linting instructions
- Update velox-connector/README.md build instructions
- Remove build*/ from velox-connector/.gitignore (covered by root)
- Remove velox-connector/taskfile.yaml and taskfiles/
- Use root-level :utils:* namespace references instead of local includes

@kirkrodrigues kirkrodrigues left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

When I try to build (even before the last change I pushed), I get this error:

In file included from /home/kirk/projects/log-compressor/open-source/clp-plugin-presto-connector/velox-connector/src/protocol/../protocol/PrestoProtocolClp.h:20,
                 from /home/kirk/projects/log-compressor/open-source/clp-plugin-presto-connector/velox-connector/src/protocol/../protocol/ClpConnectorProtocol.h:17,
                 from /home/kirk/projects/log-compressor/open-source/clp-plugin-presto-connector/velox-connector/src/protocol/ClpConnectorProtocol.cpp:15:
/home/kirk/projects/log-compressor/open-source/clp-plugin-presto-connector/build/velox-connector/_deps/presto_native_execution-src/presto-native-execution/presto_cpp/presto_protocol/core/presto_protocol_core.h:29:10: fatal error: folly/Format.h: No such file or directory
   29 | #include <folly/Format.h>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
gmake[3]: *** [src/protocol/CMakeFiles/presto_clp_protocol.dir/build.make:76: src/protocol/CMakeFiles/presto_clp_protocol.dir/ClpConnectorProtocol.cpp.o] Error 1
gmake[2]: *** [CMakeFiles/Makefile2:778: src/protocol/CMakeFiles/presto_clp_protocol.dir/all] Error 2
gmake[2]: *** Waiting for unfinished jobs....

folly isn't listed as a requirement so we should probably be installing it via task?

Comment thread velox-connector/CMakeLists.txt Outdated
Comment thread taskfiles/velox-connector/deps.yaml Outdated
Comment thread taskfiles/velox-connector/deps.yaml Outdated
Comment thread taskfiles/velox-connector/deps.yaml Outdated
Comment thread taskfiles/velox-connector/deps.yaml Outdated
Comment thread taskfiles/velox-connector/main.yaml Outdated
Comment thread taskfiles/velox-connector/deps.yaml
Comment thread velox-connector/README.md Outdated
Comment thread taskfile.yaml Outdated
Comment thread taskfiles/lint.yaml
20001020ycx and others added 2 commits June 15, 2026 10:58
Co-authored-by: kirkrodrigues <2454684+kirkrodrigues@users.noreply.github.com>
@20001020ycx

Copy link
Copy Markdown
Collaborator Author

When I try to build (even before the last change I pushed), I get this error:

In file included from /home/kirk/projects/log-compressor/open-source/clp-plugin-presto-connector/velox-connector/src/protocol/../protocol/PrestoProtocolClp.h:20,
                 from /home/kirk/projects/log-compressor/open-source/clp-plugin-presto-connector/velox-connector/src/protocol/../protocol/ClpConnectorProtocol.h:17,
                 from /home/kirk/projects/log-compressor/open-source/clp-plugin-presto-connector/velox-connector/src/protocol/ClpConnectorProtocol.cpp:15:
/home/kirk/projects/log-compressor/open-source/clp-plugin-presto-connector/build/velox-connector/_deps/presto_native_execution-src/presto-native-execution/presto_cpp/presto_protocol/core/presto_protocol_core.h:29:10: fatal error: folly/Format.h: No such file or directory
   29 | #include <folly/Format.h>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
gmake[3]: *** [src/protocol/CMakeFiles/presto_clp_protocol.dir/build.make:76: src/protocol/CMakeFiles/presto_clp_protocol.dir/ClpConnectorProtocol.cpp.o] Error 1
gmake[2]: *** [CMakeFiles/Makefile2:778: src/protocol/CMakeFiles/presto_clp_protocol.dir/all] Error 2
gmake[2]: *** Waiting for unfinished jobs....

folly isn't listed as a requirement so we should probably be installing it via task?

emmmm, then I think the reason why I can compile it is because I have folly installed in the system. However, folly dependency is designed intentionally to be resolved by the presto worker at the run time as per this PR description explains. To run the presto worker, folly must be installed as a pre-requisite dependency. Therefore, for whatever missing symbols from the plugin, we will be relying on the runtime to resolve. This is to have only one version of folly when the plugin is loaded; and in fact our plugin does not use folly, it is the velox headers it includes that requires this, so we shall leave it to the presto worker to use its folly version.

But I do understand this blocks compilation for the environment where it is not intended for running the presto worker, and this is indeed something we should fix. I am imagining we can create a header-only install, to provide Folly headers at compile time without statically linking Folly's library into the plugin. This shall be done not only for Folly, but some of its transitive dependencies included in Folly's header, which I propose that we shall defer this to another PR. For this PR, we will assume that system provides the Folly dependency.

Comment thread taskfiles/velox-connector/deps.yaml Outdated
@jackluo923

Copy link
Copy Markdown
Member

@kirkrodrigues Use this image to compile:

docker pull ghcr.io/y-scope/clp-plugin-presto-connector/presto-native-dependency-manylinux:0.299-snapshot-6e1942b-amd64

@20001020ycx

Copy link
Copy Markdown
Collaborator Author

Updated the validation performed in the PR description to include the compilation tried on official Presto dev container from upstream in dockerhub: https://hub.docker.com/r/prestodb/presto-native-dependency/tags

jackluo923
jackluo923 previously approved these changes Jun 17, 2026

@kirkrodrigues kirkrodrigues left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Besides the inline comments, the PR description needs some work. As a reviewer, I can't follow the validation instructions and get the plugin to build (as you mentioned offline, log-surgeon fails to compile with the version of the GCC that's used by the default Presto plugin, so we should at least have mentioned that and what you did to get it to compile.). I can live with not knowing how you ran Presto to run those queries since I understand we're still in the process of putting together all the infrastructure, but at least building should be something a reviewer can validate.

Comment thread taskfiles/lint.yaml
Comment thread taskfiles/velox-connector/deps.yaml Outdated
Comment thread taskfiles/velox-connector/deps.yaml Outdated
Comment thread taskfiles/velox-connector/deps.yaml Outdated
Comment thread taskfiles/velox-connector/deps.yaml Outdated
Comment thread velox-connector/README.md Outdated
Co-authored-by: kirkrodrigues <2454684+kirkrodrigues@users.noreply.github.com>

@kirkrodrigues kirkrodrigues left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For the PR title, how about:

feat: Add tasks to manage the connector's dependencies for the worker.

Comment thread velox-connector/README.md
Comment thread velox-connector/README.md Outdated
20001020ycx and others added 2 commits June 18, 2026 16:04
Co-authored-by: kirkrodrigues <2454684+kirkrodrigues@users.noreply.github.com>
Co-authored-by: kirkrodrigues <2454684+kirkrodrigues@users.noreply.github.com>
@20001020ycx 20001020ycx changed the title feat: Add taskfiles for managing worker-side of Presto CLP connector dependencies. feat: Add tasks to manage the connector's dependencies for the worker. Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants