Page MenuHomePhabricator

Conda analytics environments breakage - conflicting dependencies between r-base and other
Closed, DuplicatePublic

Description

This task is for documenting how conda-analytics environments might reach a broken state and identify ways to solve the problem. We have so far identified one such case, which goes as follows:

  1. Create a new conda-analytics Jupyter environment and launch it.
  2. In a Jupyter terminal window, install the Mamba solver per these instructions (note that a Jupyter terminal is needed because it'll also upgrade conda to version 23.1, which is required to be able to change its solver).
  3. Install R 4.2.3 with conda install -c conda-forge r-base=4.2.3.

The environment ends up with incompatible versions of PySpark and Jupyter so running Spark queries fails, and if the Jupyter server is shut down it will not restart.

When discussing this on Slack, @BTullis noted that it's possible to pin Conda packages to prevent updates. This might be one good solution, e.g. for ensuring that the PySpark package installed matches that of the server. Another approach is to first do a dry run of an installation using the -d command line parameter to conda and then check that it doesn't update things like PySpark and Jupyter.

Event Timeline

I have a radical idea to not use conda-analytics for R at all. What's the most important thing about conda-analytics? The fact that environments can be shipped to worker nodes when using PySpark, etc. – something we never have any need for when analyzing data with R. And querying our data sources with R is not supported (wmfdata-r just wraps hive CLI and I'm not even sure if MariaDB querying works still), so folks are already doing the querying via Python and then switching to R for the analysis of the queried data.

Issues we had in the past:

  • Version of R provided by Debian releases would get profoundly outdated, preventing us from installing & using certain R packages
    • conda-analytics partially solves this, but we're at the mercy of conda-forge maintainers
    • I would love for us to just use CRAN's Debian backport repos https://cran.r-project.org/bin/linux/debian/ (pending Security review) and that way we can have new versions of R available and without the headaches that accompany Conda-managed R versions
  • When trying to install certain R packages that have system-level dependencies that aren't available
    • conda-analytics partially solves this since you can install r-tidyverse and it installs all of the non-R dependencies in the environment, but at the expense of conflicting dependencies and environments breaking
    • When we relied on version of R available at system level, we'd have to make Phab tasks requesting libraries to be added at system level
    • Hybrid approach? Maybe we can use R at system level but be able to use conda-analytics to install those system-level dependencies in the environment, it's just a question of PATH resolution and whether an R package can locate the library correctly

When we discussed this issue, @nettrom_WMF and @odimitrijevic brought up an idea of a centralized reference for documenting "safe" versions of specific packages (R and Python) and having a process for maintaining that document.

Gehel renamed this task from Conda analytics environments breakage to Conda analytics environments breakage - conflicting dependencies between r-base and other.Sep 6 2023, 8:34 AM

We need a higher level strategy on how we are exposing our compute / data platform. @lbowmaker should be able decide on a prioritization this work.

Just to provide an update on this, I pushed out version 0.0.23 of conda-analytics today, which includes the libmamba solver by default, as well as updated to conda itself and other transient dependencies.

I tried the conda install r-base=4.2.3 command in a newly cloned environment from this and this was the output shown.

(my-cool-env) btullis@stat1009:~$ conda install r-base=4.2.3
Channels:
 - conda-forge
 - defaults
Platform: linux-64
Collecting package metadata (repodata.json): done
Solving environment: | warning  libmamba Problem type not implemented SOLVER_RULE_STRICT_REPO_PRIORITY
warning  libmamba Problem type not implemented SOLVER_RULE_STRICT_REPO_PRIORITY
warning  libmamba Problem type not implemented SOLVER_RULE_STRICT_REPO_PRIORITY
warning  libmamba Problem type not implemented SOLVER_RULE_STRICT_REPO_PRIORITY
done

