boa
boa copied to clipboard
Private token as env variables not working
We are running a private conda-forge like infrastructure (with a private conda channel) and our builds stopped working since boa is the new default in conda-smithy (see https://github.com/conda-forge/conda-smithy/pull/1507).
Here is the channel_sources we are using in conda_build_config.yaml:
channel_sources:
- t/$PRIVATE_TOKEN/private_channel,conda-forge,channel_xx,channel_yy,defaults
Here is the error in our Azure private conda-forge like CI:
Traceback (most recent call last):
File "/opt/conda/bin/conda-mambabuild", line 10, in <module>
sys.exit(main())
File "/opt/conda/lib/python3.8/site-packages/boa/cli/mambabuild.py", line 164, in main
call_conda_build(action, config)
File "/opt/conda/lib/python3.8/site-packages/boa/cli/mambabuild.py", line 137, in call_conda_build
result = api.build(
File "/opt/conda/lib/python3.8/site-packages/conda_build/api.py", line 186, in build
return build_tree(
File "/opt/conda/lib/python3.8/site-packages/conda_build/build.py", line 3068, in build_tree
packages_from_this = build(metadata, stats,
File "/opt/conda/lib/python3.8/site-packages/conda_build/build.py", line 2108, in build
create_build_envs(top_level_pkg, notest)
File "/opt/conda/lib/python3.8/site-packages/conda_build/build.py", line 1965, in create_build_envs
environ.get_install_actions(m.config.test_prefix,
File "/opt/conda/lib/python3.8/site-packages/boa/cli/mambabuild.py", line 83, in mamba_get_install_actions
solution = solver.solve_for_action(_specs, prefix)
File "/opt/conda/lib/python3.8/site-packages/boa/core/solver.py", line 241, in solve_for_action
return to_action(
File "/opt/conda/lib/python3.8/site-packages/boa/core/solver.py", line 79, in to_action
entry = lookup_dict[get_url_from_channel(c)]
KeyError: 'https://conda.anaconda.org/private_channel/linux-64'
Is that bug or something that is not supported?
For now, this fix is to set build_with_mambabuild: false in the conda-forge.yml file for every feedstock we have.
For those struggling with the same issue the workaround is to prefix the channel with the URL:
channel_sources:
- https://conda.anaconda.org/t/$PRIVATE_TOKEN/private_channel,conda-forge,channel_xx,channel_yy,defaults
It's not a proper fix since it used to work before boa but at least it works now :-)
ping @wolfv FYI!
Let's keep this open, but I am glad that you found a workaround!