1

Why can't conda complete an update when running on an azure vm as part of an azure build pipeline?

  conda av metadata url : None
           channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /usr/share/miniconda/pkgs
                          /home/vsts/.conda/pkgs
       envs directories : /usr/share/miniconda/envs
                          /home/vsts/.conda/envs
               platform : linux-64
             user-agent : conda/4.10.3 requests/2.25.1 CPython/3.9.5 Linux/5.8.0-1040-azure ubuntu/20.04.3 glibc/2.31
                UID:GID : 1001:121
             netrc file : None
           offline mode : False


track_features: []
unsatisfiable_hints: True
unsatisfiable_hints_check_depth: 2
update_modifier: update_specs
use_index_cache: False
use_local: False
use_only_tar_bz2: False
verbosity: 0
verify_threads: 1
whitelist_channels: []

conda install -c anaconda python=3.7

    cryptography-3.4.7         |   py37hd23ed53_0         904 KB
    openssl-1.1.1l             |       h7f8727e_0         2.5 MB
    pip-21.0.1                 |   py37h06a4308_0         1.8 MB
    pycosat-0.6.3              |   py37h27cfd23_0          81 KB
    pysocks-1.7.1              |           py37_1          27 KB
    python-3.7.11              |       h12debd9_0        45.3 MB
    ruamel_yaml-0.15.100       |   py37h27cfd23_0         253 KB
    setuptools-52.0.0          |   py37h06a4308_0         710 KB
    ------------------------------------------------------------
                                           Total:        56.1 MB

The following packages will be UPDATED:

  openssl                                 1.1.1k-h27cfd23_0 --> 1.1.1l-h7f8727e_0
  pysocks                              1.7.1-py39h06a4308_0 --> 1.7.1-py37_1

The following packages will be DOWNGRADED:

  brotlipy                          0.7.0-py39h27cfd23_1003 --> 0.7.0-py37h27cfd23_1003
  certifi                          2021.5.30-py39h06a4308_0 --> 2021.5.30-py37h06a4308_0
  cffi                                1.14.6-py39h400218f_0 --> 1.14.6-py37h400218f_0
  chardet                           4.0.0-py39h06a4308_1003 --> 4.0.0-py37h06a4308_1003
  conda                               4.10.3-py39h06a4308_0 --> 4.10.3-py37h06a4308_0
  conda-package-han~                   1.7.3-py39h27cfd23_1 --> 1.7.3-py37h27cfd23_1
  cryptography                         3.4.7-py39hd23ed53_0 --> 3.4.7-py37hd23ed53_0
  pip                                 21.1.3-py39h06a4308_0 --> 21.0.1-py37h06a4308_0
  pycosat                              0.6.3-py39h27cfd23_0 --> 0.6.3-py37h27cfd23_0
  python                                   3.9.5-h12debd9_4 --> 3.7.11-h12debd9_0
  ruamel_yaml                       0.15.100-py39h27cfd23_0 --> 0.15.100-py37h27cfd23_0
  setuptools                          52.0.0-py39h06a4308_0 --> 52.0.0-py37h06a4308_0


It will stall here until 60 minute timeout.

FlyingTeller
  • 17,638
  • 3
  • 38
  • 53
C.B.
  • 8,140
  • 1
  • 13
  • 5
  • 1
    Because changing Python versions in place involves reinstalling every package that isn't a `noarch` build. Not recommended - create a new environment instead. – merv Sep 09 '21 at 18:06
  • @merv it looks like the environment is small enough and conda also reports a succesfull solve. Changing 14 packages also does not sound too much. Or am I mistaken? – FlyingTeller Sep 10 '21 at 06:50
  • OK. Instead of changing python version in place, I've tried to create a new environment instead with this line: conda env create -n myenvironment -f myconfig.yml python=3.7 The config has the following: name: myconfig channels: - conda-forge - bioconda - defaults - local dependencies: - _libgcc_mutex=0.1 ... 214 different packages as dependencies - zlib=1.2.1 The result is the same, timeout after 60 minutes. So is it just perhaps that I have to let conda have more time to solve all these dependencies? – C.B. Sep 10 '21 at 15:19
  • 2
    I ran it manually on a permanent VM instead of the ephemeral pipeline vm. There is a prompt during execution: Proceed ([y]/n)? y. The output in Azure does not reveal this prompt. I added -y to conda install command, works. See: https://stackoverflow.com/questions/34644612/conda-silently-installing-a-package and https://docs.conda.io/projects/conda/en/latest/commands/install.html#Output,%20Prompt,%20and%20Flow%20Control%20Options – C.B. Sep 10 '21 at 18:07
  • ah, so it was timing out waiting on the prompt reply. good catch. I’m confused though why the YAML version timed out. The `conda env` commands do not include a confirmation prompt. – merv Sep 10 '21 at 23:51

1 Answers1

1

Thank you C.B. and Merv. Posting your suggestion as an answer to help other community members.

You can run it manually on a permanent VM instead of the ephemeral pipeline VM. There is a prompt during execution: Proceed ([y]/n)?. The output in Azure does not reveal this prompt.

To overcome timing out while waiting for the prompt reply, you can run this command conda install -y. It does not ask for confirmation.

You can refer to Conda - Silently installing a package and conda install

Ecstasy
  • 1,866
  • 1
  • 9
  • 17