Skip to content

Ship the 3D field viewer's web content in the installers - #1854

Merged
jcschaff merged 3 commits into
masterfrom
feat/package-field-viewer-installer
Aug 7, 2026
Merged

Ship the 3D field viewer's web content in the installers#1854
jcschaff merged 3 commits into
masterfrom
feat/package-field-viewer-installer

Conversation

@jcschaff

@jcschaff jcschaff commented Aug 7, 2026

Copy link
Copy Markdown
Member

Closes the packaging gap tracked in #1851. Stacked on #1829base is vtk/field-viewer, so the diff here is just the four files below; retarget to master once #1829 lands.

FieldViewerServer already serves the viewer page from <installDir>/webviewer, but nothing ever put content there. On an installed client the directory is absent, so "View in 3D" opens a page that cannot load. This ships it.

The three pieces

file change
VCell.install4j a webviewer mount point, a source-path variable, a dirEntry (3 lines)
Dockerfile-clientgen-dev copy the content to /vcellclient/webviewer
CI-full.yml fetch the wasm bundle before that image builds

site_deploy.yml needs no change — worth stating, because #1851 originally claimed otherwise. It stages nothing: it pulls the prebuilt vcell-clientgen image and runs build_installers.sh inside it, where mavenRootDir=/vcellclient refers to paths baked into the image. So everything an installer ships is COPYd in when CI-full builds clientgen.

Two things a reviewer should check

maven-jars is the wrong template, and it is the obvious one to reach for. Its mountPoint="719" is lib, not the install root. bionetgen is the right precedent: a rootless mount point, relative to the install root, which is what -Dvcell.installDir=${launcher:sys.launcherDirectory} resolves to and what staticRoot() looks under.

Why the fetch is in CI rather than the maven build. The localsolvers precedent argues for a download-maven-plugin execution, and that would work — but solvers are downloaded because developers actually run them locally, whereas this bundle is only needed to build an installer. Putting it in maven would impose a 12 MB download on every developer for a feature that is off by default. Developers who want the viewer locally already run the same script themselves.

Verified

Both claims in the Dockerfile comment were checked with real docker builds, not reasoned about:

  • The copy produces exactly index.html, viewer.js, vendor/vtk.umd.js and assets/vtk-wasm/*.tar.gz12 MB, with the fetch script, package.json and README left behind.
  • With assets/ absent (a skipped fetch), the build fails with "/webapp-viewer/assets": not found rather than silently producing an installer whose viewer 404s.

What this does not do, and the risk it adds

The feature stays behind vcell.fieldViewer.enabled, still defaulting to false, so this changes nothing a user sees. It does not pre-seed the flag in the install4j vmoptions templates; testers still add the line themselves.

The real cost is that the release build gains a network dependency: the bundle is fetched from the pinned virtualcell/vcell-vtk-wasm v1.0.0 release, and clientgen blocks release. If that release is unreachable, the release build fails. That is the argument for merging this early in a cycle rather than next to a release. It also adds ~12 MB to all five media, and the .tar.gz will not compress further under install4j's LZMA.

Note this cannot be fully exercised outside a real site_deploy run — the installer build needs the install4j license and both code-signing keystores.

🤖 Generated with Claude Code

Closes the gap in #1851: the client could already serve the viewer page
from <installDir>/webviewer, but nothing put anything there, so on an
installed client "View in 3D" opened a page that could not load.

Three pieces, following how bionetgen already ships:

- VCell.install4j gains a webviewer mount point, a source-path variable
  and a dirEntry. Note maven-jars is the wrong template to copy here —
  its mountPoint 719 is "lib", not the install root. A rootless mount
  point is relative to the install root, which is what
  -Dvcell.installDir=${launcher:sys.launcherDirectory} resolves to and
  what FieldViewerServer.staticRoot() looks under.

- Dockerfile-clientgen-dev copies the content into /vcellclient/webviewer.
  site_deploy.yml needs no change: it pulls this prebuilt image and runs
  install4j inside it, so everything the installer ships is baked in here.
  Only what the browser loads is copied — the fetch script, package.json
  and README stay behind.

- CI-full fetches the wasm bundle before that image builds, since it is a
  pinned release asset rather than a repo file. Doing it here instead of
  in the maven build keeps a 12 MB download off every developer's machine
  for a feature that is disabled by default.

If the fetch is skipped the COPY fails and the image build stops, which
is deliberate: an installer carrying the page without the bundle would
404 exactly when a user clicks "View in 3D".

Verified the copy layout and the fail-fast behaviour with real docker
builds — 12 MB, and a missing assets/ stops the build with
"/webapp-viewer/assets": not found.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@jcschaff
jcschaff merged commit 4b56218 into master Aug 7, 2026
9 checks passed
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