geyanggang opened a new pull request, #163:
URL: https://github.com/apache/gravitino-playground/pull/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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]