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

fix: allow for private anaconda channels #53

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

s22chan
Copy link

@s22chan s22chan commented Nov 26, 2024

The two ways to specify a private channel are:

  1. https://conda.anaconda.org/t/<TOKEN>/...
  2. use the anaconda-client cli to create a token at the binstar location

I've checked both and it doesn't leak the token in the logs or anywhere as long as you specify the token as an envvar, eg:

https://conda.anaconda.org/t/$ANACONDA_TOKEN/...

but this only works in mamba/conda and not in micromamba.

The resulting conda_v2.cnd looks like:

{"version": 1, "mappings": {}, "mutable_aliases": {}, "aliases": {"419c2574132266f8e08b27ccd6208420c8eb6b5d": ["2e0779d176243c7b4c1765ecd3a4ff643115d04d", "419c2574132266f8e08b27ccd6208420c8eb6b5d"]}, "environments": {"osx-64": {"2e0779d176243c7b4c1765ecd3a4ff643115d04d": {"419c2574132266f8e08b27ccd6208420c8eb6b5d": {"deps": ["conda::python==3.10", "conda::requests==>=2.21.0"], "sources": ["conda::https://conda.anaconda.org/t/$ANACONDA_TOKEN/channel",

The two ways to specify a private channel are:
1. https://conda.anaconda.org/t/<TOKEN>/...
2. use the `anaconda-client` cli to create a token at the binstar location

I've checked both and it doesn't leak the token in the logs or anywhere as long as you specify the token as an envvar, eg:

`https://conda.anaconda.org/t/$ANACONDA_TOKEN/...`

but this only works in mamba/conda and not in micromamba.

The resoluting `conda_v2.cnd` looks like:

```json
{"version": 1, "mappings": {}, "mutable_aliases": {}, "aliases": {"419c2574132266f8e08b27ccd6208420c8eb6b5d": ["2e0779d176243c7b4c1765ecd3a4ff643115d04d", "419c2574132266f8e08b27ccd6208420c8eb6b5d"]}, "environments": {"osx-64": {"2e0779d176243c7b4c1765ecd3a4ff643115d04d": {"419c2574132266f8e08b27ccd6208420c8eb6b5d": {"deps": ["conda::python==3.10", "conda::requests==>=2.21.0"], "sources": ["conda::https://conda.anaconda.org/t/$ANACONDA_TOKEN/channel",
```
@s22chan
Copy link
Author

s22chan commented Nov 27, 2024

actually contrary to the anaconda docs, https://[email protected] also works so feel free to close this

@romain-intel
Copy link
Contributor

So, to confirm, does the current code satisfy what you need (ie: can you specify private conda repos already)?

@s22chan
Copy link
Author

s22chan commented Nov 27, 2024

So, to confirm, does the current code satisfy what you need (ie: can you specify private conda repos already)?

yep and thanks for checking in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants