Skip to content

Commit

Permalink
hub image: omit py-spy from slim image
Browse files Browse the repository at this point in the history
  • Loading branch information
consideRatio committed Oct 30, 2022
1 parent 25095ab commit 44f3e26
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
24 changes: 20 additions & 4 deletions images/hub/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ RUN --mount=type=cache,target=${PIP_CACHE_DIR} \
pip install build \
&& pip wheel \
--wheel-dir=/tmp/wheels \
-r requirements.txt
-r requirements.txt \
# Additional wheels for default-stage. Updates below should be repeated
# in default-stage.
#
py-spy


# The final stage - slim version
Expand Down Expand Up @@ -72,12 +76,23 @@ CMD ["jupyterhub", "--config", "/usr/local/etc/jupyterhub/jupyterhub_config.py"]

# The final stage - default version
# ---------------------------------
# We add a few non-critical apt packages on top of the slim version to provide
# some debugging utility for k8s admins.
# We add a few non-critical packages on top of the slim version to provide some
# additional utility.
#
FROM slim-stage
FROM slim-stage as default-stage

USER root

ARG PIP_CACHE_DIR=/tmp/pip-cache
RUN --mount=type=cache,target=${PIP_CACHE_DIR} \
--mount=type=cache,from=build-stage,source=/build-stage,target=/tmp/wheels \
pip install \
--find-links=/tmp/wheels/ \
# Updates below should be repeated in build-stage.
#
# py-spy is useful for profiling performance of running hubs
py-spy

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
# misc network utilities
Expand All @@ -88,4 +103,5 @@ RUN apt-get update \
less \
vim \
&& rm -rf /var/lib/apt/lists/*

USER ${NB_USER}
5 changes: 0 additions & 5 deletions images/hub/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,3 @@ statsd # statsd metrics collection (TODO: remove soon, since folks use promethe

# The idle culler service
jupyterhub-idle-culler

## Useful tools

# py-spy is useful for profiling running hubs
py-spy
2 changes: 0 additions & 2 deletions images/hub/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,6 @@ prometheus-client==0.15.0
# via jupyterhub
psycopg2-binary==2.9.4
# via -r requirements.in
py-spy==0.3.14
# via -r requirements.in
pyasn1==0.4.8
# via ldap3
pycparser==2.21
Expand Down

0 comments on commit 44f3e26

Please sign in to comment.