Skip to content

Codespace ready - #183

Merged
jhdark merged 18 commits into
mainfrom
codespace-ready
Nov 5, 2026
Merged

jhdark merged 18 commits into
mainfrom
codespace-ready

Conversation

@jhdark

@jhdark jhdark commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Gets the workshop ready to run in GitHub Codespaces for the in-person workshop. It also fixes a few things that were broken for everyone, and reorganises book/content so the file tree matches the website sidebar.

Codespaces

  • Codespaces failed to start. The default 32 GB machine ran out of disk ("no space left on device") while pulling the image's 6.9 GB conda layer. The image is now 2.6 GB compressed, down from 7.6 GB:
    • torch now comes from the PyTorch CPU index, dropping about 3 GB of CUDA libraries that nothing here can use.
    • pyvista>=0.48 uses vtk-base.
  • New devcontainer setup:
    • It builds FROM binder/Dockerfile, so it pins the image built for that commit.
    • It converts the MyST .md notebooks to .ipynb when the codespace is created, so VS Code opens them as notebooks.
    • Xvfb runs on every start, for PyVista.
    • PYVISTA_JUPYTER_BACKEND=html is set by default.
    • The codespace opens on Simple simulation in the notebook editor.
  • build-image.yml runs on festim-dev only. A fork used to host a Codespaces prebuild reuses this image instead of building its own.

Fixes that affected everyone

  • import pyvista failed in the published image. The pyvista<0.47.1 pin resolved to 0.44.1 alongside vtk 9.6.2. PyVista is now >=0.48, plus trame-pyvista, which PyVista 0.49 needs for notebook plots. The old trame-vtk<2.10.3 pin is removed because it conflicts.
  • mesh_gmsh couldn't load its STEP file. It downloaded t20_data.step from gitlab.onelab.info, which now returns a sign-in page. It now copies the file from the conda gmsh package instead.
  • Small notebook fixes:
    • Removed pyvista.start_xvfb(), which no longer exists in PyVista 0.48 and later.
    • Two dolfinx pages now set the html backend, so their plots render outside a local Jupyter.
    • heat_transfer.md was missing its kernelspec.

Content reorganisation

  • Numbered folders. book/content is now organised by sidebar part: 01_getting_started, 02_fundamentals, 03_misc, 04_applications. Inside those are numbered chapter folders, and the pages are numbered too, so file explorers list them in site order. Page titles and the sidebar are unchanged; only the URLs change.
  • Renames. The taskNN notebooks are renamed after their content, for example task01 → simple_simulation and task08 → monoblock.
  • Old URLs still work. All 68 old page URLs redirect to the new pages via sphinx-reredirects.
  • Links. Internal links are relative, with myst_heading_anchors: 2 so links to a section resolve. They used to be absolute readthedocs URLs.

Testing

  • Every notebook ran without errors in the new image, including the 25 PyVista notebooks, which rendered embedded 3D scenes.
  • The notebooks whose data folders moved run in their new locations.
  • A Sphinx build without notebook execution shows no missing links, and the redirect pages point at pages that exist.
  • Not yet run: a full Read the Docs build with notebook execution. Please check the RTD check on this PR before merging.

jhdark and others added 18 commits November 4, 2026 14:44
The Codespace failed to start: pulling the image's 6.9 GB conda layer ran out
of disk ("no space left on device") on the default 32 GB machine.

Environment (shrinks the image and fixes PyVista):
- pyvista>=0.48. The old <0.47.1 pin resolved to 0.44.1 next to vtk 9.6.2,
  so `import pyvista` failed in the published image. 0.48+ also uses
  vtk-base instead of the full vtk metapackage (qt6/pyside6/ffmpeg/OpenVINO).
- torch from the PyTorch CPU index: nothing here has a GPU, and the default
  wheel pulled ~3 GB of CUDA libraries.

Devcontainer:
- Build FROM binder/Dockerfile, which pins the image built for that commit.
- onCreate: convert the MyST .md notebooks to .ipynb so VS Code opens them as
  notebooks (excluded from git locally).
- postStart: run Xvfb on :99 for PyVista; DISPLAY set in containerEnv.

Workflow: image name is owner-relative, so forks build their own image.

