diff --git a/.github/workflows/docker-build-push.yaml b/.github/workflows/docker-build-push.yaml index 92cbc4b660..f967552bb8 100644 --- a/.github/workflows/docker-build-push.yaml +++ b/.github/workflows/docker-build-push.yaml @@ -361,33 +361,27 @@ jobs: env: CI: ${{ matrix.NPM != 'bun' }} NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # Atlas3 sub-plugins (network/notebook-plugin/results-viewer/strategus/studies) live - # in the trex-notebook submodule at plugins/atlas/trex-notebook and are unpublished; + # Atlas3 sub-plugins (network/notebook-plugin/strategus/studies) live in the + # trex-notebook submodule at plugins/atlas/trex-notebook and are unpublished; # build them from source so plugins/atlas's file: deps resolve during its # install/postinstall. This is a second checkout of trex-notebook, pinned to the # restructured monorepo; plugins/ui/libs/react-notebook stays on the older # single-package commit that the portal's webr-notebook builds against. + # results-viewer is NOT built here: it is consumed prebuilt from GitHub + # Packages (@ohdsi/results-viewer) with its WebR/shinylive runtime included, + # so no R toolchain is needed on this runner. - name: Build Atlas sub-plugins (trex-notebook submodule) if: ${{ matrix.ATLAS }} env: CI: "true" GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # results-viewer's shinylive export (scripts/build-atlas.sh) needs a full R + - # renv toolchain — renv.lock pins 132 packages, several with compiled deps - # (V8, Rcpp, RSQLite), which is too heavy/slow to provision on this shared, - # already disk-constrained matrix runner. Skip it here rather than flake the - # whole build_plugins job; SKIP_SHINYLIVE is the same escape hatch - # scripts/build-atlas.sh honors locally. Until a dedicated R-provisioned - # runner/step exists, the shinylive bundle (and thus - # /atlas/plugins/results-viewer/shinylive/) is absent from CI-built images. - SKIP_SHINYLIVE: "1" run: | SUB=plugins/atlas/trex-notebook/plugins # notebook-plugin bundles the notebook app's source, which imports webr. ( cd "$SUB/notebook" && npm install ) # Prefer build:pkg (targets dist/); the plain build targets the sibyl dev host. - for p in network notebook-plugin results-viewer strategus studies; do + for p in network notebook-plugin strategus studies; do ( cd "$SUB/$p" && npm install \ && npm run "$(node -e "process.stdout.write(require('./package.json').scripts['build:pkg'] ? 'build:pkg' : 'build')")" ) done diff --git a/plugins/atlas/package.json b/plugins/atlas/package.json index 9826777a7c..38965588b2 100644 --- a/plugins/atlas/package.json +++ b/plugins/atlas/package.json @@ -19,7 +19,7 @@ "@ohdsi/network-plugin": "file:./trex-notebook/plugins/network", "@ohdsi/notebook-plugin": "file:./trex-notebook/plugins/notebook-plugin", "@ohdsi/pythia-plugin": "0.1.0-develop.14.gf8bbfc7", - "@ohdsi/results-viewer": "file:./trex-notebook/plugins/results-viewer", + "@ohdsi/results-viewer": "0.2.0-20260721005526.g6593d88", "@ohdsi/strategus-plugin": "file:./trex-notebook/plugins/strategus", "@ohdsi/studies-plugin": "file:./trex-notebook/plugins/studies", "react": "^18.2.0", diff --git a/scripts/build-atlas.sh b/scripts/build-atlas.sh index 99caefb345..0163d827be 100755 --- a/scripts/build-atlas.sh +++ b/scripts/build-atlas.sh @@ -3,9 +3,11 @@ # tarball into services/trex/plugin-artifacts/ so the trex image bakes it in via the # existing plugin-artifacts extract step. Reproducible counterpart to the CI atlas job. # -# The sub-plugins (network, notebook-plugin, results-viewer, strategus, studies) live in -# the trex-notebook submodule (plugins/atlas/trex-notebook) and are not published, so +# The sub-plugins (network, notebook-plugin, strategus, studies) live in the +# trex-notebook submodule (plugins/atlas/trex-notebook) and are not published, so # they are built from source here; plugins/atlas references them via file: deps. +# results-viewer is consumed prebuilt from GitHub Packages (@ohdsi/results-viewer) +# with its WebR/shinylive runtime included, so no R toolchain is needed here. # # Requires a GitHub token with read:packages (public @ohdsi/atlas3, @ohdsi/atlas-ui, # @ohdsi/pythia-* still need auth on GitHub Packages). Reads GITHUB_TOKEN or, locally, @@ -26,7 +28,7 @@ ATLAS_DIR="plugins/atlas" ARTIFACTS_DIR="services/trex/plugin-artifacts" # Atlas3 sub-plugins built from the submodule (dir name under $PLUGIN_DIR). -SUBPLUGINS=(network notebook-plugin results-viewer strategus studies) +SUBPLUGINS=(network notebook-plugin strategus studies) : "${GITHUB_TOKEN:=$(gh auth token 2>/dev/null || true)}" if [ -z "${GITHUB_TOKEN}" ]; then @@ -47,23 +49,8 @@ if printf '%s\n' "${SUBPLUGINS[@]}" | grep -qx notebook-plugin; then ( cd "$PLUGIN_DIR/notebook" && npm install ) fi -build_results_viewer_shinylive() { - local dir="$PLUGIN_DIR/results-viewer" - if ! command -v Rscript >/dev/null 2>&1; then - echo "[build-atlas] WARN: Rscript not found; results-viewer shinylive export skipped." >&2 - [ "${SKIP_SHINYLIVE:-0}" = "1" ] && return 0 - echo "[build-atlas] ERROR: R toolchain required for the results-viewer viewer. Install R + shinylive, or set SKIP_SHINYLIVE=1 to build without it." >&2 - exit 1 - fi - echo "[build-atlas] Building results-viewer shinylive export (R)..." - ( cd "$dir" && Rscript scripts/build-shim-packages.R && Rscript scripts/build-shinylive-export.R ) -} - for p in "${SUBPLUGINS[@]}"; do echo "[build-atlas] Building sub-plugin: $p" - if [ "$p" = "results-viewer" ]; then - build_results_viewer_shinylive - fi # Prefer build:pkg (targets dist/); the plain build targets the sibyl dev host. ( cd "$PLUGIN_DIR/$p" && npm install \ && npm run "$(node -e "process.stdout.write(require('./package.json').scripts['build:pkg'] ? 'build:pkg' : 'build')")" )