-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: Have docker scripts for starting up the deephaven-plugins repo…
… with the latest (#143) - Docker scripts to automatically start up containers to build all of the JS/python, start up the deephaven-core container, install all the plugins appropriately, and serve them up - Use by running `npm run docker`, then going to http://localhost:10000 - Useful to test latest deephaven-plugins without having to build/configure deephaven-core locally (@dsmmcken) - Will also be useful when adding e2e tests to this repo, as CI can use the docker script to start up a box before executing the e2e tests (@ethanalvizo) - Regenerated the package-lock.json. Was getting errors with it in the docker container for some reason, seems to be somewhat corrupted.
- Loading branch information
Showing
10 changed files
with
21,566 additions
and
7,859 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# dependencies | ||
**/node_modules/ | ||
|
||
# testing | ||
/coverage | ||
jest* | ||
__mocks__/ | ||
.github/ | ||
|
||
# venvs | ||
**/.venv/ | ||
|
||
# production | ||
**/build/ | ||
**/dist/ | ||
**/*.egg-info/ | ||
|
||
# misc | ||
.git/ | ||
.vscode/ | ||
.DS_Store | ||
**/.env*.local | ||
.project | ||
.settings/ | ||
.eslintcache | ||
.stylelintcache | ||
lerna-debug.log | ||
Lerna-Profile-*.json | ||
|
||
npm-debug.log* | ||
|
||
**/tsconfig.tsbuildinfo | ||
test-results/ | ||
playwright-report/ | ||
playwright/.cache/ | ||
**/CHANGELOG.md | ||
|
||
# Ignore Dockerfile as well, since we don't need to copy that into the snapshot container | ||
**/Dockerfile | ||
.dockerignore | ||
**/.gitignore | ||
|
||
# Tests are copied to the docker container, as it modifies them | ||
tests/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# syntax=docker/dockerfile:1 | ||
# Dockerfile for starting up a deephaven-server with these latest plugins built and installed | ||
# Expects to be run from the root of the deephaven-plugins repo | ||
# First lets build and install the JS plugins | ||
FROM node:18 AS base | ||
WORKDIR /work/ | ||
|
||
# Update packages list and install python python | ||
RUN set -eux; \ | ||
apt-get update; \ | ||
apt-get install python3-pip --yes; | ||
|
||
# This is a workaround for copying all package.json files w/ directory structure | ||
# without needing to list every file as a COPY command | ||
# The copy --from=copy-plugins command will be a cache hit if the package.json files didn't change | ||
FROM alpine AS copy-plugins | ||
WORKDIR /work/ | ||
COPY plugins /tmp/deephaven-plugins | ||
COPY package.json package-lock.json requirements.txt ./ | ||
# cd first so the cp doesn't include /tmp/deephaven-plugins in the paths | ||
RUN cd /tmp/deephaven-plugins && cp --parents ./*/src/js/package.json /work/ && cp --parents ./*/setup.* /work/ | ||
|
||
FROM base as build | ||
WORKDIR /work/ | ||
COPY --from=copy-plugins /work/ . | ||
|
||
# Install the python requirements | ||
RUN pip3 install -r requirements.txt --break-system-packages | ||
|
||
# Install the npm packages | ||
RUN npm ci | ||
|
||
COPY babel.config.js lerna.json nx.json tsconfig.json ./ | ||
|
||
# Copy the deephaven-plugins source files to the docker image | ||
# We do this last because the source files are the most likely to change | ||
# This requires the Dockerfile to be built in the context of the root of the deephaven-plugins repository | ||
# https://stackoverflow.com/a/34300129 | ||
COPY plugins plugins | ||
|
||
# Build the JS | ||
RUN npm run build | ||
|
||
# Now build the Python bundles | ||
RUN find ./plugins -maxdepth 1 -mindepth 1 -type d -exec python3 -m build --wheel {} \; | ||
|
||
FROM ghcr.io/deephaven/server:edge | ||
COPY --link --from=build /work/ /opt/deephaven/config/plugins/ | ||
RUN pip install /opt/deephaven/config/plugins/plugins/*/dist/*.whl | ||
|
||
COPY --link docker/config/deephaven.prop /opt/deephaven/config/deephaven.prop | ||
|
||
# We copy our data directory in from the data container in case we're publishing the image | ||
# However, you can mount a volume to override this in the docker-compose.override.yml | ||
COPY --link docker/data /data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
version: '3' | ||
|
||
services: | ||
deephaven-plugins: | ||
build: | ||
dockerfile: ./Dockerfile | ||
pull: true | ||
ports: | ||
- '${DEEPHAVEN_PORT:-10000}:10000' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
includefiles=dh-defaults.prop | ||
|
||
deephaven.console.type=python | ||
|
||
# Add all plugins that you want installed here | ||
deephaven.jsPlugins.@deephaven/js-plugin-ui=/opt/deephaven/config/plugins/plugins/ui/src/js | ||
deephaven.jsPlugins.@deephaven/js-plugin-plotly-express=/opt/deephaven/config/plugins/plugins/plotly-express/src/js | ||
|
||
# Anonymous authentication so we don't need to put in a password | ||
AuthHandlers=io.deephaven.auth.AnonymousAuthenticationHandler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"filterSets":[],"layoutConfig":[{"type":"row","height":100,"isClosable":true,"isFocusOnShow":true,"reorderEnabled":true,"title":"","content":[{"type":"stack","isClosable":true,"isFocusOnShow":true,"reorderEnabled":true,"title":"","width":47.87172011661808,"activeItemIndex":0,"content":[{"type":"react-component","component":"ConsolePanel","title":"Console","isClosable":false,"id":"EwmgpXQqE","props":{"metadata":{},"panelState":{"consoleSettings":{},"itemIds":[]}},"componentName":"lm-react-component","isFocusOnShow":true,"reorderEnabled":true,"componentState":null},{"type":"react-component","component":"LogPanel","title":"Log","isClosable":false,"id":"l9Ll30LIS8","props":{"metadata":{}},"componentName":"lm-react-component","isFocusOnShow":true,"reorderEnabled":true,"componentState":null}]},{"type":"stack","width":52.12827988338192,"isClosable":true,"isFocusOnShow":true,"reorderEnabled":true,"title":"","activeItemIndex":2,"content":[{"type":"react-component","component":"CommandHistoryPanel","title":"Command History","isClosable":false,"id":"qfsNtUkwNG","props":{"metadata":{},"panelState":{}},"componentName":"lm-react-component","isFocusOnShow":true,"reorderEnabled":true,"componentState":null},{"type":"react-component","component":"FileExplorerPanel","title":"File Explorer","isClosable":false,"id":"x0ISsm_Crj","props":{"metadata":{}},"componentName":"lm-react-component","isFocusOnShow":true,"reorderEnabled":true,"componentState":null},{"type":"react-component","component":"NotebookPanel","isFocusOnShow":false,"props":{"metadata":{"id":"KfJJtrr0G"},"panelState":{"settings":{"language":""},"fileMetadata":{"id":"/DEMO.md","itemName":"/DEMO.md"},"isPreview":true}},"title":"DEMO.md","id":"KfJJtrr0G","componentName":"lm-react-component","isClosable":true,"reorderEnabled":true,"componentState":null}]}]}],"links":[],"version":2} |
Oops, something went wrong.