Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use channel_remap for envs.txt too #656

Merged
merged 11 commits into from
Mar 23, 2023
Merged

Conversation

EisW
Copy link
Contributor

@EisW EisW commented Mar 6, 2023

Description

Fix #654

Created installer with private channels does not find the package(s) from private channel during install.
This occured on Windows and Linux, but should be alike for OSX

Checklist - did you ...

  • Add a file to the news directory (using the template) for the next release's release notes?
  • Add / update necessary tests?
  • Add / update outdated documentation?

@EisW EisW requested a review from a team as a code owner March 6, 2023 19:47
@conda-bot
Copy link
Contributor

We require contributors to sign our Contributor License Agreement and we don't have one on file for @EisW.

In order for us to review and merge your code, please e-sign the Contributor License Agreement PDF. We then need to manually verify your signature. We will ping the bot to refresh the PR status when we have confirmed your signature.

@EisW
Copy link
Contributor Author

EisW commented Mar 7, 2023

The added example, (with test instructions as comment in it) generates "myinstaller-0.0.1.sh"

Without the provided fix the installer fails with assertion:

[user@machine ~]$ sh myinstaller-0.0.1-Linux-x86_64.sh -p pytest123 -b
PREFIX=/home/user/pytest123
Unpacking payload ...

Installing base environment...


Downloading and Extracting Packages


# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

    Traceback (most recent call last):
      File "conda/exceptions.py", line 1118, in __call__
      File "conda/cli/main.py", line 69, in main_subshell
      File "conda/cli/conda_argparse.py", line 91, in do_call
      File "conda/notices/core.py", line 109, in wrapper
      File "conda/cli/main_install.py", line 20, in execute
      File "conda/cli/install.py", line 191, in install
      File "conda/misc.py", line 113, in explicit
    AssertionError: Missing package cache records for: mychannel/linux-64::bitvector==3.5.0=pyhd8ed1ab_0[md5=6ef8a839230e9f9b5ca18b50e5f7a116]

`$ /home/user/pytest123/conda.exe install --offline --file /home/user/pytest123/pkgs/env.txt -yp /home/user/pytest123`

  environment variables:
                 CIO_TEST=<not set>
           CONDA_CHANNELS=conda-forge
CONDA_EXTRA_SAFETY_CHECKS=no
          CONDA_PKGS_DIRS=/home/user/pytest123/pkgs
               CONDA_ROOT=/home/user/pytest123/install_tmp/_MEIKtdIsq
      CONDA_SAFETY_CHECKS=disabled
           CURL_CA_BUNDLE=<not set>
          LD_LIBRARY_PATH=/home/user/pytest123/install_tmp/_MEIKtdIsq
               LD_PRELOAD=<not set>
      OLD_LD_LIBRARY_PATH=
                     PATH=/home/user/.local/bin:/home/user/bin:/usr/local/bin:/usr/bin:/us
                          r/local/sbin:/usr/sbin
       REQUESTS_CA_BUNDLE=<not set>
            SSL_CERT_FILE=<not set>

     active environment : None
       user config file : /home/user/.condarc
 populated config files :
          conda version : 22.11.1
    conda-build version : not installed
         python version : 3.9.15.final.0
       virtual packages : __archspec=1=x86_64
                          __glibc=2.28=0
                          __linux=4.18.0=0
                          __unix=0=0
       base environment : /home/user/pytest123/install_tmp/_MEIKtdIsq  (read only)
      conda av data dir : /home/user/pytest123/install_tmp/_MEIKtdIsq/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/linux-64  (offline)
                          https://conda.anaconda.org/conda-forge/noarch  (offline)
          package cache : /home/user/pytest123/pkgs
       envs directories : /home/user/.conda/envs
                          /home/user/pytest123/install_tmp/_MEIKtdIsq/envs
               platform : linux-64
             user-agent : conda/22.11.1 requests/2.28.1 CPython/3.9.15 Linux/4.18.0-425.13.1.el8_7.x86_64 rocky/8.7 glibc/2.28
                UID:GID : 1000:1000
             netrc file : None
           offline mode : True


An unexpected error has occurred. Conda has prepared the above report.

Upload successful.

With the fix it rans perfectly and installation is usable (tested under Windows and Linux)

remove trailing whitespace
EisW added a commit to EisW/constructor that referenced this pull request Mar 13, 2023
@EisW EisW mentioned this pull request Mar 13, 2023
3 tasks
Comment on lines 8 to 14
# prepare private channel first:
# (1) create folder for channel: mkdir -p /tmp/mychannel/linux-64
# (2) copy a private package into channel:
# (2.1) simulate with package from conda-forge: wget https://anaconda.org/conda-forge/bitvector/3.5.0/download/noarch/bitvector-3.5.0-pyhd8ed1ab_0.conda
# (2.2) cp bitvector-3.5.0-pyhd8ed1ab_0.conda /tmp/mychannel/linux-64/
# (2.3) Create index (required for usage): conda index /tmp/mychannel
# (3) Now create installer: constructor examples/use_channel_remap/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we provide this as a little script under scripts/ so we test this in CI? 🙏

@EisW
Copy link
Contributor Author

EisW commented Mar 13, 2023 via email

EisW and others added 4 commits March 13, 2023 14:33
Co-authored-by: jaimergp <jaimergp@users.noreply.github.com>
Interesting: The created installer was valid though, because URL
is not used during install, only for verify cache, which works fine
@EisW
Copy link
Contributor Author

EisW commented Mar 18, 2023

CLA Check failed again: must I sign again? Or is this just a barrier to prevent automatic merge?

Btw: with a little hack the channel remap is now tested within CI.

@EisW EisW requested a review from jaimergp March 22, 2023 07:22
@jaimergp
Copy link
Contributor

CLA Check failed again: must I sign again?

This has to be manually approved by someone at Anaconda. @jezdez @dbast - can anyone check please? Thanks!

@jezdez
Copy link
Member

jezdez commented Mar 22, 2023

This was merged earlier today in conda/infrastructure#729

@jezdez
Copy link
Member

jezdez commented Mar 22, 2023

@conda-bot check

@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Mar 22, 2023
@EisW
Copy link
Contributor Author

EisW commented Mar 22, 2023

Sorry, do not understand the failed test: may some temporary condition on CI?
I assume no difference in codepath between the OS versions

@jaimergp
Copy link
Contributor

Let's re-run it. Maybe there's a repodata issue in defaults for macos, but that'd be weird. We could use conda-forge for the example and see if that provides a passing test.

@EisW
Copy link
Contributor Author

EisW commented Mar 23, 2023 via email

@jaimergp
Copy link
Contributor

Well it worked :)

@jaimergp jaimergp merged commit a0d68c2 into conda:main Mar 23, 2023
@EisW EisW deleted the fix_channel_remap branch March 23, 2023 11:40
@jaimergp jaimergp mentioned this pull request Jun 19, 2023
31 tasks
@github-actions github-actions bot added the locked [bot] locked due to inactivity label Mar 23, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla-signed [bot] added once the contributor has signed the CLA locked [bot] locked due to inactivity
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

The generated pkgs/envs.txt does not honour info['channel_remap']
4 participants