This is an automated email from the ASF dual-hosted git repository.
jshao pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git
The following commit(s) were added to refs/heads/main by this push:
new 7cb0d9e67 [#5511] Update playground doc to latest (#5577)
7cb0d9e67 is described below
commit 7cb0d9e676f62efab4da9797466cc5175d69bb06
Author: danhuawang <[email protected]>
AuthorDate: Fri Nov 15 11:04:30 2024 +0800
[#5511] Update playground doc to latest (#5577)
### What changes were proposed in this pull request?
Sync the playground doc
### Why are the changes needed?
Fix: #5511
### Does this PR introduce _any_ user-facing change?
N/A
### How was this patch tested?
N/A
---
docs/how-to-use-the-playground.md | 108 +++++++++++++++++++++++++++++++++-----
1 file changed, 94 insertions(+), 14 deletions(-)
diff --git a/docs/how-to-use-the-playground.md
b/docs/how-to-use-the-playground.md
index 58787ff3b..27b32dbdd 100644
--- a/docs/how-to-use-the-playground.md
+++ b/docs/how-to-use-the-playground.md
@@ -14,6 +14,7 @@ Depending on your network and computer, startup time may take
3-5 minutes. Once
## Prerequisites
Install Git (optional), Docker, Docker Compose.
+Docker Desktop (or Orbstack) with Kubenetes enabled, and helm CLI are required
if you use helm-chart to deploy services.
## System Resource Requirements
@@ -24,44 +25,110 @@ Install Git (optional), Docker, Docker Compose.
The playground runs several services. The TCP ports used may clash with
existing services you run, such as MySQL or Postgres.
| Docker container | Ports used |
-|-----------------------|------------------------|
+| --------------------- | ---------------------- |
| playground-gravitino | 8090 9001 |
| playground-hive | 3307 19000 19083 60070 |
| playground-mysql | 13306 |
| playground-postgresql | 15342 |
| playground-trino | 18080 |
| playground-jupyter | 18888 |
+| playground-prometheus | 19090 |
+| playground-grafana | 13000 |
## Playground usage
-### Launch playground
-
-You can launch the playground in two ways:
-
-1. Use a single curl command
+### One curl command launch playground
```shell
/bin/bash -c "$(curl -fsSL
https://raw.githubusercontent.com/apache/gravitino-playground/HEAD/install.sh)"
```
-2. Use Git
+### Use git to download and launch playground
```shell
git clone [email protected]:apache/gravitino-playground.git
cd gravitino-playground
-./playground.sh start
```
-### Check status
+#### Docker
+
+##### Start
+
+```
+./playground.sh docker start
+```
+
+##### Check status
+
```shell
-./playground.sh status
+./playground.sh docker status
+```
+
+##### Stop playground
+
+```shell
+./playground.sh docker stop
+```
+
+#### Kubernetes
+
+Enable Kubernetes in Docker Desktop or Orbstack.
+
+In Project root directory, execute this command:
+
+```
+helm upgrade --install gravitino-playground ./helm-chart/ --create-namespace
--namespace gravitino-playground --set projectRoot=$(pwd)
+```
+
+##### Start
+
+```
+./playground.sh k8s start
+```
+
+##### Check status
+
+```shell
+./playground.sh k8s status
+```
+
+##### Port Forwarding
+
+To access pods or services at `localhost`, you needs to do these steps:
+
+1. Log in to the Gravitino playground Trino pod using the following command:
+
+```
+TRINO_POD=$(kubectl get pods --namespace gravitino-playground -l app=trino -o
jsonpath="{.items[0].metadata.name}")
+kubectl exec $TRINO_POD -n gravitino-playground -it -- /bin/bash
+```
+
+2. Log in to the Gravitino playground Spark pod using the following command:
+
+```
+SPARK_POD=$(kubectl get pods --namespace gravitino-playground -l app=spark -o
jsonpath="{.items[0].metadata.name}")
+kubectl exec $SPARK_POD -n gravitino-playground -it -- /bin/bash
```
-### Stop playground
+
+3. Port-forwarding Gravitino Service, so that you can access it at
`localhost:8090`.
+
+```
+kubectl port-forward svc/gravitino -n gravitino-playground 8090:8090
+```
+
+4. Port-forwarding Jupyter Notebook Service, so that you can access it at
`localhost:8888`.
+
+```
+kubectl port-forward svc/jupyternotebook -n gravitino-playground 8888:8888
+```
+
+##### Stop playground
+
```shell
-./playground.sh stop
+./playground.sh k8s stop
```
-## Using Apache Gravitino with Trino SQL
+## Experiencing Apache Gravitino with Trino SQL
### Using Trino CLI in Docker Container
@@ -96,9 +163,17 @@ docker exec -it playground-spark bash
2. Open the Spark SQL client in the container.
```shell
-spark@container_id:/$ cd /opt/spark && /bin/bash bin/spark-sql
+spark@container_id:/$ cd /opt/spark && /bin/bash bin/spark-sql
```
+## Monitoring Gravitino
+
+1. Open the Grafana in the browser at
[http://localhost:13000](http://localhost:13000).
+
+2. In the navigation menu, click **Dashboards** -> **Gravitino Playground**.
+
+3. Experiment with the default template.
+
## Example
### Simple Trino queries
@@ -203,6 +278,8 @@ INSERT OVERWRITE TABLE employees
PARTITION(department='Marketing') VALUES (3, 'M
SELECT * FROM catalog_hive.product.employees WHERE department = 'Engineering';
```
+The demo is located in the `jupyter` folder, you can open the
`gravitino-spark-trino-example.ipynb`
+demo via Jupyter Notebook by [http://localhost:18888](http://localhost:18888).
### Using Apache Iceberg REST service
@@ -259,6 +336,9 @@ union
select * from catalog_iceberg.sales.customers;
```
+The demo is located in the `jupyter` folder, you can open the
`gravitino-spark-trino-example.ipynb`
+demo via Jupyter Notebook by [http://localhost:18888](http://localhost:18888).
+
### Using Gravitino with LlamaIndex
The Gravitino playground also provides a simple RAG demo with LlamaIndex. This
demo will show you the