diff --git a/README.md b/README.md index 4e7110a..13a3390 100644 --- a/README.md +++ b/README.md @@ -36,21 +36,20 @@ Docker Desktop (or Orbstack) with Kubenetes enabled, and helm CLI are required i The playground runs a number of 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 | +| Docker container | Ports used | +| --------------------- | ------------------------------- | +| playground-gravitino | 8090 9001 | +| playground-hive | 3307 10000 19000 19083 60070 | +| playground-mysql | 13306 | +| playground-postgresql | 15432 | +| playground-trino | 18080 | +| playground-spark | 14040 | +| playground-jupyter | 18888 | +| playground-prometheus | 19090 | +| playground-grafana | 13000 | ## Playground usage - - ### One curl command launch playground ```shell /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/apache/gravitino-playground/HEAD/install.sh)" @@ -63,100 +62,85 @@ git clone git@github.com:apache/gravitino-playground.git cd gravitino-playground ``` -#### Docker +### Commands -##### Start +Command will be automatically detected runtime environment and execute corresponding commands. -``` -./playground.sh docker start -``` +#### Start -##### Check status -```shell -./playground.sh docker status -``` -##### Stop playground ```shell -./playground.sh docker stop +./playground.sh start ``` -#### Kubernetes - -Enable Kubernetes in Docker Desktop or Orbstack. - -In Project root directory, execute this command: - +#### Check status +```shell +./playground.sh status ``` -helm upgrade --install gravitino-playground ./helm-chart/ --create-namespace --namespace gravitino-playground --set projectRoot=$(pwd) + +#### Stop +```shell +./playground.sh stop ``` -##### Start +### Port Forwarding -``` -./playground.sh k8s start -``` +#### Docker -##### Check status -```shell -./playground.sh k8s status -``` +Will actomaticaly forward the ports to localhost. -##### Port Forwarding +#### Kubernetes -To access pods or services at `localhost`, you needs to do these steps: +Currently, need to manually port-forward the ports to localhost. -1. Log in to the Gravitino playground Trino pod using the following command: +command format: `kubectl port-forward svc/ -n :` -``` -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: +for example: -``` -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 +```shell +# gravitino +kubectl port-forward svc/gravitino -n gravitino-playground 8090:8090 +# jupyternotebook +kubectl port-forward svc/jupyternotebook -n gravitino-playground 18888:18888 ``` -3. Port-forwarding Gravitino Service, so that you can access it at `localhost:8090`. +## Experiencing Apache Gravitino with Trino SQL -``` -kubectl port-forward svc/gravitino -n gravitino-playground 8090:8090 -``` +### Using Trino CLI -4. Port-forwarding Jupyter Notebook Service, so that you can access it at `localhost:8888`. +1. Login to the Gravitino playground Trino service using the following command: -``` -kubectl port-forward svc/jupyternotebook -n gravitino-playground 8888:8888 +```shell +# Docker +docker exec -it playground-trino bash ``` -##### Stop playground ```shell -./playground.sh k8s stop +# Kubernetes +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. Open the Trino CLI in the container. +```shell +trino +``` +## Using Jupyter Notebook -## Experiencing Apache Gravitino with Trino SQL - -### Using Trino CLI in Docker Container - -1. Login to the Gravitino playground Trino Docker container using the following command: +first, port-forward the jupyternotebook service to localhost: ```shell -docker exec -it playground-trino bash -```` - -2. Open the Trino CLI in the container. +# Docker +# Not necessary, because it will be automatically forwarded to localhost +``` ```shell -trino@container_id:/$ trino +# Kubernetes +kubectl port-forward svc/jupyternotebook -n gravitino-playground 18888:18888 ``` -## Using Jupyter Notebook - -1. Open the Jupyter Notebook in the browser at [http://localhost:18888](http://localhost:18888). +1. Open the Jupyter Notebook in the browser [http://localhost:18888](http://localhost:18888). 2. Open the `gravitino-trino-example.ipynb` notebook. @@ -167,16 +151,25 @@ trino@container_id:/$ trino 1. Login to the Gravitino playground Spark Docker container using the following command: ```shell +# Docker docker exec -it playground-spark bash -```` +``` + +```shell +# Kubernetes +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 +``` 2. Open the Spark SQL client in the container. ```shell -spark@container_id:/$ cd /opt/spark && /bin/bash bin/spark-sql +cd /opt/spark && /bin/bash bin/spark-sql ``` -## Monitoring Gravitino +## Monitoring Gravitino(Docker only) + +Currently, not supported in Kubernetes. 1. Open the Grafana in the browser at [http://localhost:13000](http://localhost:13000).