Skip to content

Keep AiiDAlab terminal pages on nbclassic - #622

Merged
yakutovicha merged 1 commit into
mainfrom
fix/classic-frontend-routing
Nov 16, 2026
Merged

yakutovicha merged 1 commit into
mainfrom
fix/classic-frontend-routing

Conversation

@cpignedoli

@cpignedoli cpignedoli commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Notebook 7 currently serves /terminals/<name> ahead of nbclassic, so the terminal misses AiiDAlab branding, controls and classic frontend extensions such as the demo session timer. Disable only the Notebook 7 server extension in the lab image's Jupyter configuration. The installed Notebook package and JupyterLab interface remain available.

Adds a runtime regression test that checks the classic file-browser template, creates a terminal, verifies its classic template/assets and cleans it up. Existing formatting is preserved.

Addresses #621 together with aiidalab/aiidalab-home#278.

Release dependency

Keep this PR in draft until aiidalab/aiidalab-home#278 has been merged and released, and build.json's AIIDALAB_HOME_TAG has been updated to that verified release. The current v26.11.0 pin is intentionally unchanged: disabling Notebook 7 while retaining the old Home shortcuts leaves /tree unavailable.

Validation

  • Ran the unchanged published test_classic_file_browser_and_terminal twice in the same ARM64 full-stack 2026.1032 container, changing only jupyter_server_config.py: original configuration fails at the classic terminal element assertion; PR configuration passes. Notebook 7.4.5, nbclassic 1.3.1 and Jupyter Server 2.16.0 were unchanged. Local fixture adapters reused the isolated container; terminal cleanup was verified in both runs.
  • HTTP and interactive terminal WebSocket checks pass both directly and through a local JupyterHub 5.3.0 proxy with the /user/test-user/ prefix.
  • Manual Chrome checks passed for Home, File Manager, Tasks, interactive Terminal and Control. With Edan's unchanged timer from Bump QE image to v26.11.1 aiidalab-demo-server#97, the countdown was visible on Home, File Manager, Tasks and Terminal; the integrated preview was manually accepted.
  • Four companion Home URL regression cases, changed-file Ruff checks/format and runtime pip check pass.
  • Docker CI passes, including image builds/tests and integration tests on AMD64 and ARM64. The companion Home CI also passes in Chrome and Firefox. A real Kubernetes deployment remains to be checked; the local preview did not configure automatic session deletion.

Prepared with the assistance of Codex.

@cpignedoli

Copy link
Copy Markdown
Member Author

Hi @edan-bainglass and @yakutovicha, could you check this PR together with aiidalab/aiidalab-home#278 for #621?

We tested the integrated changes in an isolated local JupyterHub preview using the unchanged timer from aiidalab/aiidalab-demo-server#97. The countdown is now visible on Home, File Manager, Tasks and Terminal, and I have also checked the preview manually. Please keep the release order explicit: merge/release the Home fix first, then update the Docker image's Home pin before merging this PR.

@yakutovicha, are you already working on the SSH-key permission problem in #620, or do you have a branch we should build on? I checked the public issue, PRs and branches but found no current ownership recorded, so I would like to avoid duplicating anything you have underway. If you already have a fix in progress, it would be great to coordinate its completion so we can aim for a new image release containing both fixes once validated.

@edan-bainglass, if there is no existing SSH fix to build on, would you also be available to check a forthcoming separate PR for #620?

@edan-bainglass

Copy link
Copy Markdown
Member

@edan-bainglass, if there is no existing SSH fix to build on, would you also be available to check a forthcoming separate PR for #620?

Not sure I understand what you're asking here 😅

Comment thread tests/test_lab.py
assert re.search(r"appmode/main\s+enabled", output)


def test_classic_file_browser_and_terminal(notebook_service, aiidalab_exec):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just making sure: can we verify that these tests fail without the jupyter_server_config.py change?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, verified using the unchanged tests/test_lab.py::test_classic_file_browser_and_terminal from head 39fa7a1.

