Skip to main content
Version: 0.3.0

How to build Gravitino

Prerequisites

  • Linux or macOS operating system
  • Git
  • A Java Development Kit version 8 to 17 installed in your environment to launch Gradle
  • Optionally Docker to run integration tests
Please read the following notes first
  • Gravitino requires at least JDK8 and at most JDK17 to run Gradle, so you need to install JDK8 to 17 version to launch the build environment.

  • Gravitino itself uses JDK8 to build, Gravitino Trino connector uses JDK17 to build. You don't have to preinstall JDK8 or JDK17, Gradle detects the JDK version needed and downloads it automatically.

  • Gravitino uses Gradle Java Toolchain to detect and manage JDK versions, it checks the installed JDK by running ./gradlew javaToolchains command. For the details of Gradle Java Toolchain, please see Gradle Java Toolchain.

  • Make sure you have installed Docker in your environment as Gravitino uses it to run integration tests; without it, some Docker-related tests may not run.

  • macOS uses "docker-connector" to make the Gravitino Trino connector work with Docker for macOS. For the details of "docker-connector", please see docker-connector , $GRAVITINO_HOME/dev/docker/tools/mac-docker-connector.sh, and $GRAVITINO_HOME/dev/docker/tools/README.md for more details.

  • Alternatively, you can use OrbStack to replace Docker for macOS, please see OrbStack, with OrbStack you can run Gravitino integration tests without needing to install "docker-connector".

Quick start

  1. Clone the Gravitino project.

    git clone git@github.com:datastrato/gravitino.git
  2. Build the Gravitino project.

    cd gravitino
    ./gradlew build
note

The first time you build the project, downloading the dependencies may take a while. You can add -x test to skip the tests, by using ./gradlew build -x test.

  1. Get the Gravitino binary package.

    ./gradlew compileDistribution

    The compileDistribution command creates a distribution directory in the Gravitino root directory.

    The directory structure of the distribution directory is as follows:

note

The ./gradlew clean command deletes the distribution directory.

  1. Assemble the Gravitino distribution package.

    ./gradlew assembleDistribution

    The assembleDistribution command creates gravitino-{version}-bin.tar.gz and gravitino-{version}-bin.tar.gz.sha256 under the distribution directory.

    You can deploy them to your production environment.

note

The gravitino-{version}-bin.tar.gz file is the Gravitino server distribution package, and the gravitino-{version}-bin.tar.gz.sha256 file is the sha256 checksum file for the Gravitino server distribution package.

  1. Assemble Gravitino Trino connector package

     ./gradlew assembleTrinoConnector

    or

    ./gradlew assembleDistribution

    This creates gravitino-trino-connector-{version}.tar.gz and gravitino-trino-connector-{version}.tar.gz.sha256 under the distribution directory.