Notebooks:
- temperature.md: drop pyvista.start_xvfb(), removed in pyvista 0.48.
- mesh_gmsh.ipynb: copy t20_data.step from the conda gmsh package;
  gitlab.onelab.info now returns a sign-in page instead of the file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pyvista 0.49 moved its trame integration into trame-pyvista; without it
set_jupyter_backend('html') raises 'Please install trame dependencies'.
trame-pyvista needs trame-vtk>=2.11.16, so drop the old trame-vtk<2.10.3
pin and let it bring trame/trame-vtk/trame-vuetify. Add anywidget and
jupyter-server-proxy, the rest of pyvista's jupyter extra.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dolfinx_steady and dolfinx_fluxes never set a jupyter backend, so PyVista
fell back to 'trame', which shows an iframe to a server on a random
localhost port that a codespace does not forward. Set 'html' in both, like
the other notebooks, and default PYVISTA_JUPYTER_BACKEND=html in the
devcontainer for any cell that doesn't set one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A notebook opened at boot shows as raw JSON because the Jupyter extension
is still installing when the editor appears.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
content/ now has one folder per _toc.yml part (01_getting_started,
02_fundamentals, 03_misc, 04_applications), a numbered folder per chapter
with sections, and numbered pages, so the file explorer (Codespaces, VS
Code, GitHub) lists everything in the same order as the website. Titles and
the sidebar are unchanged; the numbers only show in URLs.

- Pages moved with `git mv` (history follows), data/image folders moved next
  to the notebooks that read them; the mapping is generated from _toc.yml.
- Links between pages, the intro.md cards and the absolute readthedocs links
  rewritten to the new paths; every relative link resolves.
- sphinx-reredirects forwards all 68 old page URLs to the new ones.
- CLAUDE.md describes the layout and the keep-numbers-in-sync rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tion

The taskNN names were left over from the old flat task list:
task01 simple_simulation, task02 tds_simulation, task03 simple_permeation,
task04 permeation_barrier, task07 heat_transfer, task08 monoblock (data
folder task08/ -> monoblock_mesh/), task06 advection_diffusion,
task10 tds_fitting, task11 pumped_interspace. Toc, intro cards, links and
redirect targets updated; the old URLs still redirect.

Codespaces now opens Getting started > Simple simulation, with *.ipynb
associated to the notebook editor so it doesn't render as raw JSON.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Four links used absolute festim-workshop.readthedocs.io URLs, which the
url_check CI rejects for pages not yet published (and which would always
point at latest/ rather than the version being read). Use relative links,
with myst_heading_anchors: 2 so the three #section links resolve.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A fork that follows upstream main (e.g. to host a Codespaces prebuild)
would otherwise build its own private image on every sync and commit a
binder/Dockerfile pointing at it. Reverts the owner-relative image name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r kernelspec

[](../meshes/mesh_gmsh) and [](../gas_enclosures/geometries) linked without a
file extension, so the path rewrite skipped them; the book build flagged both
as missing targets. heat_transfer.md was the only MyST page with code cells
and no kernelspec, which left its cells without a lexer (build warning) and
its notebook without a kernel for VS Code to pick automatically.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The PR build hung in the Sphinx step (~22 min vs ~10 normally). RTD
installs xvfb but never starts it; until now pyvista.start_xvfb() in one
notebook did, and older VTK rendered anyway after a 'bad X server
connection' warning. With pyvista 0.49 / newer VTK and no display, a
render kills the kernel or blocks, and timeout: -1 let a blocked cell
run forever. xvfb-run gives every notebook kernel a display (as in
Codespaces); timeout: 600 turns any future hang into an error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pint 0.26.2 (pulled in unpinned by h-transport-materials 0.16) raises
OffsetUnitCalculusError for degree_Celsius in material_htm and
tds_fitting; sphinx-codeautolink then crashes on the same error and the
whole RTD build fails. The Sep image had pint 0.25.3 and both notebooks
pass with it. This would break main too on its next fresh build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The instrumented build passed (Sphinx 626 s, build 16 min, nothing left
running afterwards), so the cause of the earlier never-ending PR builds
wasn't pinned down. Keep the timeout so a future hang fails clearly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jhdark
jhdark merged commit 83efa84 into main Nov 5, 2026
3 checks passed
@jhdark
jhdark deleted the codespace-ready branch November 5, 2026 13:41
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.

1 participant