-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#50] Add support for helm chart #56
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
99d0b5d
feat(helm): add helm chart
unknowntpo caf38b5
feat(helm): use hostPath volume instead of configmap
unknowntpo 2cc5adf
feat(helm): ignore packages dir in .helmignore
unknowntpo 6895f77
feat(helm): make k8s jupyternotebook works
unknowntpo 83f6b09
feat(playground.sh): add k8s command
unknowntpo b420ded
feat(playground.sh): refactor k8s command
unknowntpo d4357f6
refactor(README.md): minor tweaks
unknowntpo 09dd4f2
refactor(playground.sh): tweak k8s command: status, stop
unknowntpo 679e08d
refactor(playground.sh): add --namespace option to helm uninstall
unknowntpo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
**/.idea | ||
**/.DS_Store | ||
**/packages | ||
**/*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,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 | ||
|
||
|
@@ -36,7 +37,7 @@ Install Git (optional), Docker, Docker Compose. | |
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 | | ||
|
@@ -48,27 +49,94 @@ The playground runs a number of services. The TCP ports used may clash with exis | |
|
||
## Playground usage | ||
|
||
|
||
|
||
### One curl command launch playground | ||
```shell | ||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/apache/gravitino-playground/HEAD/install.sh)" | ||
``` | ||
|
||
### Use git download and launch playground | ||
### 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 | ||
##### Stop playground | ||
```shell | ||
./playground.sh stop | ||
./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 | ||
``` | ||
|
||
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 k8s stop | ||
``` | ||
|
||
|
||
|
||
|
||
## Experiencing Apache Gravitino with Trino SQL | ||
|
||
|
@@ -105,7 +173,7 @@ 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 | ||
|
@@ -315,3 +383,4 @@ os.environ["OPENAI_API_BASE"] = "" | |
Apache Gravitino is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF. | ||
|
||
<sub>Apache®, Apache Gravitino™, Apache Hive™, Apache Iceberg™, and Apache Spark™ are either registered trademarks or trademarks of the Apache Software Foundation in the United States and/or other countries.</sub> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
set -ex | ||
|
||
# Set Hive connection details | ||
HOST_IP=${HIVE_HOST_IP:-localhost} | ||
HIVE_PORT="10000" | ||
|
||
# Attempt to connect to Hive using curl | ||
curl -s -o /dev/null -w "%{http_code}" http://${HOST_IP}:${HIVE_PORT} | ||
|
||
# Check the HTTP status code | ||
if [ $? -eq 0 ]; then | ||
echo "Hive connection successful" | ||
exit 0 | ||
else | ||
echo "Hive connection failed" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
set -ex | ||
|
||
HOST_IP=${MYSQL_HOST_IP:-localhost} | ||
mysqladmin ping -h ${HOST_IP} -p${MYSQL_ROOT_PASSWORD} | ||
if [ $? -eq 0 ]; then | ||
echo "MySQL container started successfully." | ||
exit 0 | ||
else | ||
echo "MySQL container has not started yet." | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ | ||
|
||
# Ignore these directories because they are too large, we use local-path pv to mount it into Pod | ||
init/*/data/ | ||
init/*/packages/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: v2 | ||
name: gravitino-playground | ||
description: A Helm chart for Gravitino Playground | ||
type: application | ||
version: 0.1.0 | ||
appVersion: "1.0.0" | ||
maintainers: | ||
- name: Your Name | ||
email: [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../healthcheck |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../init |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
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 | ||
``` | ||
|
||
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 | ||
``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The command that print on console is incorrect?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.