-
Notifications
You must be signed in to change notification settings - Fork 416
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
[#6594] feat(deploy): Provide gravitino chart for deploying different storage backend on K8S #6599
base: main
Are you sure you want to change the base?
Changes from all commits
90367a6
b52bd56
0f6eaa5
d14ba03
a4e9bfa
28d5553
bf29410
c3c5a58
795b66a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
name: Test Charts | ||
|
||
# Controls when the workflow will run | ||
on: | ||
pull_request: | ||
branches: [ "main", "branch-*" ] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
changes: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: dorny/paths-filter@v2 | ||
id: filter | ||
with: | ||
filters: | | ||
source_changes: | ||
- .github/workflows/** | ||
- dev/charts/** | ||
outputs: | ||
source_changes: ${{ steps.filter.outputs.source_changes }} | ||
|
||
lint-test: | ||
needs: changes | ||
if: needs.changes.outputs.source_changes == 'true' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Helm | ||
uses: azure/setup-helm@v4.3.0 | ||
|
||
- uses: actions/setup-python@v5.3.0 | ||
with: | ||
python-version: '3.x' | ||
check-latest: true | ||
|
||
- name: Install yamale | ||
run: pip install yamale | ||
|
||
- name: Install chart-testing | ||
run: | | ||
curl -LO https://github.com/helm/chart-testing/releases/download/v3.12.0/chart-testing_3.12.0_linux_amd64.tar.gz | ||
tar -xzf chart-testing_3.12.0_linux_amd64.tar.gz | ||
sudo mv ct /usr/local/bin/ | ||
ct version | ||
|
||
- name: List changed | ||
id: list-changed | ||
run: | | ||
changed=$(ct list-changed --chart-dirs=dev/charts --target-branch ${{ github.event.repository.default_branch }}) | ||
if [[ -n "$changed" ]]; then | ||
echo "changed=true" >> "$GITHUB_OUTPUT" | ||
fi | ||
|
||
- name: Lint | ||
if: steps.list-changed.outputs.changed == 'true' | ||
run: | | ||
helm repo add bitnami https://charts.bitnami.com/bitnami | ||
ct lint --chart-dirs=dev/charts --target-branch ${{ github.event.repository.default_branch }} --chart-yaml-schema=dev/ci/chart_schema.yaml --lint-conf=dev/ci/lintconf.yaml | ||
|
||
- name: Set up kind cluster | ||
if: steps.list-changed.outputs.changed == 'true' | ||
uses: container-tools/kind-action@v2 | ||
with: | ||
version: v0.27.0 | ||
cluster_name: helm-test-cluster | ||
|
||
- name: Set up kubectl | ||
uses: azure/setup-kubectl@v4 | ||
|
||
- name: Run chart-testing (install default) | ||
if: steps.list-changed.outputs.changed == 'true' | ||
run: ct install --chart-dirs=dev/charts --target-branch ${{ github.event.repository.default_branch }} | ||
|
||
- name: Run chart-testing (install mysql enable) | ||
if: steps.list-changed.outputs.changed == 'true' | ||
run: ct install --chart-dirs=dev/charts --helm-extra-set-args "--set=mysql.enabled=true" --target-branch ${{ github.event.repository.default_branch }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# | ||
# 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. | ||
# | ||
# 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 | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this capital "C" the requirement of chart? |
||
# 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. | ||
# | ||
apiVersion: v2 | ||
appVersion: "0.9.0-incubating-SNAPSHOT" | ||
description: Gravitino is a high-performance, geo-distributed, and federated metadata lake. It manages the metadata directly in different sources, types, and regions. It also provides users with unified metadata access for data and AI assets. | ||
home: https://gravitino.apache.org | ||
annotations: | ||
licenses: Apache-2.0 | ||
dependencies: | ||
- condition: mysql.enabled | ||
name: mysql | ||
repository: https://charts.bitnami.com/bitnami | ||
version: 10.2.1 | ||
kubeVersion: '>=1.23.0-0' | ||
maintainers: | ||
- name: Gravitino | ||
email: dev@gravitino.apache.org | ||
url: https://gravitino.apache.org | ||
name: gravitino | ||
sources: | ||
- https://github.com/apache/gravitino | ||
version: 0.1.0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
<!-- | ||
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. | ||
--> | ||
# gravitino | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Capitalize "G" for Gravitino, also add "Apache" for the first time it appears. |
||
|
||
Gravitino is a high-performance, geo-distributed, and federated metadata lake. It manages the | ||
metadata directly in | ||
different sources, types, and regions. It also provides users with unified metadata access | ||
for data and AI assets. | ||
|
||
**Homepage:** <https://gravitino.apache.org/> | ||
|
||
## Maintainers | ||
|
||
| Name | Email | Url | | ||
|-----------|--------------------------|------------------------------| | ||
| Gravitino | dev@gravitino.apache.org | https://gravitino.apache.org | | ||
|
||
## Source Code | ||
|
||
* <https://github.com/apache/gravitino> | ||
* <https://github.com/apache/gravitino-playground> | ||
|
||
## Values | ||
|
||
| Key | Default | Description | | ||
|---------------------|-------------------------------|-----------------------------------------------------------------------| | ||
| image.repository | `"apache/gravitino"` | | | ||
| image.tag | `"0.9.0-incubating-SNAPSHOT"` | | | ||
| image.pullPolicy | `"IfNotPresent"` | | | ||
| image.pullSecrets | `[] ` | Optionally specify secrets for pulling images from a private registry | | ||
| mysql.enabled | `false` | Flag to enable MySQL as the storage backend for Gravitino | | ||
| entity.jdbcUrl | `"jdbc:h2"` | The JDBC URL for the database | | ||
| entity.jdbcDriver | `"org.h2.Driver"` | The JDBC driver class name | | ||
| entity.jdbcUser | `"gravitino"` | The username for the JDBC connection | | ||
| entity.jdbcPassword | `"gravitino"` | The password for the JDBC connection | | ||
| env | `HADOOP_USER_NAME: hdfs ` | Environment variables to pass to the container | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need this env variable? |
||
| resources | `{} ` | esource requests and limits for the container | | ||
|
||
## Deploy gravitino to your cluster | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "Gravitino" |
||
|
||
### Update chart dependency | ||
|
||
```bash | ||
cd charts/gravitino | ||
helm dependency update | ||
``` | ||
|
||
### Deploy with default config | ||
|
||
```bash | ||
helm upgrade --install gravitino ./gravitino -n gravitino --create-namespace | ||
``` | ||
|
||
### Deploy with custom config | ||
|
||
```bash | ||
helm upgrade --install gravitino ./gravitino -n gravitino --create-namespace --set "key1=val1,key2=val2,..." | ||
``` | ||
|
||
## Deploy gravitino and MySQL, MySQL is the gravitino storage backend | ||
|
||
```bash | ||
helm upgrade --install gravitino ./gravitino -n gravitino --create-namespace --set mysql.enabled=true | ||
``` | ||
|
||
To disable dynamic provisioning (The default STORAGECLASS is local-path) | ||
|
||
```bash | ||
helm upgrade --install gravitino ./gravitino -n gravitino --create-namespace --set mysql.enabled=true --set global.defaultStorageClass="-" | ||
``` | ||
|
||
## Deploy gravitino, use the existed MySQL as the gravitino storage backend | ||
|
||
```bash | ||
helm upgrade --install gravitino ./gravitino -n gravitino --create-namespace --set entity.jdbcUrl="jdbc:mysql://database-1.***.***.rds.amazonaws.com:3306/gravitino" --set entity.jdbcDriver="com.mysql.cj.jdbc.Driver" --set entity.jdbcUser=admin --set entity.jdbcPassword=admin123 | ||
``` | ||
|
||
## Others | ||
|
||
To init the existed MySQL, run the following command: | ||
|
||
```bash | ||
mysql -h database-1.***.***.rds.amazonaws.com -P 3306 -u <YOUR-USERNAME> -p <YOUR-PASSWORD> < schema-0.*.0-mysql.sql | ||
``` | ||
|
||
To see the "gravitino.conf", run the following command: | ||
|
||
```bash | ||
kubectl get cm gravitino -n gravitino -o json | jq -r '.data["gravitino.conf"]' | ||
``` | ||
|
||
To uninstall the gravitino, run the following command: | ||
|
||
```bash | ||
helm uninstall gravitino -n gravitino | ||
``` | ||
|
||
To package chart | ||
|
||
```bash | ||
helm package gravitino | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/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. | ||
# | ||
|
||
echo "Start to download the jar package of JDBC" | ||
wget https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.27/mysql-connector-java-8.0.27.jar -O /root/gravitino/catalogs/jdbc-mysql/libs/mysql-connector-java-8.0.27.jar | ||
wget https://jdbc.postgresql.org/download/postgresql-42.7.0.jar -O /root/gravitino/catalogs/jdbc-postgresql/libs/postgresql-42.7.0.jar | ||
cp /root/gravitino/catalogs/jdbc-postgresql/libs/postgresql-42.7.0.jar /root/gravitino/catalogs/lakehouse-iceberg/libs | ||
cp /root/gravitino/catalogs/jdbc-mysql/libs/mysql-connector-java-8.0.27.jar /root/gravitino/catalogs/lakehouse-iceberg/libs | ||
cp /root/gravitino/catalogs/jdbc-mysql/libs/mysql-connector-java-8.0.27.jar /root/gravitino/libs | ||
echo "Finish downloading" | ||
cp /root/gravitino/tmp/conf/* /root/gravitino/conf | ||
# Redirect log files to container stdout and stderr | ||
ln -sf /dev/stdout /root/gravitino/logs/gravitino-server.log | ||
ln -sf /dev/stderr /root/gravitino/logs/gravitino-server.out | ||
echo "Start the Gravitino Server" | ||
/bin/bash /root/gravitino/bin/gravitino.sh start |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../../scripts/mysql |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{{- /* | ||
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. | ||
*/}} | ||
The gravitino has been deployed to your cluster. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the usage of this file? |
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.
What Is the license of helm chart-testing?