villebro commented on code in PR #43437:
URL: https://github.com/apache/superset/pull/43437#discussion_r3839389627


##########
Dockerfile:
##########
@@ -243,6 +265,20 @@ RUN --mount=type=cache,target=${SUPERSET_HOME}/.cache/uv \
     uv pip install -e .
 RUN python -m compileall /app/superset
 
+# --- Realtime WebSocket server (part of the official image) ---------------
+# The realtime transport (superset-websocket) is a Node service. Bundle the
+# Node runtime plus the built server and its production dependencies so the
+# official image can launch it via an alternate entrypoint
+# (docker/entrypoints/run-websocket.sh) rather than needing a separate image.
+RUN /app/docker/apt-install.sh libstdc++6
+COPY --from=superset-websocket /usr/local/bin/node /usr/local/bin/node
+COPY --from=superset-websocket --chown=superset:superset \
+    /app/superset-websocket/dist /app/superset-websocket/dist
+COPY --from=superset-websocket --chown=superset:superset \
+    /app/superset-websocket/node_modules /app/superset-websocket/node_modules
+COPY --from=superset-websocket --chown=superset:superset \
+    /app/superset-websocket/package.json /app/superset-websocket/package.json

Review Comment:
   Fixed in b5ec1ce1e6. `logToFile` defaults to `false` so the default image is 
unaffected, but you're right that opting in with the default relative 
`LOG_FILENAME` would try to write `/app/app.log`, which the unprivileged 
`superset` user can't create. `run-websocket.sh` now `cd`s to `SUPERSET_HOME` 
(writable: `chmod 1777`, owned by `superset`) before launching, so a relative 
log path lands somewhere writable. The `config.json` lookup is unaffected — it 
resolves relative to the bundle via `import.meta.dirname`, not the cwd.



##########
docker/entrypoints/run-websocket.sh:
##########
@@ -0,0 +1,33 @@
+#!/usr/bin/env bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# Launch the realtime WebSocket server (superset-websocket) bundled in the
+# official image. Run it with:
+#
+#   docker run <superset-image> /app/docker/entrypoints/run-websocket.sh
+#
+# Configure via environment variables (see superset-websocket/src/config.ts for
+# the full set), which must match the Flask app's WEBSOCKET_* config:
+#   PORT, REDIS_HOST, REDIS_PORT, REDIS_PASSWORD, REDIS_SSL,
+#   JWT_SECRET (== WEBSOCKET_JWT_SECRET),
+#   JWT_COOKIE_NAME (== WEBSOCKET_JWT_COOKIE_NAME, default superset-ws-token),
+#   ALLOWED_ORIGINS.

Review Comment:
   Fixed in b5ec1ce1e6. The comment now points to 
`superset-websocket/src/config.ts` as the authoritative, complete configuration 
surface (Redis, logging, connection limits, StatsD, …) instead of enumerating a 
partial list as if it were complete, and calls out only the values that must 
match the Flask app (`JWT_SECRET`/`JWT_COOKIE_NAME` and the shared Redis 
connection).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to