-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Support conda (python) package manager #2213
Comments
Hi, does Renovate now support conda? |
Hi, just wondering whether there are plans to add conda support soon? Alternatively, shall I try adding it using the instructions here: https://github.com/renovatebot/renovate/blob/master/docs/development/adding-a-package-manager.md? |
No plans, and a PR would be very welcome! I updated the doc just now to make sure it's current. |
Thank you for updating the docs - I'll give this a go when I have some time :) |
#6969 duplicated this, thus closed it. The relevant comments from there: To also verify python package versions in conda environment files ( Did you already have any implementation ideas? Are there any workarounds or alternative ideas you've tried to avoid needing this feature? Conda environments can also include pip requirememnts, a workaround is to put those in a separate txt file, and have renovatebot check those.
This workaround however does not work for the conda packages (like the python=3.7 here, and any conda packages installed, like jupyter in this case) Is this a feature you'd be interested in implementing yourself? ** Related features** |
It would be helpful if anyone can provide some public repo examples that can be tested against, as well as clarifications on file naming / file syntax. For example should we match against every |
From their docs https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#creating-an-environment-from-an-environment-yml-file they reference it against environment.yml files. I know internally we use different names for our different projects (IE we name our env the same codename as the project so titan.yml ect) but if that is an issue we can look at changing them back to the conda default name. |
I'm also interested in this as the PyTorch images (and the jupyter-stack ones) use conda. |
We could give it a shot, starting from the datasource. I am not very familiar with typescript but I could give it a go. The docs in the datasource require a function called ``getReleases` with input:
If I understood it correctly, for something like
Am I missing something? |
I would just like to make a note that the conda-forge channel would be important to have support for (also in terms of ToS of the regular conda channel). |
I agree that starting with the datasource first makes best sense. Importantly, note that Renovate doesn't yet have the concept of "platform" for datasources but it looks like that might be necessary for conda packages? |
Jupyter docker images would also greatly benefit from this feature. Right now, we're updating our dependencies manually, and it would be great to get rid of this maintenance burden. |
Hey everyone, Anaconda engineer here. We've assembled a small group of engineers that is looking into adding functionality for conda over time. Please note that none of us is working on this full time right now, but work will be done over time. I've started implementing a datasource for conda in #14257, any help with my testing issue and feedback in general is very welcome! |
Thanks for starting the work on this! I am happy to start testing, but I am not sure how since I am new to renovate. I gave it a try with adding a
What is the best way to test and configure this? Or I am too early 😺 |
@mdehollander You're not too early, but there's no manager implemented yet, just a datasource. I'll take a first shot at a manager next Friday. You can check the datasource documentation at https://docs.renovatebot.com/modules/datasource/#conda-datasource. If you want to use it right now, here's an example for how to do so. In your
This annotates the {
"reviewersFromCodeOwners": "true",
"regexManagers": [
{
"description": "Upgrade conde dependencies",
"fileMatch": [
"(^|/)environment.yml$"
],
"matchStrings": [
"# renovate datasource=conda\\sdepName=(?<depName>.*?)\\s+- [a-z0-9]+==\"?(?<currentValue>.*)\"?"
],
"datasourceTemplate": "conda"
}
]
} The job of the package manager is to do the discovery/annotation that I show above automatically so that you don’t need any configuration in the default case. |
Thanks for the extra information and the example config. With this I managed to get a PR triggered for an update of a conda environment.
And 2 PRs for 2 packages that I enabled: https://github.com/mdehollander/orochi/pulls To get the environment files in subfolders recognized I changed the regular expression in the config to:
Looks very promising! Thanks! Looking forward for a manager :) |
@morremeyer I am wondering if you managed to work on automatic discovery of conda packages via the package manager. That would make the use on existing installation easier, because you don't need to annotate the env files :) |
for rattler_repodata_gateway crate, I think renovate should handle the http requests but not rust code so it can use renovat's shared http cache |
I assume renovate uses the fetch api, which is what the rust code will also use. |
It have a wrapped http request client to be used in all data source
|
I see, yeah that complicates things. We can probably make this work but it will make things more complicated. From what I understand the But I believe the fetch API also does caching, so as long as renovate is not requesting the same URLs (which doesnt make a lot of sense when you use the gateway) I dont think its that bad of a problem. Ill not be implementing a custom fetch API in the initial version of the rattler gateway API. Would be happy to accept PRs though! |
It's not only the file size but also memory usage. for example, parsing import * as fs from 'node:fs';
const file = fs.readFileSync(`./conda-forge/linux-64/repodata.json`, 'utf8');
const obj = JSON.parse(file);
console.log(process.memoryUsage());
const _ = obj; {
rss: 1052028928,
heapTotal: 1012838400,
heapUsed: 983224232,
external: 1691001,
arrayBuffers: 10475
} |
does anaconda has sharded_repodata now? looks like not conda/conda-index#161 |
The memory usage is significantly reduced by using the gateway. It does not parse the entire file as JSON but only cleverly parses the parts from the repodata that it actually needs. It does however need all the bytes in memory. With sharded repodata this problem is also mitigated.
Unfortunately not yet. |
I think renovate also support auth config for each http host, which is supported by |
I only use anaconda so I also won't implement it. 😅 |
I'd like to suggest we rename current |
It depends. Assuming that non-anaconda registries will be supported in future, would they be best added to the existing datasource, or to a separate one? If the anaconda API is close to identical to the non-anaconda Conda APIs, then it should be the same datasource (like we do with |
I think a separate one.
It's not very close. non-anaconda conda repo doesn't even have API for single package. Anaconda api is also not part of spec |
It's kind like git tags / github tags |
The next challenge is that although we could rename |
oops, I forget there is regex manager, someone is already using it. |
We could call the new one simply |
Couldn't we call that one |
conda-channel looks good and make more sence. |
Funny that you mention that. I have plans for |
I was actually just thinking the same thing. For multiple channels package, you can't use different data source, so a single conda data source would be more ideal. In this case, the manager that produce conda packages should prepare the full registry urls (to the conda repo), for conda-forge with anaconda it should be Then we parse registry url in conda data source to decide how we get packages versions, for example use api.anaconda for And in manager, it should output packages in following cases, all // what current conda data source support, goes to api.anaconda.org
{
packageName: 'conda-forge/numpy',
}
// goes to https://prefix.dev/api/graphql.
{
packageName: 'numpy',
registryUrls: ["https://prefix.dev/conda-forge/"]
}
// for multiple channel support, goes to api.anaconda.org and will fallback to
// https://prefix.dev/api/graphql
// if it's missing from api.anaconda.org conda-forge.
{
packageName: 'numpy',
registryUrls: [
"https://conda.anaconda.org/conda-forge/",
"https://prefix.dev/conda-forge/",
]
}
// for multiple channel support, goes to api.anaconda.org first,
// then use generic conda logic to get versions from
// https://conda.repo.some.org/internal/
{
packageName: 'package-not-exists-in-conda-forge',
registryUrls: [
"https://conda.anaconda.org/conda-forge/",
"https://conda.repo.some.org/internal/",
]
} And we keep the current default registry url of conda data source (which is api.anaconda) so current regex manager users will also be happy. for a environment.yml example: name: example
channels:
- https://conda.anaconda.org/menpo
- conda-forge
dependencies:
- python==3.5.2
- conda-forge::numpy
- pip:
- tensorflow I would expect it to produce this: [
{
packageName: 'python',
datasource: 'conda',
versioning: 'conda',
currentValue: '==3.5.2',
registryUrls: [
"https://conda.anaconda.org/menpo/",
"https://conda.anaconda.org/conda-forge/",
]
},
{
packageName: 'conda-forge/numpy',
versioning: 'conda',
datasource: 'conda',
},
{
packageName: 'tensorflow',
versioning: 'pep440',
datasource: 'pypi',
}
] And there is also a Should we allow conda manager and pixi manager produce package like this? It currently work with our conda manger, but now very ideal
I think it would be best that manager never use api url as registry url in the future, but currenly it should do this to support multiple channels from anaconda, and ignore channels that are not from anaconda (for now). |
If you use the prefix graphql API you can use the If you use repodata.json, yanked entries should be under the Does that help? |
#34646 should work for most case of pixi, now I just need to get it merged 😄 You should be able to get lock file maintenance of pixi when renovate deploy 39.190.0 to production. |
https://conda.io/docs/
The text was updated successfully, but these errors were encountered: