This is an automated email from the ASF dual-hosted git repository.
roryqi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino-playground.git
The following commit(s) were added to refs/heads/main by this push:
new 8a35449 [MINOR] chore: Upgrade playground to Gravitino 1.3.1 and fix
Jupyter demos (#163)
8a35449 is described below
commit 8a35449d80064bd7c420ea1292864e763c38ebf3
Author: geyanggang <[email protected]>
AuthorDate: Tue Nov 17 09:55:17 2026 +0800
[MINOR] chore: Upgrade playground to Gravitino 1.3.1 and fix Jupyter demos
(#163)
### What changes were proposed in this pull request?
This PR upgrades the playground to Gravitino 1.3.1 and fixes the Jupyter
demos so they all run cleanly on it. It carries two commits:
1. **Upgrade the playground to Gravitino 1.3.1** (by @markhoerth, from
#162, unchanged)
- Gravitino server, MCP server and Trino (`trino-478-gravitino-1.3.1`)
images, Spark connector runtime and Python client `apache-gravitino`
1.3.1.
- Bundled jars: Kyuubi Spark authz shaded 1.10.2, MySQL
`com.mysql:mysql-connector-j` 8.0.33, PostgreSQL 42.7.11, Iceberg Spark
runtime 3.4 1.10.2; `trino` Python client 0.340.0.
2. **Fix the Jupyter demos on Gravitino 1.3.1**
- `init/hive/core-site.xml`: HDFS umask `002` -> `000`. Table
directories are created by the Hive metastore as `root` (mode 775), so
Spark writes as `anonymous` (spark-trino demo) or `lisa` (Ranger demo)
failed with `Permission denied ... .hive-staging`. Authorization in the
Ranger demo is still enforced at the SQL layer by Ranger/Kyuubi.
- `init/hive/hdfs-site.xml`: pin `dfs.namenode.http-address` to
`0.0.0.0:50070`. With `--enable-ranger` the Hive container runs Hadoop
3, whose default is 9870, so WebHDFS in the fileset demo and the
`60070:50070` port mapping did not work.
- `gravitino-mcp-demo.ipynb`: `mcp>=1.2.0` now resolves to mcp 2.x,
which renamed `streamablehttp_client` to `streamable_http_client`
(yielding `(read, write)`), causing `ImportError`. Switch to the 2.x API
and pin `mcp>=2,<3`, which is also what current `llama-index-tools-mcp`
requires.
- `gravitino-access-control-example.ipynb`:
- Create the `access_control` schema before the `developer`/`analyst`
roles, since Gravitino rejects roles whose securable objects do not
exist (`IllegalMetadataObjectException`).
- Wait briefly after granting/revoking roles. Gravitino pushes the
change to Ranger at once, but the Ranger plugin in the Spark session
picks it up on its next refresh, so on a re-run the "denied" insert
could still succeed.
- `gravitino-fileset-example.ipynb`: remove the external fileset's
directory before dropping the schema. Gravitino only deletes a schema
location when it is empty, so the cleanup step reported `Unexpected:
storage location /user/gravitino/schema was not deleted`.
The notebook changes are applied identically to `init/jupyter/` and
`init/jupyter/authorization/`.
### Why are the changes needed?
To upgrade the playground to Gravitino 1.3.1 with every demo working out
of the box. Without the second commit, the spark-trino, MCP,
access-control (Ranger) and fileset (Ranger mode) notebooks fail or
print unexpected results.
Fix: #(issue)
### Does this PR introduce _any_ user-facing change?
- Image, jar and Python client versions are bumped as listed above.
- HDFS in the playground now uses umask `000`, so any playground user
can write to directories created by the Hive metastore. This only
applies to this single-node demo environment.
- Existing users who already have notebooks in `data/jupyter/data/` keep
their old copies (the init script does not overwrite them). Move them
aside to pick up the fixed notebooks.
### How was this patch tested?
Tested locally on macOS (arm64, OrbStack). Each mode was started from a
fully clean state (`docker compose down -v` plus a cleared
`data/gravitino`):
- Default, `--enable-auth` and `--enable-ranger`: all containers
healthy, Gravitino reports 1.3.1.
- Backend checks: catalog/schema/table creation through the REST API for
MySQL, PostgreSQL, Hive and Iceberg catalogs; a Trino join across all
four catalogs; Spark SQL on the Iceberg, Hive and Iceberg REST
(`catalog_rest`) catalogs; Gravitino MCP server (`tools/list` returns 36
tools, `get_list_of_catalogs` returns data); Prometheus target up and
Grafana healthy.
- Notebooks were executed headless with `jupyter nbconvert --execute`
inside the Jupyter container. Any error output, `Unexpected` or
`Failed:` message counted as a failure:
- Default and `--enable-auth`: trino, spark-trino, fileset, gvfs and
mcp-demo. All passed, and re-runs of spark-trino and fileset passed too.
- `--enable-ranger`: access-control, trino, spark-trino, fileset, gvfs
and mcp-demo. All passed. Access-control was re-run several times in the
same environment, and `lisa`'s insert as analyst was denied every time.
- `gravitino_llamaIndex_demo.ipynb` and the agentic section of
`gravitino-mcp-demo.ipynb` were not run because they need an LLM API
key.
---------
Co-authored-by: Mark Hoerth <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
---
.env | 8 ++---
docker-mcp-override.yaml | 2 +-
init/gravitino/gravitino-dependency.sh | 4 +--
init/gravitino/init.sh | 12 ++++----
init/hive/core-site.xml | 4 ++-
init/hive/hdfs-site.xml | 9 ++++++
.../gravitino-access-control-example.ipynb | 34 ++++++++++++++++++----
.../authorization/gravitino-fileset-example.ipynb | 9 ++++--
.../authorization/gravitino-gvfs-example.ipynb | 2 +-
.../jupyter/authorization/gravitino-mcp-demo.ipynb | 8 ++---
.../gravitino-spark-trino-example.ipynb | 4 +--
.../authorization/gravitino-trino-example.ipynb | 2 +-
.../authorization/gravitino_llamaIndex_demo.ipynb | 4 +--
.../jupyter/gravitino-access-control-example.ipynb | 34 ++++++++++++++++++----
init/jupyter/gravitino-fileset-example.ipynb | 9 ++++--
init/jupyter/gravitino-gvfs-example.ipynb | 2 +-
init/jupyter/gravitino-mcp-demo.ipynb | 8 ++---
init/jupyter/gravitino-spark-trino-example.ipynb | 4 +--
init/jupyter/gravitino-trino-example.ipynb | 2 +-
init/jupyter/gravitino_llamaIndex_demo.ipynb | 4 +--
init/spark/init.sh | 6 ++--
init/spark/spark-dependency.sh | 6 ++--
22 files changed, 121 insertions(+), 56 deletions(-)
diff --git a/.env b/.env
index 1a45a14..62c4f07 100644
--- a/.env
+++ b/.env
@@ -1,8 +1,8 @@
# Image tags for the docker-compose file
HIVE_IMAGE_TAG=hive-0.1.15
RANGER_IMAGE_TAG=ranger-0.1.0
-GRAVITINO_IMAGE_TAG=1.3.0
-TRINO_IMAGE_TAG=trino-478-gravitino-1.3.0
+GRAVITINO_IMAGE_TAG=1.3.1
+TRINO_IMAGE_TAG=trino-478-gravitino-1.3.1
POSTGRESQL_IMAGE_TAG=13
MYSQL_IMAGE_TAG=8.0
SPARK_IMAGE_TAG=3.4.1-scala2.12-java11-ubuntu
@@ -11,6 +11,6 @@ PROMETHEUS_IMAGE_TAG=v2.55.0
GRAFANA_IMAGE_TAG=11.3.0-ubuntu
# Gravitino jars for containers
-SPARK_CONNECTOR_JAR=gravitino-spark-connector-runtime-3.4_2.12-1.3.0.jar
+SPARK_CONNECTOR_JAR=gravitino-spark-connector-runtime-3.4_2.12-1.3.1.jar
-GRAVITINO_VERSION=1.3.0
+GRAVITINO_VERSION=1.3.1
diff --git a/docker-mcp-override.yaml b/docker-mcp-override.yaml
index 2eb440c..27cfeae 100644
--- a/docker-mcp-override.yaml
+++ b/docker-mcp-override.yaml
@@ -33,7 +33,7 @@
#
services:
gravitino-mcp:
- image: apache/gravitino-mcp-server:${GRAVITINO_MCP_IMAGE_TAG:-1.3.0}
+ image: apache/gravitino-mcp-server:${GRAVITINO_MCP_IMAGE_TAG:-1.3.1}
container_name: playground-gravitino-mcp
command:
- --metalake
diff --git a/init/gravitino/gravitino-dependency.sh
b/init/gravitino/gravitino-dependency.sh
index c3a2a29..a0c492e 100755
--- a/init/gravitino/gravitino-dependency.sh
+++ b/init/gravitino/gravitino-dependency.sh
@@ -28,10 +28,10 @@ if [[ ! -d "${gravitino_dir}/packages" ]]; then
mkdir -p "${gravitino_dir}/packages"
fi
# Prepare download packages
-MYSQL_CONNECTOR_JAVA_JAR="https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.27/mysql-connector-java-8.0.27.jar"
+MYSQL_CONNECTOR_JAVA_JAR="https://repo1.maven.org/maven2/com/mysql/mysql-connector-j/8.0.33/mysql-connector-j-8.0.33.jar"
MYSQL_CONNECTOR_JAVA_MD5="${MYSQL_CONNECTOR_JAVA_JAR}.md5"
download_and_verify "${MYSQL_CONNECTOR_JAVA_JAR}"
"${MYSQL_CONNECTOR_JAVA_MD5}" "${gravitino_dir}"
-POSTGRESQL_JAR="https://repo1.maven.org/maven2/org/postgresql/postgresql/42.2.7/postgresql-42.2.7.jar"
+POSTGRESQL_JAR="https://repo1.maven.org/maven2/org/postgresql/postgresql/42.7.11/postgresql-42.7.11.jar"
POSTGRESQL_MD5="${POSTGRESQL_JAR}.md5"
download_and_verify "${POSTGRESQL_JAR}" "${POSTGRESQL_MD5}" "${gravitino_dir}"
diff --git a/init/gravitino/init.sh b/init/gravitino/init.sh
index 65de9be..c4fac13 100755
--- a/init/gravitino/init.sh
+++ b/init/gravitino/init.sh
@@ -29,18 +29,18 @@ echo "Using GRAVITINO_HOME=${GRAVITINO_HOME}"
echo "Start to copy JDBC driver jars"
# Copy JDBC drivers to catalog libs (1.3 image already has them via entrypoint
symlinks,
# but we ensure they exist for both old and new images)
-if [ -f /tmp/gravitino/packages/mysql-connector-java-8.0.27.jar ]; then
- cp -f /tmp/gravitino/packages/mysql-connector-java-8.0.27.jar
${GRAVITINO_HOME}/catalogs/jdbc-mysql/libs/ 2>/dev/null || true
+if [ -f /tmp/gravitino/packages/mysql-connector-j-8.0.33.jar ]; then
+ cp -f /tmp/gravitino/packages/mysql-connector-j-8.0.33.jar
${GRAVITINO_HOME}/catalogs/jdbc-mysql/libs/ 2>/dev/null || true
fi
-if [ -f /tmp/gravitino/packages/postgresql-42.2.7.jar ]; then
- cp -f /tmp/gravitino/packages/postgresql-42.2.7.jar
${GRAVITINO_HOME}/catalogs/jdbc-postgresql/libs/ 2>/dev/null || true
+if [ -f /tmp/gravitino/packages/postgresql-42.7.11.jar ]; then
+ cp -f /tmp/gravitino/packages/postgresql-42.7.11.jar
${GRAVITINO_HOME}/catalogs/jdbc-postgresql/libs/ 2>/dev/null || true
fi
# Copy JDBC drivers to lakehouse-iceberg and iceberg-rest-server libs
for target_dir in "${GRAVITINO_HOME}/catalogs/lakehouse-iceberg/libs"
"${GRAVITINO_HOME}/iceberg-rest-server/libs"; do
if [ -d "${target_dir}" ]; then
- cp -f /tmp/gravitino/packages/mysql-connector-java-8.0.27.jar
"${target_dir}/" 2>/dev/null || true
- cp -f /tmp/gravitino/packages/postgresql-42.2.7.jar "${target_dir}/"
2>/dev/null || true
+ cp -f /tmp/gravitino/packages/mysql-connector-j-8.0.33.jar
"${target_dir}/" 2>/dev/null || true
+ cp -f /tmp/gravitino/packages/postgresql-42.7.11.jar "${target_dir}/"
2>/dev/null || true
fi
done
diff --git a/init/hive/core-site.xml b/init/hive/core-site.xml
index ded121f..6b0911e 100644
--- a/init/hive/core-site.xml
+++ b/init/hive/core-site.xml
@@ -39,8 +39,10 @@
<value>*</value>
</property>
+ <!-- Single-node demo: let every playground user (anonymous, lisa, manager,
...)
+ write to directories created by the Hive metastore (owned by root). -->
<property>
<name>fs.permissions.umask-mode</name>
- <value>002</value>
+ <value>000</value>
</property>
</configuration>
diff --git a/init/hive/hdfs-site.xml b/init/hive/hdfs-site.xml
index 10cde71..02b7299 100644
--- a/init/hive/hdfs-site.xml
+++ b/init/hive/hdfs-site.xml
@@ -37,4 +37,13 @@
<name>dfs.datanode.hostname</name>
<value>hive</value>
</property>
+ <!--
+ Pin the NameNode web/WebHDFS port to 50070. That is the Hadoop 2 default,
+ but the Hadoop 3 runtime used with enable-ranger defaults to 9870, which
+ breaks the fileset notebook (WebHDFS) and the 60070:50070 port mapping.
+ -->
+ <property>
+ <name>dfs.namenode.http-address</name>
+ <value>0.0.0.0:50070</value>
+ </property>
</configuration>
diff --git a/init/jupyter/authorization/gravitino-access-control-example.ipynb
b/init/jupyter/authorization/gravitino-access-control-example.ipynb
index 47702d4..b380f9b 100644
--- a/init/jupyter/authorization/gravitino-access-control-example.ipynb
+++ b/init/jupyter/authorization/gravitino-access-control-example.ipynb
@@ -88,7 +88,7 @@
"source": [
"### Create a Hive catalog with Ranger authorization\n",
"\n",
- "The catalog is created with `authorization-provider = ranger`, so
Gravitino pushes its role grants down into Ranger, which enforces them on Hive
access."
+ "The catalog is created with `authorization-provider = ranger`, so
Gravitino pushes its role grants down into Ranger, which enforces them on Hive
access. The same cell also creates the `access_control` schema that the roles
below are granted on."
]
},
{
@@ -124,7 +124,15 @@
" }\n",
"}\n",
"response = requests.post(url, headers=headers, data=json.dumps(data))\n",
- "show(response, \"catalog catalog_hive_ranger\")"
+ "show(response, \"catalog catalog_hive_ranger\")\n",
+ "\n",
+ "# Create the schema the roles below refer to. Gravitino validates that
a\n",
+ "# role's securable objects exist, so the schema must exist before the\n",
+ "# developer/analyst roles are created.\n",
+ "schema_url = f\"{url}/catalog_hive_ranger/schemas\"\n",
+ "response = requests.post(schema_url, headers=headers,\n",
+ " data=json.dumps({\"name\": \"access_control\",
\"comment\": \"\", \"properties\": {}}))\n",
+ "show(response, \"schema access_control\")"
]
},
{
@@ -154,9 +162,9 @@
"spark = SparkSession.builder \\\n",
" .appName(\"Access Control Demo\") \\\n",
" .config(\"spark.plugins\",
\"org.apache.gravitino.spark.connector.plugin.GravitinoSparkPlugin\") \\\n",
- " .config(\"spark.jars\",
f\"/tmp/gravitino/packages/iceberg-spark-runtime-3.4_2.12-1.10.0.jar,\\\n",
+ " .config(\"spark.jars\",
f\"/tmp/gravitino/packages/iceberg-spark-runtime-3.4_2.12-1.10.2.jar,\\\n",
"
/tmp/gravitino/packages/{gravitino_connector_jar},\\\n",
- "
/tmp/gravitino/packages/kyuubi-spark-authz-shaded_2.12-1.9.2.jar\") \\\n",
+ "
/tmp/gravitino/packages/kyuubi-spark-authz-shaded_2.12-1.10.2.jar\") \\\n",
" .config(\"spark.sql.gravitino.uri\", \"http://gravitino:8090\") \\\n",
" .config(\"spark.sql.gravitino.metalake\", \"metalake_demo\") \\\n",
" .config(\"spark.sql.gravitino.enableIcebergSupport\", \"true\") \\\n",
@@ -211,7 +219,14 @@
"show(requests.post(url, headers=headers, data=json.dumps(data)), \"role
developer\")\n",
"\n",
"grant =
\"http://gravitino:8090/api/metalakes/metalake_demo/permissions/users/lisa/grant\"\n",
- "show(requests.put(grant, headers=headers, data=json.dumps({\"roleNames\":
[\"developer\"]})), \"grant developer to lisa\")"
+ "show(requests.put(grant, headers=headers, data=json.dumps({\"roleNames\":
[\"developer\"]})), \"grant developer to lisa\")\n",
+ "\n",
+ "# Gravitino pushes role changes to Ranger immediately, but the Ranger
plugin\n",
+ "# inside the Spark session only picks them up on its next policy
refresh.\n",
+ "# Cells run one after another, so pause briefly before the next Spark
query\n",
+ "# relies on the new privileges.\n",
+ "import time\n",
+ "time.sleep(5)"
]
},
{
@@ -307,7 +322,14 @@
"show(requests.post(url, headers=headers, data=json.dumps(data)), \"role
analyst\")\n",
"\n",
"grant =
\"http://gravitino:8090/api/metalakes/metalake_demo/permissions/users/lisa/grant\"\n",
- "show(requests.put(grant, headers=headers, data=json.dumps({\"roleNames\":
[\"analyst\"]})), \"grant analyst to lisa\")"
+ "show(requests.put(grant, headers=headers, data=json.dumps({\"roleNames\":
[\"analyst\"]})), \"grant analyst to lisa\")\n",
+ "\n",
+ "# Gravitino pushes role changes to Ranger immediately, but the Ranger
plugin\n",
+ "# inside the Spark session only picks them up on its next policy
refresh.\n",
+ "# Cells run one after another, so pause briefly before the next Spark
query\n",
+ "# relies on the new privileges.\n",
+ "import time\n",
+ "time.sleep(5)"
]
},
{
diff --git a/init/jupyter/authorization/gravitino-fileset-example.ipynb
b/init/jupyter/authorization/gravitino-fileset-example.ipynb
index e8bf30a..4970f1d 100755
--- a/init/jupyter/authorization/gravitino-fileset-example.ipynb
+++ b/init/jupyter/authorization/gravitino-fileset-example.ipynb
@@ -69,7 +69,7 @@
"source": [
"## Connect to Gravitino and create a metalake\n",
"\n",
- "Install the Gravitino Python client (matching the 1.3.0 server), then use
the admin client to create a metalake. A metalake is the top-level container
that holds catalogs."
+ "Install the Gravitino Python client (matching the 1.3.1 server), then use
the admin client to create a metalake. A metalake is the top-level container
that holds catalogs."
]
},
{
@@ -79,7 +79,7 @@
"metadata": {},
"outputs": [],
"source": [
- "%pip install -q apache-gravitino==1.3.0"
+ "%pip install -q apache-gravitino==1.3.1"
]
},
{
@@ -422,6 +422,11 @@
"metadata": {},
"outputs": [],
"source": [
+ "# The external fileset's directory was provisioned by us and survives
its\n",
+ "# fileset being dropped, so remove it ourselves. Gravitino only deletes
a\n",
+ "# schema's location when it is empty.\n",
+ "hdfs_client.delete(external_fileset_path, recursive=True)\n",
+ "\n",
"# Drop the schema (cascade removes remaining contents).\n",
"catalog.as_schemas().drop_schema(schema_name=schema_name,
cascade=True)\n",
"\n",
diff --git a/init/jupyter/authorization/gravitino-gvfs-example.ipynb
b/init/jupyter/authorization/gravitino-gvfs-example.ipynb
index 160b8e3..6d4ed54 100755
--- a/init/jupyter/authorization/gravitino-gvfs-example.ipynb
+++ b/init/jupyter/authorization/gravitino-gvfs-example.ipynb
@@ -32,7 +32,7 @@
"outputs": [],
"source": [
"%pip install -q --upgrade pip setuptools wheel\n",
- "%pip install -q apache-gravitino==1.3.0 fsspec"
+ "%pip install -q apache-gravitino==1.3.1 fsspec"
]
},
{
diff --git a/init/jupyter/authorization/gravitino-mcp-demo.ipynb
b/init/jupyter/authorization/gravitino-mcp-demo.ipynb
index a0752b5..26f7a6d 100755
--- a/init/jupyter/authorization/gravitino-mcp-demo.ipynb
+++ b/init/jupyter/authorization/gravitino-mcp-demo.ipynb
@@ -35,7 +35,7 @@
"metadata": {},
"outputs": [],
"source": [
- "%pip install -q \"mcp>=1.2.0\"\n",
+ "%pip install -q \"mcp>=2,<3\"\n",
"# Only needed for the agentic section (Section 3). Both provider LLMs
are\n",
"# installed so the notebook works with whichever key you have (Anthropic
or OpenAI).\n",
"%pip install -q \"llama-index-core\" \"llama-index-tools-mcp\" \\\n",
@@ -60,14 +60,14 @@
"outputs": [],
"source": [
"from mcp import ClientSession\n",
- "from mcp.client.streamable_http import streamablehttp_client\n",
+ "from mcp.client.streamable_http import streamable_http_client\n",
"\n",
"# In-network address of the MCP server (compose service name). If you run
this\n",
"# notebook outside the playground, change to
http://localhost:8000/mcp.\n",
"MCP_URL = \"http://gravitino-mcp:8000/mcp\"\n",
"\n",
"async def list_tools():\n",
- " async with streamablehttp_client(MCP_URL) as (read, write, _):\n",
+ " async with streamable_http_client(MCP_URL) as (read, write):\n",
" async with ClientSession(read, write) as session:\n",
" await session.initialize()\n",
" resp = await session.list_tools()\n",
@@ -107,7 +107,7 @@
"import json\n",
"\n",
"async def call_tool(name, args=None):\n",
- " async with streamablehttp_client(MCP_URL) as (read, write, _):\n",
+ " async with streamable_http_client(MCP_URL) as (read, write):\n",
" async with ClientSession(read, write) as session:\n",
" await session.initialize()\n",
" result = await session.call_tool(name, args or {})\n",
diff --git a/init/jupyter/authorization/gravitino-spark-trino-example.ipynb
b/init/jupyter/authorization/gravitino-spark-trino-example.ipynb
index d3cf4da..b212292 100644
--- a/init/jupyter/authorization/gravitino-spark-trino-example.ipynb
+++ b/init/jupyter/authorization/gravitino-spark-trino-example.ipynb
@@ -38,7 +38,7 @@
"spark = SparkSession.builder \\\n",
" .appName(\"PySpark SQL Example\") \\\n",
" .config(\"spark.plugins\",
\"org.apache.gravitino.spark.connector.plugin.GravitinoSparkPlugin\") \\\n",
- " .config(\"spark.jars\",
f\"/tmp/gravitino/packages/iceberg-spark-runtime-3.4_2.12-1.10.0.jar,/tmp/gravitino/packages/{gravitino_connector_jar}\")
\\\n",
+ " .config(\"spark.jars\",
f\"/tmp/gravitino/packages/iceberg-spark-runtime-3.4_2.12-1.10.2.jar,/tmp/gravitino/packages/{gravitino_connector_jar}\")
\\\n",
" .config(\"spark.sql.gravitino.uri\", \"http://gravitino:8090\") \\\n",
" .config(\"spark.sql.gravitino.metalake\", \"metalake_demo\") \\\n",
" .config(\"spark.sql.gravitino.enableIcebergSupport\", \"true\") \\\n",
@@ -141,7 +141,7 @@
"outputs": [],
"source": [
"%pip install -q pandas\n",
- "%pip install -q trino==0.335.0"
+ "%pip install -q trino==0.340.0"
]
},
{
diff --git a/init/jupyter/authorization/gravitino-trino-example.ipynb
b/init/jupyter/authorization/gravitino-trino-example.ipynb
index 3b0817c..1ce7b7e 100644
--- a/init/jupyter/authorization/gravitino-trino-example.ipynb
+++ b/init/jupyter/authorization/gravitino-trino-example.ipynb
@@ -19,7 +19,7 @@
"source": [
"# install trino python client and pandas\n",
"%pip install -q pandas\n",
- "%pip install -q trino==0.335.0"
+ "%pip install -q trino==0.340.0"
]
},
{
diff --git a/init/jupyter/authorization/gravitino_llamaIndex_demo.ipynb
b/init/jupyter/authorization/gravitino_llamaIndex_demo.ipynb
index 92c485b..38ea5dc 100755
--- a/init/jupyter/authorization/gravitino_llamaIndex_demo.ipynb
+++ b/init/jupyter/authorization/gravitino_llamaIndex_demo.ipynb
@@ -48,13 +48,13 @@
"source": [
"%pip install -q --upgrade pip setuptools wheel\n",
"%pip install -q \\\n",
- " trino==0.335.0 \\\n",
+ " trino==0.340.0 \\\n",
" \"llama-index==0.12.52\" \\\n",
" llama-index-readers-wikipedia \\\n",
" llama-index-readers-file \\\n",
" llama-index-llms-openai \\\n",
" llama-index-question-gen-openai \\\n",
- " apache-gravitino==1.3.0 \\\n",
+ " apache-gravitino==1.3.1 \\\n",
" sqlalchemy-trino"
]
},
diff --git a/init/jupyter/gravitino-access-control-example.ipynb
b/init/jupyter/gravitino-access-control-example.ipynb
index 47702d4..b380f9b 100755
--- a/init/jupyter/gravitino-access-control-example.ipynb
+++ b/init/jupyter/gravitino-access-control-example.ipynb
@@ -88,7 +88,7 @@
"source": [
"### Create a Hive catalog with Ranger authorization\n",
"\n",
- "The catalog is created with `authorization-provider = ranger`, so
Gravitino pushes its role grants down into Ranger, which enforces them on Hive
access."
+ "The catalog is created with `authorization-provider = ranger`, so
Gravitino pushes its role grants down into Ranger, which enforces them on Hive
access. The same cell also creates the `access_control` schema that the roles
below are granted on."
]
},
{
@@ -124,7 +124,15 @@
" }\n",
"}\n",
"response = requests.post(url, headers=headers, data=json.dumps(data))\n",
- "show(response, \"catalog catalog_hive_ranger\")"
+ "show(response, \"catalog catalog_hive_ranger\")\n",
+ "\n",
+ "# Create the schema the roles below refer to. Gravitino validates that
a\n",
+ "# role's securable objects exist, so the schema must exist before the\n",
+ "# developer/analyst roles are created.\n",
+ "schema_url = f\"{url}/catalog_hive_ranger/schemas\"\n",
+ "response = requests.post(schema_url, headers=headers,\n",
+ " data=json.dumps({\"name\": \"access_control\",
\"comment\": \"\", \"properties\": {}}))\n",
+ "show(response, \"schema access_control\")"
]
},
{
@@ -154,9 +162,9 @@
"spark = SparkSession.builder \\\n",
" .appName(\"Access Control Demo\") \\\n",
" .config(\"spark.plugins\",
\"org.apache.gravitino.spark.connector.plugin.GravitinoSparkPlugin\") \\\n",
- " .config(\"spark.jars\",
f\"/tmp/gravitino/packages/iceberg-spark-runtime-3.4_2.12-1.10.0.jar,\\\n",
+ " .config(\"spark.jars\",
f\"/tmp/gravitino/packages/iceberg-spark-runtime-3.4_2.12-1.10.2.jar,\\\n",
"
/tmp/gravitino/packages/{gravitino_connector_jar},\\\n",
- "
/tmp/gravitino/packages/kyuubi-spark-authz-shaded_2.12-1.9.2.jar\") \\\n",
+ "
/tmp/gravitino/packages/kyuubi-spark-authz-shaded_2.12-1.10.2.jar\") \\\n",
" .config(\"spark.sql.gravitino.uri\", \"http://gravitino:8090\") \\\n",
" .config(\"spark.sql.gravitino.metalake\", \"metalake_demo\") \\\n",
" .config(\"spark.sql.gravitino.enableIcebergSupport\", \"true\") \\\n",
@@ -211,7 +219,14 @@
"show(requests.post(url, headers=headers, data=json.dumps(data)), \"role
developer\")\n",
"\n",
"grant =
\"http://gravitino:8090/api/metalakes/metalake_demo/permissions/users/lisa/grant\"\n",
- "show(requests.put(grant, headers=headers, data=json.dumps({\"roleNames\":
[\"developer\"]})), \"grant developer to lisa\")"
+ "show(requests.put(grant, headers=headers, data=json.dumps({\"roleNames\":
[\"developer\"]})), \"grant developer to lisa\")\n",
+ "\n",
+ "# Gravitino pushes role changes to Ranger immediately, but the Ranger
plugin\n",
+ "# inside the Spark session only picks them up on its next policy
refresh.\n",
+ "# Cells run one after another, so pause briefly before the next Spark
query\n",
+ "# relies on the new privileges.\n",
+ "import time\n",
+ "time.sleep(5)"
]
},
{
@@ -307,7 +322,14 @@
"show(requests.post(url, headers=headers, data=json.dumps(data)), \"role
analyst\")\n",
"\n",
"grant =
\"http://gravitino:8090/api/metalakes/metalake_demo/permissions/users/lisa/grant\"\n",
- "show(requests.put(grant, headers=headers, data=json.dumps({\"roleNames\":
[\"analyst\"]})), \"grant analyst to lisa\")"
+ "show(requests.put(grant, headers=headers, data=json.dumps({\"roleNames\":
[\"analyst\"]})), \"grant analyst to lisa\")\n",
+ "\n",
+ "# Gravitino pushes role changes to Ranger immediately, but the Ranger
plugin\n",
+ "# inside the Spark session only picks them up on its next policy
refresh.\n",
+ "# Cells run one after another, so pause briefly before the next Spark
query\n",
+ "# relies on the new privileges.\n",
+ "import time\n",
+ "time.sleep(5)"
]
},
{
diff --git a/init/jupyter/gravitino-fileset-example.ipynb
b/init/jupyter/gravitino-fileset-example.ipynb
index e8bf30a..4970f1d 100644
--- a/init/jupyter/gravitino-fileset-example.ipynb
+++ b/init/jupyter/gravitino-fileset-example.ipynb
@@ -69,7 +69,7 @@
"source": [
"## Connect to Gravitino and create a metalake\n",
"\n",
- "Install the Gravitino Python client (matching the 1.3.0 server), then use
the admin client to create a metalake. A metalake is the top-level container
that holds catalogs."
+ "Install the Gravitino Python client (matching the 1.3.1 server), then use
the admin client to create a metalake. A metalake is the top-level container
that holds catalogs."
]
},
{
@@ -79,7 +79,7 @@
"metadata": {},
"outputs": [],
"source": [
- "%pip install -q apache-gravitino==1.3.0"
+ "%pip install -q apache-gravitino==1.3.1"
]
},
{
@@ -422,6 +422,11 @@
"metadata": {},
"outputs": [],
"source": [
+ "# The external fileset's directory was provisioned by us and survives
its\n",
+ "# fileset being dropped, so remove it ourselves. Gravitino only deletes
a\n",
+ "# schema's location when it is empty.\n",
+ "hdfs_client.delete(external_fileset_path, recursive=True)\n",
+ "\n",
"# Drop the schema (cascade removes remaining contents).\n",
"catalog.as_schemas().drop_schema(schema_name=schema_name,
cascade=True)\n",
"\n",
diff --git a/init/jupyter/gravitino-gvfs-example.ipynb
b/init/jupyter/gravitino-gvfs-example.ipynb
index 160b8e3..6d4ed54 100755
--- a/init/jupyter/gravitino-gvfs-example.ipynb
+++ b/init/jupyter/gravitino-gvfs-example.ipynb
@@ -32,7 +32,7 @@
"outputs": [],
"source": [
"%pip install -q --upgrade pip setuptools wheel\n",
- "%pip install -q apache-gravitino==1.3.0 fsspec"
+ "%pip install -q apache-gravitino==1.3.1 fsspec"
]
},
{
diff --git a/init/jupyter/gravitino-mcp-demo.ipynb
b/init/jupyter/gravitino-mcp-demo.ipynb
index a0752b5..26f7a6d 100755
--- a/init/jupyter/gravitino-mcp-demo.ipynb
+++ b/init/jupyter/gravitino-mcp-demo.ipynb
@@ -35,7 +35,7 @@
"metadata": {},
"outputs": [],
"source": [
- "%pip install -q \"mcp>=1.2.0\"\n",
+ "%pip install -q \"mcp>=2,<3\"\n",
"# Only needed for the agentic section (Section 3). Both provider LLMs
are\n",
"# installed so the notebook works with whichever key you have (Anthropic
or OpenAI).\n",
"%pip install -q \"llama-index-core\" \"llama-index-tools-mcp\" \\\n",
@@ -60,14 +60,14 @@
"outputs": [],
"source": [
"from mcp import ClientSession\n",
- "from mcp.client.streamable_http import streamablehttp_client\n",
+ "from mcp.client.streamable_http import streamable_http_client\n",
"\n",
"# In-network address of the MCP server (compose service name). If you run
this\n",
"# notebook outside the playground, change to
http://localhost:8000/mcp.\n",
"MCP_URL = \"http://gravitino-mcp:8000/mcp\"\n",
"\n",
"async def list_tools():\n",
- " async with streamablehttp_client(MCP_URL) as (read, write, _):\n",
+ " async with streamable_http_client(MCP_URL) as (read, write):\n",
" async with ClientSession(read, write) as session:\n",
" await session.initialize()\n",
" resp = await session.list_tools()\n",
@@ -107,7 +107,7 @@
"import json\n",
"\n",
"async def call_tool(name, args=None):\n",
- " async with streamablehttp_client(MCP_URL) as (read, write, _):\n",
+ " async with streamable_http_client(MCP_URL) as (read, write):\n",
" async with ClientSession(read, write) as session:\n",
" await session.initialize()\n",
" result = await session.call_tool(name, args or {})\n",
diff --git a/init/jupyter/gravitino-spark-trino-example.ipynb
b/init/jupyter/gravitino-spark-trino-example.ipynb
index d3cf4da..b212292 100644
--- a/init/jupyter/gravitino-spark-trino-example.ipynb
+++ b/init/jupyter/gravitino-spark-trino-example.ipynb
@@ -38,7 +38,7 @@
"spark = SparkSession.builder \\\n",
" .appName(\"PySpark SQL Example\") \\\n",
" .config(\"spark.plugins\",
\"org.apache.gravitino.spark.connector.plugin.GravitinoSparkPlugin\") \\\n",
- " .config(\"spark.jars\",
f\"/tmp/gravitino/packages/iceberg-spark-runtime-3.4_2.12-1.10.0.jar,/tmp/gravitino/packages/{gravitino_connector_jar}\")
\\\n",
+ " .config(\"spark.jars\",
f\"/tmp/gravitino/packages/iceberg-spark-runtime-3.4_2.12-1.10.2.jar,/tmp/gravitino/packages/{gravitino_connector_jar}\")
\\\n",
" .config(\"spark.sql.gravitino.uri\", \"http://gravitino:8090\") \\\n",
" .config(\"spark.sql.gravitino.metalake\", \"metalake_demo\") \\\n",
" .config(\"spark.sql.gravitino.enableIcebergSupport\", \"true\") \\\n",
@@ -141,7 +141,7 @@
"outputs": [],
"source": [
"%pip install -q pandas\n",
- "%pip install -q trino==0.335.0"
+ "%pip install -q trino==0.340.0"
]
},
{
diff --git a/init/jupyter/gravitino-trino-example.ipynb
b/init/jupyter/gravitino-trino-example.ipynb
index 3b0817c..1ce7b7e 100644
--- a/init/jupyter/gravitino-trino-example.ipynb
+++ b/init/jupyter/gravitino-trino-example.ipynb
@@ -19,7 +19,7 @@
"source": [
"# install trino python client and pandas\n",
"%pip install -q pandas\n",
- "%pip install -q trino==0.335.0"
+ "%pip install -q trino==0.340.0"
]
},
{
diff --git a/init/jupyter/gravitino_llamaIndex_demo.ipynb
b/init/jupyter/gravitino_llamaIndex_demo.ipynb
index 92c485b..38ea5dc 100644
--- a/init/jupyter/gravitino_llamaIndex_demo.ipynb
+++ b/init/jupyter/gravitino_llamaIndex_demo.ipynb
@@ -48,13 +48,13 @@
"source": [
"%pip install -q --upgrade pip setuptools wheel\n",
"%pip install -q \\\n",
- " trino==0.335.0 \\\n",
+ " trino==0.340.0 \\\n",
" \"llama-index==0.12.52\" \\\n",
" llama-index-readers-wikipedia \\\n",
" llama-index-readers-file \\\n",
" llama-index-llms-openai \\\n",
" llama-index-question-gen-openai \\\n",
- " apache-gravitino==1.3.0 \\\n",
+ " apache-gravitino==1.3.1 \\\n",
" sqlalchemy-trino"
]
},
diff --git a/init/spark/init.sh b/init/spark/init.sh
index b3de064..4228c9f 100644
--- a/init/spark/init.sh
+++ b/init/spark/init.sh
@@ -20,10 +20,10 @@ mkdir -p /opt/spark/conf
cp /tmp/spark/spark-defaults.conf /opt/spark/conf
cp /tmp/spark/spark-env.sh /opt/spark/conf
-cp /tmp/spark/packages/iceberg-spark-runtime-3.4_2.12-1.10.0.jar
/opt/spark/jars/iceberg-spark-runtime-3.4_2.12-1.10.0.jar
+cp /tmp/spark/packages/iceberg-spark-runtime-3.4_2.12-1.10.2.jar
/opt/spark/jars/iceberg-spark-runtime-3.4_2.12-1.10.2.jar
cp /tmp/spark/packages/${SPARK_CONNECTOR_JAR}
/opt/spark/jars/${SPARK_CONNECTOR_JAR}
-cp /tmp/spark/packages/mysql-connector-java-8.0.27.jar
/opt/spark/jars/mysql-connector-java-8.0.27.jar
-cp /tmp/spark/packages/kyuubi-spark-authz-shaded_2.12-1.9.2.jar
/opt/spark/jars/kyuubi-spark-authz-shaded_2.12-1.9.2.jar
+cp /tmp/spark/packages/mysql-connector-j-8.0.33.jar
/opt/spark/jars/mysql-connector-j-8.0.33.jar
+cp /tmp/spark/packages/kyuubi-spark-authz-shaded_2.12-1.10.2.jar
/opt/spark/jars/kyuubi-spark-authz-shaded_2.12-1.10.2.jar
sh /tmp/common/init_metalake_catalog.sh
/bin/bash /tmp/spark/iceberg-seed.sh > /tmp/iceberg-seed.log 2>&1 &
tail -f /dev/null
diff --git a/init/spark/spark-dependency.sh b/init/spark/spark-dependency.sh
index 342c124..ceb257a 100755
--- a/init/spark/spark-dependency.sh
+++ b/init/spark/spark-dependency.sh
@@ -29,7 +29,7 @@ if [[ ! -d "${spark_dir}/packages" ]]; then
mkdir -p "${spark_dir}/packages"
fi
-ICEBERG_SPARK_RUNTIME_JAR="https://repo1.maven.org/maven2/org/apache/iceberg/iceberg-spark-runtime-3.4_2.12/1.10.0/iceberg-spark-runtime-3.4_2.12-1.10.0.jar"
+ICEBERG_SPARK_RUNTIME_JAR="https://repo1.maven.org/maven2/org/apache/iceberg/iceberg-spark-runtime-3.4_2.12/1.10.2/iceberg-spark-runtime-3.4_2.12-1.10.2.jar"
ICEBERG_SPARK_RUNTIME_MD5="${ICEBERG_SPARK_RUNTIME_JAR}.md5"
download_and_verify "${ICEBERG_SPARK_RUNTIME_JAR}"
"${ICEBERG_SPARK_RUNTIME_MD5}" "${spark_dir}"
@@ -37,10 +37,10 @@
GRAVITINO_SPARK_CONNECTOR_RUNTIME_JAR="https://repo1.maven.org/maven2/org/apache
GRAVITINO_SPARK_CONNECTOR_RUNTIME_MD5="${GRAVITINO_SPARK_CONNECTOR_RUNTIME_JAR}.md5"
download_and_verify "${GRAVITINO_SPARK_CONNECTOR_RUNTIME_JAR}"
"${GRAVITINO_SPARK_CONNECTOR_RUNTIME_MD5}" "${spark_dir}"
-MYSQL_CONNECTOR_JAVA_JAR="https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.27/mysql-connector-java-8.0.27.jar"
+MYSQL_CONNECTOR_JAVA_JAR="https://repo1.maven.org/maven2/com/mysql/mysql-connector-j/8.0.33/mysql-connector-j-8.0.33.jar"
MYSQL_CONNECTOR_JAVA_MD5="${MYSQL_CONNECTOR_JAVA_JAR}.md5"
download_and_verify "${MYSQL_CONNECTOR_JAVA_JAR}"
"${MYSQL_CONNECTOR_JAVA_MD5}" "${spark_dir}"
-KYUUBI_SPARK_AUTHZ_SHADED_JAR="https://repo1.maven.org/maven2/org/apache/kyuubi/kyuubi-spark-authz-shaded_2.12/1.9.2/kyuubi-spark-authz-shaded_2.12-1.9.2.jar"
+KYUUBI_SPARK_AUTHZ_SHADED_JAR="https://repo1.maven.org/maven2/org/apache/kyuubi/kyuubi-spark-authz-shaded_2.12/1.10.2/kyuubi-spark-authz-shaded_2.12-1.10.2.jar"
KYUUBI_SPARK_AUTHZ_SHADED_MD5="${KYUUBI_SPARK_AUTHZ_SHADED_JAR}.md5"
download_and_verify "${KYUUBI_SPARK_AUTHZ_SHADED_JAR}"
"${KYUUBI_SPARK_AUTHZ_SHADED_MD5}" "${spark_dir}"