## Package Plan ##

  environment location: /home/btullis/.conda/envs/my-cool-env

  added / updated specs:
    - r-base=4.2.3


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    _r-mutex-1.0.1             |      anacondar_1           3 KB  conda-forge
    abseil-cpp-20220623.0      |       h8cdb687_6          17 KB  conda-forge
    anyio-4.0.0                |     pyhd8ed1ab_0          97 KB  conda-forge
    arrow-1.2.3                |     pyhd8ed1ab_0          92 KB  conda-forge
    arrow-cpp-11.0.0           |   ha770c72_5_cpu          30 KB  conda-forge
    async-lru-2.0.4            |     pyhd8ed1ab_0          15 KB  conda-forge
    aws-c-auth-0.6.24          |       h84a1944_5          93 KB  conda-forge
    aws-c-cal-0.5.20           |       hc60faf5_6          42 KB  conda-forge
    aws-c-common-0.8.11        |       h0b41bf4_0         194 KB  conda-forge
    aws-c-compression-0.2.16   |       h034cb4b_3          18 KB  conda-forge
    aws-c-event-stream-0.2.18  |       h75388cd_6          52 KB  conda-forge
    aws-c-http-0.7.4           |       hf084cc8_2         187 KB  conda-forge
    aws-c-io-0.13.17           |       h10df833_2         140 KB  conda-forge
    aws-c-mqtt-0.8.6           |       hc41645a_6         140 KB  conda-forge
    aws-c-s3-0.2.4             |       h1b8f470_3          74 KB  conda-forge
    aws-c-sdkutils-0.1.7       |       h034cb4b_3          51 KB  conda-forge
    aws-checksums-0.1.14       |       h034cb4b_3          49 KB  conda-forge
    aws-crt-cpp-0.19.7         |       h0073717_7         311 KB  conda-forge
    aws-sdk-cpp-1.10.57        |       h4707e7a_4         4.0 MB  conda-forge
    binutils_impl_linux-64-2.40|       hf600244_0         5.2 MB  conda-forge
    brotli-python-1.0.9        |  py310hd8f1fbe_9         319 KB  conda-forge
    bwidget-1.9.14             |       ha770c72_1         120 KB  conda-forge
    cached-property-1.5.2      |       hd8ed1ab_1           4 KB  conda-forge
    cached_property-1.5.2      |     pyha770c72_1          11 KB  conda-forge
    cairo-1.16.0               |    h0c91306_1017         1.1 MB  conda-forge
    conda-pack-0.7.1           |     pyhd8ed1ab_0          32 KB  conda-forge
    curl-8.3.0                 |       hca28451_0          91 KB  conda-forge
    expat-2.5.0                |       hcb278e6_1         134 KB  conda-forge
    font-ttf-dejavu-sans-mono-2.37|       hab24e00_0         388 KB  conda-forge
    font-ttf-inconsolata-3.000 |       h77eed37_0          94 KB  conda-forge
    font-ttf-source-code-pro-2.038|       h77eed37_0         684 KB  conda-forge
    font-ttf-ubuntu-0.83       |       hab24e00_0         1.9 MB  conda-forge
    fontconfig-2.14.2          |       h14ed4e7_0         266 KB  conda-forge
    fonts-conda-ecosystem-1    |                0           4 KB  conda-forge
    fonts-conda-forge-1        |                0           4 KB  conda-forge
    fqdn-1.5.1                 |     pyhd8ed1ab_0          14 KB  conda-forge
    freetype-2.12.1            |       h267a509_2         620 KB  conda-forge
    fribidi-1.0.10             |       h36c2ea0_0         112 KB  conda-forge
    gcc_impl_linux-64-13.2.0   |       h338b0a0_2        50.5 MB  conda-forge
    gettext-0.21.1             |       h27087fc_0         4.1 MB  conda-forge
    gfortran_impl_linux-64-13.2.0|       h76e1118_2        15.1 MB  conda-forge
    graphite2-1.3.13           |    h58526e2_1001         102 KB  conda-forge
    grpc-cpp-1.51.1            |       h27aab58_1          21 KB  conda-forge
    gsl-2.7                    |       he838d99_0         3.2 MB  conda-forge
    gxx_impl_linux-64-13.2.0   |       h338b0a0_2        12.6 MB  conda-forge
    harfbuzz-8.2.1             |       h3d44ed6_0         1.5 MB  conda-forge
    importlib_metadata-6.8.0   |       hd8ed1ab_0           9 KB  conda-forge
    isoduration-20.11.0        |     pyhd8ed1ab_0          17 KB  conda-forge
    jsonschema-with-format-nongpl-4.19.1|     pyhd8ed1ab_0           7 KB  conda-forge
    jupyter-lsp-2.2.0          |     pyhd8ed1ab_0          51 KB  conda-forge
    jupyter_client-8.3.1       |     pyhd8ed1ab_0         103 KB  conda-forge
    jupyter_events-0.7.0       |     pyhd8ed1ab_2          21 KB  conda-forge
    jupyter_server-2.7.3       |     pyhd8ed1ab_0         310 KB  conda-forge
    jupyter_server_terminals-0.4.4|     pyhd8ed1ab_1          19 KB  conda-forge
    jupyterhub-4.0.2           |     pyh31011fe_0           8 KB  conda-forge
    jupyterhub-base-4.0.2      |     pyh31011fe_0         1.5 MB  conda-forge
    jupyterhub-singleuser-4.0.2|     pyh31011fe_0           8 KB  conda-forge
    jupyterlab-4.0.6           |     pyhd8ed1ab_0         5.4 MB  conda-forge
    kernel-headers_linux-64-2.6.32|      he073ed8_16         692 KB  conda-forge
    lerc-4.0.0                 |       h27087fc_0         275 KB  conda-forge
    libabseil-20220623.0       | cxx17_h05df665_6         1.1 MB  conda-forge
    libarrow-11.0.0            |   h2ebd325_5_cpu        25.6 MB  conda-forge
    libcrc32c-1.1.2            |       h9c3ff4c_0          20 KB  conda-forge
    libdeflate-1.19            |       hd590300_0          66 KB  conda-forge
    libexpat-2.5.0             |       hcb278e6_1          76 KB  conda-forge
    libgcc-devel_linux-64-13.2.0|       ha9c7c90_2         2.3 MB  conda-forge
    libglib-2.78.0             |       hebfc3b9_0         2.6 MB  conda-forge
    libgoogle-cloud-2.7.0      |       h21dfe5b_1        34.9 MB  conda-forge
    libgrpc-1.51.1             |       h4fad500_1         5.0 MB  conda-forge
    libjpeg-turbo-2.1.5.1      |       hd590300_1         485 KB  conda-forge
    libpng-1.6.39              |       h753d276_0         276 KB  conda-forge
    libprotobuf-3.21.12        |       hfc55251_2         2.1 MB  conda-forge
    libsanitizer-13.2.0        |       h7e041cc_2         3.9 MB  conda-forge
    libstdcxx-devel_linux-64-13.2.0|       ha9c7c90_2         8.8 MB  conda-forge
    libthrift-0.18.0           |       h5e4af38_0         3.5 MB  conda-forge
    libtiff-4.6.0              |       h29866fb_1         271 KB  conda-forge
    libutf8proc-2.8.0          |       h166bdaf_0          99 KB  conda-forge
    libwebp-base-1.3.2         |       hd590300_0         392 KB  conda-forge
    libxcb-1.15                |       h0b41bf4_0         375 KB  conda-forge
    make-4.3                   |       hd18ef5c_1         507 KB  conda-forge
    notebook-7.0.4             |     pyhd8ed1ab_0         3.0 MB  conda-forge
    numpy-1.26.0               |  py310hb13e2d6_0         6.6 MB  conda-forge
    orc-1.8.2                  |       hfdbbad2_2         886 KB  conda-forge
    overrides-7.4.0            |     pyhd8ed1ab_0          29 KB  conda-forge
    pandas-2.1.1               |  py310hcc13569_0        11.8 MB  conda-forge
    pango-1.50.14              |       ha41ecd1_2         433 KB  conda-forge
    parquet-cpp-1.5.1          |                2           3 KB  conda-forge
    pcre2-10.40                |       hc3806b6_0         2.3 MB  conda-forge
    pixman-0.40.0              |       h36c2ea0_0         627 KB  conda-forge
    pthread-stubs-0.4          |    h36c2ea0_1001           5 KB  conda-forge
    py4j-0.10.9.7              |     pyhd8ed1ab_0         182 KB  conda-forge
    pyarrow-11.0.0             |py310h633f555_5_cpu         3.8 MB  conda-forge
    pyspark-3.4.1              |     pyhd8ed1ab_0       289.9 MB  conda-forge
    python-tzdata-2023.3       |     pyhd8ed1ab_0         140 KB  conda-forge
    pyyaml-6.0.1               |  py310h2372a71_1         167 KB  conda-forge
    pyzmq-25.1.1               |  py310h5bbb5d0_1         446 KB  conda-forge
    r-base-4.2.3               |       h0887e52_8        23.9 MB  conda-forge
    re2-2023.02.01             |       hcb278e6_0         196 KB  conda-forge
    rfc3339-validator-0.1.4    |     pyhd8ed1ab_0           8 KB  conda-forge
    rfc3986-validator-0.1.1    |     pyh9f0ad1d_0           8 KB  conda-forge
    s2n-1.3.37                 |       h3358134_0         352 KB  conda-forge
    sed-4.8                    |       he412f7d_0         264 KB  conda-forge
    sqlalchemy-2.0.21          |  py310h2372a71_0         2.5 MB  conda-forge
    sysroot_linux-64-2.12      |      he073ed8_16        14.6 MB  conda-forge
    tktable-2.10               |       h0c5db8f_4          87 KB  conda-forge
    typing_utils-0.1.0         |     pyhd8ed1ab_0          14 KB  conda-forge
    uri-template-1.3.0         |     pyhd8ed1ab_0          23 KB  conda-forge
    urllib3-2.0.5              |     pyhd8ed1ab_0          96 KB  conda-forge
    webcolors-1.13             |     pyhd8ed1ab_0          18 KB  conda-forge
    xorg-kbproto-1.0.7         |    h7f98852_1002          27 KB  conda-forge
    xorg-libice-1.1.1          |       hd590300_0          57 KB  conda-forge
    xorg-libsm-1.2.4           |       h7391055_0          27 KB  conda-forge
    xorg-libx11-1.8.6          |       h8ee46fc_0         809 KB  conda-forge
    xorg-libxau-1.0.11         |       hd590300_0          14 KB  conda-forge
    xorg-libxdmcp-1.1.3        |       h7f98852_0          19 KB  conda-forge
    xorg-libxext-1.3.4         |       h0b41bf4_2          49 KB  conda-forge
    xorg-libxrender-0.9.11     |       hd590300_0          37 KB  conda-forge
    xorg-libxt-1.3.0           |       hd590300_1         370 KB  conda-forge
    xorg-renderproto-0.11.1    |    h7f98852_1002           9 KB  conda-forge
    xorg-xextproto-7.3.0       |    h0b41bf4_1003          30 KB  conda-forge
    xorg-xproto-7.0.31         |    h7f98852_1007          73 KB  conda-forge
    yaml-0.2.5                 |       h7f98852_2          87 KB  conda-forge
    ------------------------------------------------------------
                                           Total:       568.1 MB

The following NEW packages will be INSTALLED:

  _r-mutex           conda-forge/noarch::_r-mutex-1.0.1-anacondar_1 
  arrow              conda-forge/noarch::arrow-1.2.3-pyhd8ed1ab_0 
  async-lru          conda-forge/noarch::async-lru-2.0.4-pyhd8ed1ab_0 
  aws-c-auth         conda-forge/linux-64::aws-c-auth-0.6.24-h84a1944_5 
  aws-c-cal          conda-forge/linux-64::aws-c-cal-0.5.20-hc60faf5_6 
  aws-c-compression  conda-forge/linux-64::aws-c-compression-0.2.16-h034cb4b_3 
  aws-c-http         conda-forge/linux-64::aws-c-http-0.7.4-hf084cc8_2 
  aws-c-io           conda-forge/linux-64::aws-c-io-0.13.17-h10df833_2 
  aws-c-mqtt         conda-forge/linux-64::aws-c-mqtt-0.8.6-hc41645a_6 
  aws-c-s3           conda-forge/linux-64::aws-c-s3-0.2.4-h1b8f470_3 
  aws-c-sdkutils     conda-forge/linux-64::aws-c-sdkutils-0.1.7-h034cb4b_3 
  aws-crt-cpp        conda-forge/linux-64::aws-crt-cpp-0.19.7-h0073717_7 
  binutils_impl_lin~ conda-forge/linux-64::binutils_impl_linux-64-2.40-hf600244_0 
  brotli-python      conda-forge/linux-64::brotli-python-1.0.9-py310hd8f1fbe_9 
  bwidget            conda-forge/linux-64::bwidget-1.9.14-ha770c72_1 
  cached-property    conda-forge/noarch::cached-property-1.5.2-hd8ed1ab_1 
  cached_property    conda-forge/noarch::cached_property-1.5.2-pyha770c72_1 
  cairo              conda-forge/linux-64::cairo-1.16.0-h0c91306_1017 
  curl               conda-forge/linux-64::curl-8.3.0-hca28451_0 
  expat              conda-forge/linux-64::expat-2.5.0-hcb278e6_1 
  font-ttf-dejavu-s~ conda-forge/noarch::font-ttf-dejavu-sans-mono-2.37-hab24e00_0 
  font-ttf-inconsol~ conda-forge/noarch::font-ttf-inconsolata-3.000-h77eed37_0 
  font-ttf-source-c~ conda-forge/noarch::font-ttf-source-code-pro-2.038-h77eed37_0 
  font-ttf-ubuntu    conda-forge/noarch::font-ttf-ubuntu-0.83-hab24e00_0 
  fontconfig         conda-forge/linux-64::fontconfig-2.14.2-h14ed4e7_0 
  fonts-conda-ecosy~ conda-forge/noarch::fonts-conda-ecosystem-1-0 
  fonts-conda-forge  conda-forge/noarch::fonts-conda-forge-1-0 
  fqdn               conda-forge/noarch::fqdn-1.5.1-pyhd8ed1ab_0 
  freetype           conda-forge/linux-64::freetype-2.12.1-h267a509_2 
  fribidi            conda-forge/linux-64::fribidi-1.0.10-h36c2ea0_0 
  gcc_impl_linux-64  conda-forge/linux-64::gcc_impl_linux-64-13.2.0-h338b0a0_2 
  gettext            conda-forge/linux-64::gettext-0.21.1-h27087fc_0 
  gfortran_impl_lin~ conda-forge/linux-64::gfortran_impl_linux-64-13.2.0-h76e1118_2 
  graphite2          conda-forge/linux-64::graphite2-1.3.13-h58526e2_1001 
  gsl                conda-forge/linux-64::gsl-2.7-he838d99_0 
  gxx_impl_linux-64  conda-forge/linux-64::gxx_impl_linux-64-13.2.0-h338b0a0_2 
  harfbuzz           conda-forge/linux-64::harfbuzz-8.2.1-h3d44ed6_0 
  importlib_metadata conda-forge/noarch::importlib_metadata-6.8.0-hd8ed1ab_0 
  isoduration        conda-forge/noarch::isoduration-20.11.0-pyhd8ed1ab_0 
  jsonschema-with-f~ conda-forge/noarch::jsonschema-with-format-nongpl-4.19.1-pyhd8ed1ab_0 
  jupyter-lsp        conda-forge/noarch::jupyter-lsp-2.2.0-pyhd8ed1ab_0 
  jupyter_events     conda-forge/noarch::jupyter_events-0.7.0-pyhd8ed1ab_2 
  jupyter_server_te~ conda-forge/noarch::jupyter_server_terminals-0.4.4-pyhd8ed1ab_1 
  kernel-headers_li~ conda-forge/noarch::kernel-headers_linux-64-2.6.32-he073ed8_16 
  lerc               conda-forge/linux-64::lerc-4.0.0-h27087fc_0 
  libarrow           conda-forge/linux-64::libarrow-11.0.0-h2ebd325_5_cpu 
  libcrc32c          conda-forge/linux-64::libcrc32c-1.1.2-h9c3ff4c_0 
  libdeflate         conda-forge/linux-64::libdeflate-1.19-hd590300_0 
  libexpat           conda-forge/linux-64::libexpat-2.5.0-hcb278e6_1 
  libgcc-devel_linu~ conda-forge/linux-64::libgcc-devel_linux-64-13.2.0-ha9c7c90_2 
  libglib            conda-forge/linux-64::libglib-2.78.0-hebfc3b9_0 
  libgoogle-cloud    conda-forge/linux-64::libgoogle-cloud-2.7.0-h21dfe5b_1 
  libgrpc            conda-forge/linux-64::libgrpc-1.51.1-h4fad500_1 
  libjpeg-turbo      conda-forge/linux-64::libjpeg-turbo-2.1.5.1-hd590300_1 
  libpng             conda-forge/linux-64::libpng-1.6.39-h753d276_0 
  libsanitizer       conda-forge/linux-64::libsanitizer-13.2.0-h7e041cc_2 
  libstdcxx-devel_l~ conda-forge/linux-64::libstdcxx-devel_linux-64-13.2.0-ha9c7c90_2 
  libtiff            conda-forge/linux-64::libtiff-4.6.0-h29866fb_1 
  libutf8proc        conda-forge/linux-64::libutf8proc-2.8.0-h166bdaf_0 
  libwebp-base       conda-forge/linux-64::libwebp-base-1.3.2-hd590300_0 
  libxcb             conda-forge/linux-64::libxcb-1.15-h0b41bf4_0 
  make               conda-forge/linux-64::make-4.3-hd18ef5c_1 
  overrides          conda-forge/noarch::overrides-7.4.0-pyhd8ed1ab_0 
  pango              conda-forge/linux-64::pango-1.50.14-ha41ecd1_2 
  parquet-cpp        conda-forge/noarch::parquet-cpp-1.5.1-2 
  pcre2              conda-forge/linux-64::pcre2-10.40-hc3806b6_0 
  pixman             conda-forge/linux-64::pixman-0.40.0-h36c2ea0_0 
  pthread-stubs      conda-forge/linux-64::pthread-stubs-0.4-h36c2ea0_1001 
  python-tzdata      conda-forge/noarch::python-tzdata-2023.3-pyhd8ed1ab_0 
  pyyaml             conda-forge/linux-64::pyyaml-6.0.1-py310h2372a71_1 
  r-base             conda-forge/linux-64::r-base-4.2.3-h0887e52_8 
  rfc3339-validator  conda-forge/noarch::rfc3339-validator-0.1.4-pyhd8ed1ab_0 
  rfc3986-validator  conda-forge/noarch::rfc3986-validator-0.1.1-pyh9f0ad1d_0 
  s2n                conda-forge/linux-64::s2n-1.3.37-h3358134_0 
  sed                conda-forge/linux-64::sed-4.8-he412f7d_0 
  sysroot_linux-64   conda-forge/noarch::sysroot_linux-64-2.12-he073ed8_16 
  tktable            conda-forge/linux-64::tktable-2.10-h0c5db8f_4 
  typing_utils       conda-forge/noarch::typing_utils-0.1.0-pyhd8ed1ab_0 
  uri-template       conda-forge/noarch::uri-template-1.3.0-pyhd8ed1ab_0 
  webcolors          conda-forge/noarch::webcolors-1.13-pyhd8ed1ab_0 
  xorg-kbproto       conda-forge/linux-64::xorg-kbproto-1.0.7-h7f98852_1002 
  xorg-libice        conda-forge/linux-64::xorg-libice-1.1.1-hd590300_0 
  xorg-libsm         conda-forge/linux-64::xorg-libsm-1.2.4-h7391055_0 
  xorg-libx11        conda-forge/linux-64::xorg-libx11-1.8.6-h8ee46fc_0 
  xorg-libxau        conda-forge/linux-64::xorg-libxau-1.0.11-hd590300_0 
  xorg-libxdmcp      conda-forge/linux-64::xorg-libxdmcp-1.1.3-h7f98852_0 
  xorg-libxext       conda-forge/linux-64::xorg-libxext-1.3.4-h0b41bf4_2 
  xorg-libxrender    conda-forge/linux-64::xorg-libxrender-0.9.11-hd590300_0 
  xorg-libxt         conda-forge/linux-64::xorg-libxt-1.3.0-hd590300_1 
  xorg-renderproto   conda-forge/linux-64::xorg-renderproto-0.11.1-h7f98852_1002 
  xorg-xextproto     conda-forge/linux-64::xorg-xextproto-7.3.0-h0b41bf4_1003 
  xorg-xproto        conda-forge/linux-64::xorg-xproto-7.0.31-h7f98852_1007 
  yaml               conda-forge/linux-64::yaml-0.2.5-h7f98852_2 

The following packages will be UPDATED:

  abseil-cpp                          20211102.0-h93e1e8c_2 --> 20220623.0-h8cdb687_6 
  anyio                                  3.7.1-pyhd8ed1ab_0 --> 4.0.0-pyhd8ed1ab_0 
  arrow-cpp          pkgs/main::arrow-cpp-8.0.0-py310h3098~ --> conda-forge::arrow-cpp-11.0.0-ha770c72_5_cpu 
  aws-c-common                             0.6.8-h7f98852_0 --> 0.8.11-h0b41bf4_0 
  aws-c-event-stream pkgs/main::aws-c-event-stream-0.1.6-h~ --> conda-forge::aws-c-event-stream-0.2.18-h75388cd_6 
  aws-checksums                          0.1.11-ha492f5f_12 --> 0.1.14-h034cb4b_3 
  aws-sdk-cpp        pkgs/main::aws-sdk-cpp-1.8.185-h721c0~ --> conda-forge::aws-sdk-cpp-1.10.57-h4707e7a_4 
  conda-pack                             0.7.0-pyh6c4a22f_0 --> 0.7.1-pyhd8ed1ab_0 
  grpc-cpp                                1.46.3-h0b91f02_1 --> 1.51.1-h27aab58_1 
  jupyter_client                         7.4.9-pyhd8ed1ab_0 --> 8.3.1-pyhd8ed1ab_0 
  jupyter_server                        1.24.0-pyhd8ed1ab_0 --> 2.7.3-pyhd8ed1ab_0 
  jupyterhub         conda-forge/linux-64::jupyterhub-1.5.~ --> conda-forge/noarch::jupyterhub-4.0.2-pyh31011fe_0 
  jupyterhub-base    conda-forge/linux-64::jupyterhub-base~ --> conda-forge/noarch::jupyterhub-base-4.0.2-pyh31011fe_0 
  jupyterhub-single~ conda-forge/linux-64::jupyterhub-sing~ --> conda-forge/noarch::jupyterhub-singleuser-4.0.2-pyh31011fe_0 
  jupyterlab                             3.4.8-pyhd8ed1ab_0 --> 4.0.6-pyhd8ed1ab_0 
  libabseil                     20211102.0-cxx17_h48a1fff_2 --> 20220623.0-cxx17_h05df665_6 
  libprotobuf                             3.20.3-h3eb15da_0 --> 3.21.12-hfc55251_2 
  libthrift                               0.15.0-h362ad58_1 --> 0.18.0-h5e4af38_0 
  notebook                               6.5.6-pyha770c72_0 --> 7.0.4-pyhd8ed1ab_0 
  numpy                              1.23.1-py310h53a5b5f_0 --> 1.26.0-py310hb13e2d6_0 
  orc                                      1.7.4-h6c59b99_1 --> 1.8.2-hfdbbad2_2 
  pandas                              1.4.3-py310h769672d_0 --> 2.1.1-py310hcc13569_0 
  py4j                                  0.10.9-pyh9f0ad1d_0 --> 0.10.9.7-pyhd8ed1ab_0 
  pyarrow            pkgs/main::pyarrow-8.0.0-py310h468efa~ --> conda-forge::pyarrow-11.0.0-py310h633f555_5_cpu 
  pyspark                                3.1.2-pyh6c4a22f_0 --> 3.4.1-pyhd8ed1ab_0 
  pyzmq                              24.0.1-py310h330234f_1 --> 25.1.1-py310h5bbb5d0_1 
  re2                                 2022.04.01-h27087fc_0 --> 2023.02.01-hcb278e6_0 
  sqlalchemy                         1.4.49-py310h2372a71_0 --> 2.0.21-py310h2372a71_0 
  urllib3                              1.26.15-pyhd8ed1ab_0 --> 2.0.5-pyhd8ed1ab_0 



Downloading and Extracting Packages
                                                                                                                                                                                                                   
Preparing transaction: done                                                                                                                                                                                        
Verifying transaction: done                                                                                                                                                                                        
Executing transaction: done                                                                                                                                                                                        
(my-cool-env) btullis@stat1009:~$

I then tried spawning a new jupyterhub server from this environment.

image.png (349×1 px, 28 KB)

I saw this in the log of the jupyterhub server:

Sep 26 11:21:32 stat1009 jupyterhub-conda-singleuser[2955565]: [E 2023-09-26 11:21:32.418 JupyterHubSingleUser] Failed to load JupyterHubSingleUser server extension                                               
Sep 26 11:21:32 stat1009 jupyterhub-conda-singleuser[2955565]:     Traceback (most recent call last):                                                                                                              
Sep 26 11:21:32 stat1009 jupyterhub-conda-singleuser[2955565]:       File "/home/btullis/.conda/envs/my-cool-env/lib/python3.10/site-packages/jupyterhub/singleuser/extension.py", line 274, in wrapped            
Sep 26 11:21:32 stat1009 jupyterhub-conda-singleuser[2955565]:         r = f(self, *args, **kwargs)                                                                                                                
Sep 26 11:21:32 stat1009 jupyterhub-conda-singleuser[2955565]:       File "/home/btullis/.conda/envs/my-cool-env/lib/python3.10/site-packages/jupyterhub/singleuser/extension.py", line 472, in load_config_file   
Sep 26 11:21:32 stat1009 jupyterhub-conda-singleuser[2955565]:         raise KeyError("Missing required environment $JUPYTERHUB_SERVICE_URL")                                                                      
Sep 26 11:21:32 stat1009 jupyterhub-conda-singleuser[2955565]:     KeyError: 'Missing required environment $JUPYTERHUB_SERVICE_URL'                                                                                
Sep 26 11:21:32 stat1009 systemd[1]: jupyter-btullis-singleuser-conda-analytics.service: Main process exited, code=exited, status=1/FAILURE                                                                        
Sep 26 11:21:32 stat1009 systemd[1]: jupyter-btullis-singleuser-conda-analytics.service: Failed with result 'exit-code'.                                                                                           
Sep 26 11:21:32 stat1009 systemd[1]: jupyter-btullis-singleuser-conda-analytics.service: Consumed 24.000s CPU time.

The server failed to spawn.

image.png (400×1 px, 44 KB)

I was able to get the environment to spawn correctly by downgrading the jupyterhub-singleuser and notebook packages to those found in the base conda-analytics environment.

(my-cool-env) btullis@stat1009:~$ conda install jupyterhub-singleuser=1.5.0 notebook=6.5.6

R is installed, but it is at version 4.3.1 which is more recent than the version we specified.

image.png (985×1 px, 109 KB)

So I'm wondering again whether we can do anything to pin the versions of packages that are crucial for Jupyter sessions to work, which would give the solver some better constraints as to what we're asking for.

Here are the instructions on how to pin a particular package.
https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-pkgs.html#pinning-packages

We need to create a file named conda-meta/pinned within the environment when it is cloned.
That file would contain something like the following:

jupyterhub-singleuser=1.5.*
notebook=6.5.*

It seems (from my extensive Googling) that there is no cli means to manage these package pins, we just have to edit the file manually.

I can look to do another build of conda-analytics to set these automatically, but I think it might be useful to try doing so manually with a new environment first.

Gehel triaged this task as Low priority.Oct 11 2023, 8:52 AM
Gehel moved this task from Incoming to Misc on the Data-Platform-SRE board.

@nettrom_WMF: When you're back from holidays, can you please try Ben's pinning solution and see if that resolves the issue you reported?

I've tested creating new environments on two stat machines with different OSes, and both with and without adding the conda-meta/pinned file. From what I can tell, the conda-forge R 4.2.3 package no longer results in a broken environment because it works just fine without the pin-file. Looking at the file listing on conda-forge, there have been several new versions of the package released since this bug was opened. Based on documentation I've found from googling it should be possible to install a specific build version, but it looks like the Mamba solver doesn't support it properly yet. It doesn't make sense to try this with the classic solver because that wasn't able to resolve the dependencies when I tried that back in August.

In short, several learnings:

  1. Because of the R package updates, this isn't reproducible.
  2. If a specific package breaks things try looking for a different build of the same version.
  3. Installing specific builds appears to require using the classic solver instead of Mamba, but that should be fine, it'll just take longer to resolve the dependency tree.

I think this can be resolved for now. If I or someone else comes across a package that breaks things, then we can try the pinning solution again.