Skip to content

Commit

Permalink
[#3812] improve(docs): Add Windows build instructions to how-to-build…
Browse files Browse the repository at this point in the history
….md (#3736)

### What changes were proposed in this pull request?

This pull request adds detailed instructions for building Gravitino on
Windows using the Windows Subsystem for Linux (WSL). The new section
provides a comprehensive step-by-step guide to setting up the necessary
environment and dependencies on Windows to successfully build and run
Gravitino. It also includes specific instructions for integrating with
IntelliJ IDEA and Visual Studio Code (VS Code).

### Why are the changes needed?

These changes are needed to provide Windows users with clear and concise
instructions on how to build Gravitino using WSL. This documentation
expands the accessibility of the project to a wider audience who may be
using Windows as their primary development environment. The detailed
steps ensure that developers can set up a consistent development
environment across different operating systems.

Fix: #3812

### Does this PR introduce _any_ user-facing change?

No user-facing APIs or properties were changed. The addition is purely
documentation, aimed at helping developers set up their environment on
Windows using WSL.

### How was this patch tested?

The documentation changes were reviewed for accuracy and clarity. The
steps outlined were followed to ensure they work as described, using an
environment set up with Windows 11 and Ubuntu 22.04 on WSL. The specific
instructions were used to successfully build the project, confirming
their effectiveness.

---------

Co-authored-by: LanceLin <[email protected]>
Co-authored-by: Jerry Shao <[email protected]>
  • Loading branch information
3 people authored Jun 18, 2024
1 parent 2d13784 commit 1f347bb
Showing 1 changed file with 105 additions and 3 deletions.
108 changes: 105 additions & 3 deletions docs/how-to-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ license: "Copyright 2023 Datastrato Pvt Ltd.
This software is licensed under the Apache License version 2."
---

- [Prerequisites](#prerequisites)
- [Quick start](#quick-start)
- [How to Build Gravitino on Windows (Using WSL)](#how-to-build-gravitino-on-windows-using-wsl)

## Prerequisites

+ Linux or macOS operating system
Expand Down Expand Up @@ -35,6 +39,8 @@ This software is licensed under the Apache License version 2."

1. Clone the Gravitino project.

If you want to contribute to this open-source project, please fork the project on GitHub first. After forking, clone the forked project to your local environment, make your changes, and submit a pull request (PR).

```shell
git clone [email protected]:datastrato/gravitino.git
```
Expand Down Expand Up @@ -93,11 +99,11 @@ This software is licensed under the Apache License version 2."

This creates `gravitino-spark-connector-runtime-{sparkVersion}_{scalaVersion}-{version}.jar`
under the `spark-connector/v3.4/spark-runtime/build/libs` directory. You could replace `3.4` with
`3.3` or `3.5` to specify different Spark versions, replace `2.12` with `2.13` for different Scala
version. The default Scala version is `2.12` if not specifying `-PscalaVersion`.
`3.3` or `3.5` to specify different Spark versions, and replace `2.12` with `2.13` for different Scala
versions. The default Scala version is `2.12` if not specifying `-PscalaVersion`.

:::info
Gravitino Spark connector doesn't support Scala 2.13 for Spark3.3.
Gravitino Spark connector doesn't support Scala 2.13 for Spark 3.3.
:::
:::note
Expand Down Expand Up @@ -157,3 +163,99 @@ This software is licensed under the Apache License version 2."
This creates `gravitino-trino-connector-{version}.tar.gz` and
`gravitino-trino-connector-{version}.tar.gz.sha256` under the `distribution` directory. You
can uncompress and deploy it to Trino to use the Gravitino Trino connector.
## How to Build Gravitino on Windows (Using WSL)
### Download WSL (Ubuntu)
**On Windows:**
Refer to this guide for installation: [WSL Installation Guide](https://learn.microsoft.com/en-us/windows/wsl/install)
*Note: Ubuntu 22.04 can successfully run Gravitino*
This step involves setting up the Windows Subsystem for Linux (WSL) on your Windows machine. WSL allows you to run a Linux distribution alongside Windows, providing a Linux-like environment for development.
### Update Package List and Install Necessary Packages
**On Ubuntu (WSL):**
```shell
sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common
```
Updating the package list ensures you have the latest information on the newest versions of packages and dependencies. Installing the necessary packages sets up your system to securely download and manage additional software.
### Download and Setup Java SDK 17 (11 or 8 also works)
**On Ubuntu (WSL):**
1. Edit your `~/.bashrc` file using any editor. Here, `vim` is used:
```shell
vim ~/.bashrc
```
2. Add the following lines at the end of the file. Replace `/usr/lib/jvm/java-11-openjdk-amd64` with your actual Java installation path:
```sh
export JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64"
export PATH=$PATH:$JAVA_HOME/bin
```
3. Save and quit in vim using `:wq`.
4. Run `source ~/.bashrc` to update the `.bashrc` file in your current shell session.
Editing the `~/.bashrc` file allows you to set environment variables that will be available in every terminal session. Setting `JAVA_HOME` and updating `PATH` ensures that your system uses the correct Java version for development.
### Install Docker
**On Ubuntu (WSL):**
```shell
curl -fsSL https
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt update
sudo apt install docker-ce
sudo service docker start
sudo docker run hello-world
sudo usermod -aG docker $USER
```
These commands install Docker. Running `hello-world` verifies the installation. Adding your user to the Docker group allows you to run Docker commands without `sudo`.
### Install Python 3.11
**On Ubuntu (WSL):**
```shell
sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.11
python3.11 --version
```
These commands add a repository that provides the latest Python versions and then installs Python 3.11.
### Download Gravitino Project to WSL
**On Ubuntu (WSL):**
```shell
git clone https://github.com/datastrato/gravitino.git
cd gravitino
./gradlew compileDistribution -x test
cd distribution/package/
./bin/gravitino.sh start
```
Access [http://localhost:8090](http://localhost:8090)
Building the Gravitino project compiles the necessary components, and starting the server allows you to access the application in your browser.
For instructions on how to run the project using VSCode or IntelliJ on Windows, please refer to [CONTRIBUTING.md](CONTRIBUTING.md).

0 comments on commit 1f347bb

Please sign in to comment.