Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ RUN adduser -D -s /bin/bash bootcamp
ENV SCALA_VERSION=2.12.10
ENV ALMOND_VERSION=0.9.1
ENV COURSIER_VERSION=2.1.24
ENV COURSIER_CACHE=/coursier_cache
ENV JUPYTER_CONFIG_DIR=/jupyter/config
ENV JUPYTER_DATA_DIR=/jupyter/data

Expand Down Expand Up @@ -86,7 +85,12 @@ RUN \
--default=true \
-o almond && \
./almond --install --global && \
# Preload Chisel dependencies to avoid first-run delay before removing coursier
# Preload Chisel dependencies - coursier fetch downloads to its default cache
# which gets picked up by Ammonite at runtime
./coursier fetch \
--intransitive \
edu.berkeley.cs:chisel3-plugin_2.12.10:3.6.1 \
&& \
./coursier fetch \
edu.berkeley.cs:chisel3_2.12:3.6.1 \
edu.berkeley.cs:chisel-iotesters_2.12:2.5.6 \
Expand All @@ -95,20 +99,23 @@ RUN \
edu.berkeley.cs:rocket-dsptools_2.12:1.2.0 \
org.scalanlp:breeze_2.12:1.0 \
org.scalatest:scalatest_2.12:3.2.2 \
--cache /coursier_cache && \
rm -rf almond coursier /root/.cache/coursier
&& \
rm -rf almond coursier

# Last stage
FROM base AS final

# Set COURSIER_CACHE environment variable so Ammonite uses our preloaded cache
ENV COURSIER_CACHE=/coursier_cache

# copy the Scala requirements and kernel into the image
COPY --from=intermediate-builder --chown=bootcamp:bootcamp /coursier_cache/ /coursier_cache/
COPY --from=intermediate-builder --chown=bootcamp:bootcamp /usr/local/share/jupyter/kernels/scala/ /usr/local/share/jupyter/kernels/scala/

RUN chown -R bootcamp:bootcamp /chisel-bootcamp /jupyter
RUN chown -R bootcamp:bootcamp /chisel-bootcamp /jupyter /coursier_cache

USER bootcamp
WORKDIR /chisel-bootcamp

EXPOSE 8888
CMD jupyter lab --no-browser --ip 0.0.0.0 --port 8888
CMD ["jupyter", "lab", "--no-browser", "--ip", "0.0.0.0", "--port", "8888"]
29 changes: 26 additions & 3 deletions source/jupyter_server_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
c = get_config() #noqa

# Fix websocket ping timeout warning
# Set both to same value to avoid timeout > interval warning
c.ServerApp.websocket_ping_interval = 30
c.ServerApp.websocket_ping_timeout = 30

Expand All @@ -14,6 +15,14 @@
c.ServerApp.allow_origin = '*'
c.ServerApp.allow_credentials = True

# Disable history manager to suppress Almond kernel history_request errors
# Almond kernel doesn't support history operations, causing JSON decode errors
c.HistoryManager.enabled = False

# Disable notebook trust warnings in container environment
# All notebooks are from trusted source (bootcamp materials)
c.ServerApp.trust_xheaders = False

# Keep INFO level for essential startup messages (URL, port, etc)
# but suppress specific noisy loggers
c.ServerApp.log_level = 'INFO'
Expand All @@ -23,14 +32,28 @@
logging.getLogger('tornado.access').setLevel(logging.ERROR)
logging.getLogger('tornado.application').setLevel(logging.ERROR)

# Suppress LabApp schema validation warnings
logging.getLogger('LabApp').setLevel(logging.ERROR)

# Create a custom filter to suppress specific warning messages
class SuppressAuthWarning(logging.Filter):
class SuppressWarnings(logging.Filter):
def filter(self, record):
return 'All authentication is disabled' not in record.getMessage()
# Only filter WARNING level messages, not INFO
if record.levelno != logging.WARNING:
return True

msg = record.getMessage()
# Suppress specific warnings
return not any([
'All authentication is disabled' in msg,
'Clearing invalid/expired login cookie' in msg,
'is not trusted' in msg,
'Could not determine jupyterlab build status' in msg
])

# Apply the filter to ServerApp logger
server_logger = logging.getLogger('ServerApp')
server_logger.addFilter(SuppressAuthWarning())
server_logger.addFilter(SuppressWarnings())

# Hide system and build files from file browser
# Students only need to see notebook files (*.ipynb)
Expand Down
6 changes: 2 additions & 4 deletions source/overrides.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"@jupyterlab/apputils-extension:notification": {
"fetchNews": "false",
"checkForUpdates": false
}
"fetchNews": "false",
"checkForUpdates": false
}