zyratlo opened a new pull request, #5258:
URL: https://github.com/apache/texera/pull/5258
### What changes were proposed in this PR?
Introduces the microservice that mediates between Texera and the JupyterLab
docker stack landed in `migration-tool-jupyter-docker`. Adds a new SBT
subproject `notebook-migration-service` plus shared config and a frontend
dev-proxy route.
**New SBT subproject `notebook-migration-service/`:**
- **`build.sbt`** and **`project/build.properties`** — module SBT setup;
module depends on the existing `Auth`, `Config`, and `DAO` projects
- **`src/main/scala/.../NotebookMigrationService.scala`** — Dropwizard
`Application` entry point; sets Jersey URL pattern to `/api/*`, registers the
resource class, initializes the shared SQL connection via
`SqlServer.initConnection(StorageConfig.jdbcUrl, …)`, and wires in
`RequestLoggingFilter`.
- **`src/main/scala/.../NotebookMigrationServiceConfiguration.scala`** —
Dropwizard `Configuration` subclass.
- **`src/main/scala/.../resource/NotebookMigrationResource.scala`** — five
REST endpoints under `/notebook-migration`:
- `GET /get-jupyter-url` — health-checks the Jupyter container and
returns its base URL.
- `GET /get-jupyter-iframe-url` — returns the iframe-ready URL for
`notebook.ipynb`.
- `POST /set-notebook` — receives a notebook JSON, PUTs it into
JupyterLab via its `/api/contents/work/{name}` API.
- `POST /store-notebook-and-mapping` — persists a notebook +
workflow-notebook mapping into Postgres in a single transaction (writes to the
`notebook` and `workflow_notebook_mapping` tables added by
`migration-tool-database-tables`).
- `POST /fetch-notebook-and-mapping` — returns the most recent notebook
+ mapping for a given (wid, vid).
- **`src/main/resources/logback.xml`** — logging config.
- **`src/main/resources/notebook-migration-service-web-config.yaml`** —
Dropwizard server config (HTTP port `9098`, DB connection refs).
**Root build wiring:**
- **`build.sbt`** — declares the new `NotebookMigrationService` SBT
subproject and adds it to the `TexeraProject` aggregation.
**Shared config:**
- **`common/config/src/main/resources/storage.conf`** — new `jupyter { url
= "http://localhost:9100" }` block, overridable via `STORAGE_JUPYTER_URL`.
- **`common/config/src/main/scala/.../StorageConfig.scala`** — adds the
`jupyterURL` accessor.
**Frontend dev proxy:**
- **`frontend/proxy.config.json`** — routes `/api/notebook-migration/*` to
`http://localhost:9098`.
### Any related issues, documentation, discussions?
Closes #5257
Parent issue #4301
- Hard dependency: **must be merged after
`migration-tool-database-tables`** #5055 — the resource imports jOOQ-generated
`Notebook` / `WorkflowNotebookMapping` classes that only exist once the schema
PR is merged.
- Soft dependency: the JupyterLab container from
`migration-tool-jupyter-docker` is what `StorageConfig.jupyterURL` points to.
Without it running, the Jupyter-related endpoints return a 500 with `"Cannot
connect to Jupyter server"`. Service still starts and the DB-persistence
endpoints work in isolation.
### How was this PR tested?
### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 4.7)
--
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]