From 692be4996996f581ae30ae0760ba1eb0256d1bc2 Mon Sep 17 00:00:00 2001 From: Mike Bender Date: Tue, 25 Jan 2022 09:17:14 -0500 Subject: [PATCH 1/4] Pull in @deephaven/embed-grid for iframes Use by creating URL with the correct src and tableName, eg. --- build.gradle | 1 + envoy/contents/envoy.yaml | 3 ++ settings.gradle | 2 + web/client-embed-grid/.dockerignore | 7 ++++ web/client-embed-grid/.gitignore | 39 +++++++++++++++++++ web/client-embed-grid/Dockerfile | 10 +++++ web/client-embed-grid/README.md | 3 ++ .../client-embed-grid.gradle | 28 +++++++++++++ web/web.gradle | 1 + 9 files changed, 94 insertions(+) create mode 100644 web/client-embed-grid/.dockerignore create mode 100644 web/client-embed-grid/.gitignore create mode 100644 web/client-embed-grid/Dockerfile create mode 100644 web/client-embed-grid/README.md create mode 100644 web/client-embed-grid/client-embed-grid.gradle diff --git a/build.gradle b/build.gradle index aae9c130f9d..cb8a20780a9 100644 --- a/build.gradle +++ b/build.gradle @@ -100,6 +100,7 @@ Set modsAreBasic = subprojects.findAll {it.name in [ 'grpc-proxy', 'web', 'web-client-ui', + 'web-client-embed-grid', 'pyclient', 'sphinx', 'docker-java-and-python', diff --git a/envoy/contents/envoy.yaml b/envoy/contents/envoy.yaml index a7e1cf20edb..1d2b1742c1d 100644 --- a/envoy/contents/envoy.yaml +++ b/envoy/contents/envoy.yaml @@ -50,6 +50,9 @@ static_resources: - match: # Application mode layout storage at this path prefix: "/layouts" route: { cluster: web } + - match: # Embed grid for iframe support at this path + prefix: "/embed-grid" + route: { cluster: web } - match: # Any GRPC call is assumed to be forwarded to the real service prefix: "/" route: diff --git a/settings.gradle b/settings.gradle index 3b2f8bf6dcb..0f25a1f1ba0 100644 --- a/settings.gradle +++ b/settings.gradle @@ -32,6 +32,8 @@ String[] webMods = [ 'web-client-api', // compiled javascript api client 'web-client-ide', // IDE-only additions to open-api javascript client 'web-client-ui', // React IDE client app + 'web-client-embed-grid', // Embedded grid that can be used in iframes + 'web-jupyter-grid', // React Jupyter grid client app 'web-shared-beans', // shared data types and common interfaces 'web-client-backplane', // shared data types and common interfaces 'open-api-lang-parser', // a javacc generated general-purpose language parser. diff --git a/web/client-embed-grid/.dockerignore b/web/client-embed-grid/.dockerignore new file mode 100644 index 00000000000..eced139e14e --- /dev/null +++ b/web/client-embed-grid/.dockerignore @@ -0,0 +1,7 @@ +# Unable to ignore Dockerfile +# https://github.com/docker-java/docker-java/issues/1141 +#Dockerfile +.dockerignore +**/build +**/node_modules +**/dist \ No newline at end of file diff --git a/web/client-embed-grid/.gitignore b/web/client-embed-grid/.gitignore new file mode 100644 index 00000000000..ae0162e6076 --- /dev/null +++ b/web/client-embed-grid/.gitignore @@ -0,0 +1,39 @@ +# See https://help.github.com/ignore-files/ for more about ignoring files. + +# dependencies +/node_modules + +# testing +/coverage + +# production +/build +/dist + +# misc +.vscode +.DS_Store +.env.local +.env.development.local +.env.test.local +.env.production.local +.project +.settings/ +.eslintcache +.stylelintcache +lerna-debug.log +Lerna-Profile-*.json + +/public/vs + +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +src/**/*.css + +cypress/screenshots +cypress/videos +cypress.env.json + +tsconfig.tsbuildinfo diff --git a/web/client-embed-grid/Dockerfile b/web/client-embed-grid/Dockerfile new file mode 100644 index 00000000000..f7544e2d142 --- /dev/null +++ b/web/client-embed-grid/Dockerfile @@ -0,0 +1,10 @@ +FROM deephaven/node:local-build +WORKDIR /usr/src/app + +ARG WEB_EMBED_GRID_VERSION=0.9.1-embed-grid.10 + +# Pull in the published package from npmjs and extract is +RUN set -eux; \ + npm pack @deephaven/embed-grid@${WEB_EMBED_GRID_VERSION}; \ + tar --touch -xf deephaven-embed-grid-${WEB_EMBED_GRID_VERSION}.tgz; \ + rm deephaven-embed-grid-${WEB_EMBED_GRID_VERSION}.tgz; \ No newline at end of file diff --git a/web/client-embed-grid/README.md b/web/client-embed-grid/README.md new file mode 100644 index 00000000000..1ab0e9e7790 --- /dev/null +++ b/web/client-embed-grid/README.md @@ -0,0 +1,3 @@ +# Web Embed Grid UI + +Web Embed Grid UI has been ejected to its own repository: https://github.com/deephaven/web-client-ui \ No newline at end of file diff --git a/web/client-embed-grid/client-embed-grid.gradle b/web/client-embed-grid/client-embed-grid.gradle new file mode 100644 index 00000000000..6cdeaa40015 --- /dev/null +++ b/web/client-embed-grid/client-embed-grid.gradle @@ -0,0 +1,28 @@ +plugins { + id 'com.bmuschko.docker-remote-api' +} + +evaluationDependsOn Docker.registryProject('node') + +def dhEmbedGrid = layout.buildDirectory.dir('dh-embed-grid') +def embedGrid = Docker.registerDockerTask(project, 'embed-grid') { + copyIn { + from file('Dockerfile') + } + parentContainers = [ Docker.registryTask(project, 'node') ] + containerOutPath = '/usr/src/app/package/build' + imageName = 'deephaven/dh-embed-grid:local-build' + copyOut { + into dhEmbedGrid.get().dir('embed-grid') + } +} + +configurations { + js +} + +artifacts { + js(dhEmbedGrid) { + builtBy embedGrid + } +} diff --git a/web/web.gradle b/web/web.gradle index 4098cc3e984..bc4d0317e96 100644 --- a/web/web.gradle +++ b/web/web.gradle @@ -10,6 +10,7 @@ archivesBaseName = "deephaven-web" dependencies { js project(path: ':web-client-ui', configuration: 'js') js project(path: ':web-client-ide', configuration: 'js') + js project(path: ':web-client-embed-grid', configuration: 'js') } /** From ff077ed2885bf27efba8e70207ddf494f0b2abea Mon Sep 17 00:00:00 2001 From: mikebender Date: Thu, 27 Jan 2022 11:15:00 -0500 Subject: [PATCH 2/4] Change from 'embed-grid' to 'iframe/table' path --- envoy/contents/envoy.yaml | 4 ++-- web/client-embed-grid/Dockerfile | 2 +- web/client-embed-grid/client-embed-grid.gradle | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/envoy/contents/envoy.yaml b/envoy/contents/envoy.yaml index 1d2b1742c1d..952fcc27244 100644 --- a/envoy/contents/envoy.yaml +++ b/envoy/contents/envoy.yaml @@ -50,8 +50,8 @@ static_resources: - match: # Application mode layout storage at this path prefix: "/layouts" route: { cluster: web } - - match: # Embed grid for iframe support at this path - prefix: "/embed-grid" + - match: # Embed a widget for iframe support at this path + prefix: "/iframe" route: { cluster: web } - match: # Any GRPC call is assumed to be forwarded to the real service prefix: "/" diff --git a/web/client-embed-grid/Dockerfile b/web/client-embed-grid/Dockerfile index f7544e2d142..bb085e585e9 100644 --- a/web/client-embed-grid/Dockerfile +++ b/web/client-embed-grid/Dockerfile @@ -1,7 +1,7 @@ FROM deephaven/node:local-build WORKDIR /usr/src/app -ARG WEB_EMBED_GRID_VERSION=0.9.1-embed-grid.10 +ARG WEB_EMBED_GRID_VERSION=0.9.1-embed-grid.14 # Pull in the published package from npmjs and extract is RUN set -eux; \ diff --git a/web/client-embed-grid/client-embed-grid.gradle b/web/client-embed-grid/client-embed-grid.gradle index 6cdeaa40015..468fb25e5d2 100644 --- a/web/client-embed-grid/client-embed-grid.gradle +++ b/web/client-embed-grid/client-embed-grid.gradle @@ -13,7 +13,9 @@ def embedGrid = Docker.registerDockerTask(project, 'embed-grid') { containerOutPath = '/usr/src/app/package/build' imageName = 'deephaven/dh-embed-grid:local-build' copyOut { - into dhEmbedGrid.get().dir('embed-grid') + // Copy into the iframe/table directory + // If we add other embeddable widgets, they can go at other subpaths, e.g. iframe/plot + into dhEmbedGrid.get().dir('iframe/table') } } From 0ae629deb75f5b3f8013f4c1fff9395e381026d1 Mon Sep 17 00:00:00 2001 From: mikebender Date: Mon, 31 Jan 2022 09:40:59 -0500 Subject: [PATCH 3/4] Use the published release instead of an alpha release --- web/client-embed-grid/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/client-embed-grid/Dockerfile b/web/client-embed-grid/Dockerfile index bb085e585e9..f55735288e7 100644 --- a/web/client-embed-grid/Dockerfile +++ b/web/client-embed-grid/Dockerfile @@ -1,7 +1,7 @@ FROM deephaven/node:local-build WORKDIR /usr/src/app -ARG WEB_EMBED_GRID_VERSION=0.9.1-embed-grid.14 +ARG WEB_EMBED_GRID_VERSION=0.9.1 # Pull in the published package from npmjs and extract is RUN set -eux; \ From 5174e80c4d1e9298e61fc5f967a003ce2ace0bb1 Mon Sep 17 00:00:00 2001 From: mikebender Date: Tue, 8 Feb 2022 09:12:27 -0500 Subject: [PATCH 4/4] Specify both IDE and embed-grid in the same Dockerfile At some point we could add ticket hash loading and/or code splitting on routes --- build.gradle | 1 - settings.gradle | 2 - web/client-embed-grid/.dockerignore | 7 ---- web/client-embed-grid/.gitignore | 39 ------------------- web/client-embed-grid/Dockerfile | 10 ----- web/client-embed-grid/README.md | 3 -- .../client-embed-grid.gradle | 30 -------------- web/client-ui/Dockerfile | 15 ++++++- web/client-ui/client-ui.gradle | 4 +- web/web.gradle | 1 - 10 files changed, 15 insertions(+), 97 deletions(-) delete mode 100644 web/client-embed-grid/.dockerignore delete mode 100644 web/client-embed-grid/.gitignore delete mode 100644 web/client-embed-grid/Dockerfile delete mode 100644 web/client-embed-grid/README.md delete mode 100644 web/client-embed-grid/client-embed-grid.gradle diff --git a/build.gradle b/build.gradle index cb8a20780a9..aae9c130f9d 100644 --- a/build.gradle +++ b/build.gradle @@ -100,7 +100,6 @@ Set modsAreBasic = subprojects.findAll {it.name in [ 'grpc-proxy', 'web', 'web-client-ui', - 'web-client-embed-grid', 'pyclient', 'sphinx', 'docker-java-and-python', diff --git a/settings.gradle b/settings.gradle index 0f25a1f1ba0..3b2f8bf6dcb 100644 --- a/settings.gradle +++ b/settings.gradle @@ -32,8 +32,6 @@ String[] webMods = [ 'web-client-api', // compiled javascript api client 'web-client-ide', // IDE-only additions to open-api javascript client 'web-client-ui', // React IDE client app - 'web-client-embed-grid', // Embedded grid that can be used in iframes - 'web-jupyter-grid', // React Jupyter grid client app 'web-shared-beans', // shared data types and common interfaces 'web-client-backplane', // shared data types and common interfaces 'open-api-lang-parser', // a javacc generated general-purpose language parser. diff --git a/web/client-embed-grid/.dockerignore b/web/client-embed-grid/.dockerignore deleted file mode 100644 index eced139e14e..00000000000 --- a/web/client-embed-grid/.dockerignore +++ /dev/null @@ -1,7 +0,0 @@ -# Unable to ignore Dockerfile -# https://github.com/docker-java/docker-java/issues/1141 -#Dockerfile -.dockerignore -**/build -**/node_modules -**/dist \ No newline at end of file diff --git a/web/client-embed-grid/.gitignore b/web/client-embed-grid/.gitignore deleted file mode 100644 index ae0162e6076..00000000000 --- a/web/client-embed-grid/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# See https://help.github.com/ignore-files/ for more about ignoring files. - -# dependencies -/node_modules - -# testing -/coverage - -# production -/build -/dist - -# misc -.vscode -.DS_Store -.env.local -.env.development.local -.env.test.local -.env.production.local -.project -.settings/ -.eslintcache -.stylelintcache -lerna-debug.log -Lerna-Profile-*.json - -/public/vs - -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -src/**/*.css - -cypress/screenshots -cypress/videos -cypress.env.json - -tsconfig.tsbuildinfo diff --git a/web/client-embed-grid/Dockerfile b/web/client-embed-grid/Dockerfile deleted file mode 100644 index f55735288e7..00000000000 --- a/web/client-embed-grid/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM deephaven/node:local-build -WORKDIR /usr/src/app - -ARG WEB_EMBED_GRID_VERSION=0.9.1 - -# Pull in the published package from npmjs and extract is -RUN set -eux; \ - npm pack @deephaven/embed-grid@${WEB_EMBED_GRID_VERSION}; \ - tar --touch -xf deephaven-embed-grid-${WEB_EMBED_GRID_VERSION}.tgz; \ - rm deephaven-embed-grid-${WEB_EMBED_GRID_VERSION}.tgz; \ No newline at end of file diff --git a/web/client-embed-grid/README.md b/web/client-embed-grid/README.md deleted file mode 100644 index 1ab0e9e7790..00000000000 --- a/web/client-embed-grid/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Web Embed Grid UI - -Web Embed Grid UI has been ejected to its own repository: https://github.com/deephaven/web-client-ui \ No newline at end of file diff --git a/web/client-embed-grid/client-embed-grid.gradle b/web/client-embed-grid/client-embed-grid.gradle deleted file mode 100644 index 468fb25e5d2..00000000000 --- a/web/client-embed-grid/client-embed-grid.gradle +++ /dev/null @@ -1,30 +0,0 @@ -plugins { - id 'com.bmuschko.docker-remote-api' -} - -evaluationDependsOn Docker.registryProject('node') - -def dhEmbedGrid = layout.buildDirectory.dir('dh-embed-grid') -def embedGrid = Docker.registerDockerTask(project, 'embed-grid') { - copyIn { - from file('Dockerfile') - } - parentContainers = [ Docker.registryTask(project, 'node') ] - containerOutPath = '/usr/src/app/package/build' - imageName = 'deephaven/dh-embed-grid:local-build' - copyOut { - // Copy into the iframe/table directory - // If we add other embeddable widgets, they can go at other subpaths, e.g. iframe/plot - into dhEmbedGrid.get().dir('iframe/table') - } -} - -configurations { - js -} - -artifacts { - js(dhEmbedGrid) { - builtBy embedGrid - } -} diff --git a/web/client-ui/Dockerfile b/web/client-ui/Dockerfile index 23a35272512..227bccefb2c 100644 --- a/web/client-ui/Dockerfile +++ b/web/client-ui/Dockerfile @@ -3,8 +3,19 @@ WORKDIR /usr/src/app ARG WEB_VERSION=0.9.1 -# Pull in the published package from npmjs and extract is +# Pull in the published code-studio package from npmjs and extract is RUN set -eux; \ npm pack @deephaven/code-studio@${WEB_VERSION}; \ tar --touch -xf deephaven-code-studio-${WEB_VERSION}.tgz; \ - rm deephaven-code-studio-${WEB_VERSION}.tgz; \ No newline at end of file + mv package/build ide; \ + rm -r package; \ + rm deephaven-code-studio-${WEB_VERSION}.tgz; + +# Pull in the published embed-grid package from npmjs and extract is +RUN set -eux; \ + npm pack @deephaven/embed-grid@${WEB_VERSION}; \ + tar --touch -xf deephaven-embed-grid-${WEB_VERSION}.tgz; \ + mkdir iframe; \ + mv package/build iframe/table; \ + rm -r package; \ + rm deephaven-embed-grid-${WEB_VERSION}.tgz; diff --git a/web/client-ui/client-ui.gradle b/web/client-ui/client-ui.gradle index 8847ebcbcd4..467fedb0ad2 100644 --- a/web/client-ui/client-ui.gradle +++ b/web/client-ui/client-ui.gradle @@ -10,10 +10,10 @@ def ui = Docker.registerDockerTask(project, 'ui') { from file('Dockerfile') } parentContainers = [ Docker.registryTask(project, 'node') ] - containerOutPath = '/usr/src/app/package/build' + containerOutPath = '/usr/src/app/' imageName = 'deephaven/dhide:local-build' copyOut { - into dhUi.get().dir('ide') + into dhUi.get() } } diff --git a/web/web.gradle b/web/web.gradle index bc4d0317e96..4098cc3e984 100644 --- a/web/web.gradle +++ b/web/web.gradle @@ -10,7 +10,6 @@ archivesBaseName = "deephaven-web" dependencies { js project(path: ':web-client-ui', configuration: 'js') js project(path: ':web-client-ide', configuration: 'js') - js project(path: ':web-client-embed-grid', configuration: 'js') } /**