I ran it twice in the same isolated ARM64 full-stack container (Notebook 7.4.5, nbclassic 1.3.1, Jupyter Server 2.16.0), changing only the deployed jupyter_server_config.py and restarting the server:

  • Original configuration from main (457ed0f): 1 failed, at assert 'id="terminado-container"' in response.text. The terminal page returns HTTP 200 but serves the Notebook 7 template.
  • Configuration from this PR: 1 passed.

The file-browser assertion passes in both cases; the terminal assertion is what detects this regression. The test body was unchanged; local fixture adapters ran it inside the existing test container instead of starting another Compose stack. Terminal cleanup was verified in both runs. The original configuration was restored and the test container stopped afterwards.

@edan-bainglass edan-bainglass left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @cpignedoli. The change seems reasonable and is inline with what I had to do locally to verify the session timer in aiidalab/aiidalab-demo-server#97. LGTM! Good to go once the home app PR is in and the new version is pinned here.

@danielhollas danielhollas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine, though the tests look quite sloppy. I wonder if we should just have tests in aiidalab-home for this, I don't think they quite fit here. That would mean merging this first so that the tests on aiidalab-home can pass (the selenium tests there pull the edge image)

@cpignedoli

Copy link
Copy Markdown
Member Author

@danielhollas, I agree that the browser-facing regression belongs in aiidalab-home’s Selenium tests. I propose moving that coverage there and testing Home against the image built from this PR.

One sequencing detail needs coordination. Disabling Notebook 7 with the currently pinned Home version leaves its /tree shortcuts unavailable. We should coordinate the Home release and image pin update when arranging the merges.

@yakutovicha
yakutovicha marked this pull request as ready for review November 16, 2026 09:36
@yakutovicha

Copy link
Copy Markdown
Member

Hi @edan-bainglass and @yakutovicha, could you check this PR together with aiidalab/aiidalab-home#278 for #621?

I tested, but it seems that the terminal is still using notebook 7 (the logo is still the one from Jupyter, not AiiDAlab)

image

@yakutovicha yakutovicha left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cpignedoli, can you double check that we are trully using the nbclassic, and not notebook 7 for the terminal?

@cpignedoli

Copy link
Copy Markdown
Member Author

on it @yakutovicha

@cpignedoli

Copy link
Copy Markdown
Member Author

@yakutovicha, I rechecked the exact configuration from head 39fa7a1. With the PR change applied, the terminal is served by nbclassic in the test.

I reran the unchanged test_classic_file_browser_and_terminal against the base and PR configurations, using fresh isolated Jupyter processes with Notebook 7.4.5, nbclassic 1.3.1 and Jupyter Server 2.16.0:

  • Base configuration: FAIL at the classic terminal assertion. The page references /static/notebook/main…js, the Notebook 7 frontend.
  • PR configuration: PASS. The returned HTML contains id="terminado-container" and references terminal/js/main.min.js, the nbclassic terminal frontend.

Both results were reproduced at / and with /user/test-user/ as the server base URL. Terminal commands also worked over the WebSocket. This rerun used the normal nbclassic entry point with isolated configuration discovery; it was not a fresh Docker build or a JupyterHub deployment. The existing PR image CI also passes on AMD64 and ARM64; I checked the full-stack logs, including the passing test_lab.py suite.

Your screenshot does look like the Notebook 7 terminal, so the discrepancy is still worth resolving. Could you share the image tag/digest and launch command you tested? Does its /opt/conda/etc/jupyter/jupyter_server_config.py contain c.ServerApp.jpserver_extensions = {"notebook": False}, and do the startup logs still report notebook as loaded? That would help distinguish a different image from a configuration override.

Notebook 7 intentionally remains installed; this PR disables its server extension so that nbclassic handles the terminal URL.

@yakutovicha

Copy link
Copy Markdown
Member

@cpignedoli - I rechecked; it was my mistake. I pulled the wrong image. Everything works as expected.

@yakutovicha
yakutovicha self-requested a review November 16, 2026 10:37
@yakutovicha
yakutovicha merged commit b78025f into main Nov 16, 2026
20 checks passed
@yakutovicha
yakutovicha deleted the fix/classic-frontend-routing branch November 16, 2026 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants