jupyterhub / repo2docker

Turn repositories into Jupyter-enabled Docker images
https://repo2docker.readthedocs.io
BSD 3-Clause "New" or "Revised" License
1.63k stars 362 forks source link

repo2docker ignores the python environment when the extension is `yaml` #1373

Open shaneknapp opened 1 month ago

shaneknapp commented 1 month ago

Bug description

when building an image, if the python environment file is named environment.yaml, the build will default to python 3.10 and skip installing the environment. if you get the build to pass, you will most likely be unable to launch the notebook locally.

Expected behaviour

the image should properly ingest the python env definition regardless of the file extension, especially as yaml.org recommends that you use .yaml over .yml.

Actual behaviour

(dh) ➜  hub-user-image-template git:(update-default-image-config) ✗ mv environment.yml environment.yaml
(dh) ➜  hub-user-image-template git:(update-default-image-config) ✗ ls -l environment.yaml
-rw-r--r-- 1 sknapp sknapp 619 Oct  4 15:00 environment.yaml
(dh) ➜  hub-user-image-template git:(update-default-image-config) ✗ grep python environment.yaml
  - python==3.11.*
(dh) ➜  hub-user-image-template git:(update-default-image-config) ✗ repo2docker .
Picked Local content provider.
Using local repo ..
Python version unspecified, using current default Python version 3.10. This will change in the future.Building conda environment for python=3.10  <----- womp womp!
Using PythonBuildPack builder
Step 1/52 : FROM docker.io/library/buildpack-deps:jammy
^C
(dh) ➜  hub-user-image-template git:(update-default-image-config) ✗ mv environment.yaml environment.yml
(dh) ➜  hub-user-image-template git:(update-default-image-config) repo2docker .
Picked Local content provider.
Using local repo ..
Building conda environment for python=3.11  <------- yay it works!
Using CondaBuildPack builder
Step 1/55 : FROM docker.io/library/buildpack-deps:jammy
 ---> e6c58935b80a
^C

How to reproduce

  1. on the cli: mv environment.yml environment.yaml
  2. run repo2docker in the image directory
  3. see that it's using the default of python 3.10
  4. note that repo2docker then won't ingest environment.yaml later in the build process

Your personal set up