diff --git a/.github/workflows/CI-full.yml b/.github/workflows/CI-full.yml index fea6f76e2f..85016d21bc 100644 --- a/.github/workflows/CI-full.yml +++ b/.github/workflows/CI-full.yml @@ -181,6 +181,7 @@ jobs: needs_maven: true needs_secrets: false needs_installer_secrets: true + needs_vtk_wasm: true - name: admin dockerfile: docker/build/Dockerfile-admin-dev context: . @@ -233,6 +234,14 @@ jobs: sudo tar -xvf deploy/deploy_dir_2025_03_18.tar sudo chmod 777 -R deploy + # The 3D field viewer's wasm bundle is a pinned release asset, not a repo file, and only the + # clientgen image ships it. Fetching it here rather than in the maven build keeps a 12 MB + # download off every developer's machine for a feature that is disabled by default; developers + # who want the viewer locally run the same script themselves (see webapp-viewer/README.md). + - name: fetch vtk.wasm bundle for the field viewer + if: ${{ matrix.image.needs_vtk_wasm }} + run: node webapp-viewer/scripts/fetch-vtk-wasm.mjs + - name: Pre-build step if: ${{ matrix.image.pre_build }} run: ${{ matrix.image.pre_build }} diff --git a/docker/build/Dockerfile-clientgen-dev b/docker/build/Dockerfile-clientgen-dev index b9959ebefe..a66a2be794 100644 --- a/docker/build/Dockerfile-clientgen-dev +++ b/docker/build/Dockerfile-clientgen-dev @@ -38,6 +38,20 @@ COPY ./vcell-client/target/vcell-client-0.0.1-SNAPSHOT.jar \ ./vcell-client/target/maven-jars/*.jar \ /vcellclient/vcell-client/target/maven-jars/ +# +# The 3D field viewer's web content, served by the client's own loopback field server from +# /webviewer. webapp-viewer has no build step — the source directory is the deployable — +# so only what the browser actually loads is copied; the fetch script and package.json stay behind. +# +# assets/ holds the vtk.wasm bundle, which is gitignored and downloaded by CI before this image is +# built. If that step did not run, this COPY fails and the image build stops — which is the point: +# an installer that shipped the page without the bundle would 404 at the moment a user clicks +# "View in 3D". +# +COPY ./webapp-viewer/index.html ./webapp-viewer/viewer.js /vcellclient/webviewer/ +COPY ./webapp-viewer/vendor /vcellclient/webviewer/vendor +COPY ./webapp-viewer/assets /vcellclient/webviewer/assets + COPY ./docker/build/installers /config/ WORKDIR /config diff --git a/docker/build/installers/VCell.install4j b/docker/build/installers/VCell.install4j index c6b434517b..4a02eba196 100644 --- a/docker/build/installers/VCell.install4j +++ b/docker/build/installers/VCell.install4j @@ -19,6 +19,7 @@ + @@ -56,6 +57,7 @@ + @@ -81,6 +83,7 @@ + diff --git a/webapp-viewer/scripts/fetch-vtk-wasm.mjs b/webapp-viewer/scripts/fetch-vtk-wasm.mjs index c4caa7a38c..a635359cba 100644 --- a/webapp-viewer/scripts/fetch-vtk-wasm.mjs +++ b/webapp-viewer/scripts/fetch-vtk-wasm.mjs @@ -1,5 +1,5 @@ #!/usr/bin/env node -// Build-time fetch of VCell's VTK.wasm bundle into webapp-ng's assets, so the field viewer loads it +// Build-time fetch of VCell's VTK.wasm bundle into webapp-viewer's assets, so the field viewer loads it // SAME-ORIGIN (GitHub release assets can't be fetched cross-origin from the browser — no CORS header). // The @kitware/vtk-wasm loader's loadAsync({url}) takes the .tar.gz and untars it in-browser // (DecompressionStream + untar), so we serve the .tar.gz as-is. Idempotent. Env: