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

[poc][wip] Cache in local Artifactory everything that is downloaded by Conan #8110

Closed
wants to merge 3 commits into from

Conversation

jgsogo
Copy link
Contributor

@jgsogo jgsogo commented Nov 25, 2020

Changelog: (Feature | Fix | Bugfix): Describe here your pull request
Docs: https://github.com/conan-io/docs/pull/XXXX

This is just to start talking about it and realize about different needs

  • What do we want to cache? Everything like the DownloadCache does or just the things used by the recipe?
    The DownloadCache caches every file, the conanfile.py, conanmanifest.txt,... Here we probably want to cache only 3rdparty files:
    • can we filter them using the URLs in the remote.json (maybe only v2)?
    • activate some flag before running certain methods to enable/disable this cache?
  • Do we want to provide some organization inside the generic repo or everything inside one folder?
  • Credentials: use JFrog CLI under the hood and forget about credentials?
    • use-case: the user can try-get artifacts, but cannot upload them.

Refactor before? Chain download classes?

@jgsogo jgsogo self-assigned this Nov 25, 2020
Copy link
Member

@memsharded memsharded left a comment

Choose a reason for hiding this comment

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

Good start. A few ideas:

The DownloadCache caches every file, the conanfile.py, conanmanifest.txt,... Here we probably want to cache only 3rdparty files:

yes, I think this backup should only cache things outside the Conan remotes, it doesn't make sense to cache thing from Conan repos. To think: What happen with "git clone" source retrieval that is not a download?

can we filter them using the URLs in the remote.json (maybe only v2)?

Yes, I think this is the way to go. No need v2 only, this feature will be new and experimental, so it can have implemented.

activate some flag before running certain methods to enable/disable this cache?
I would prefer the cache to filter based on origins if possible, instead of methods.

Do we want to provide some organization inside the generic repo or everything inside one folder?

I would say it should be a hash based storage, no organization.

Lets do some brainstorming about this, this was a good kick off!

@@ -445,6 +445,14 @@ def download_cache(self):
except ConanException:
return None

@property
def artifactory_cache(self):
Copy link
Member

Choose a reason for hiding this comment

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

Better avoid the "cache" term, and call it something like "sources backup"

@jgsogo
Copy link
Contributor Author

jgsogo commented Nov 25, 2020

  • The problem with the API v1 is the get_download_urls, they might point to an URL different from the remote one. But, the failing behavior would be to store more things in Artifactory, not a big issue though.

  • SCM sources. I see some integration for Git LFS and Artifactory, but nothing built-in. I would say this can wait for a second iteration, it will affect recipes using SCM feature and servers that cannot create a bundle from a commit, but this w won't happen for recipes in ConanCenter. IMO, this won't block this feature.

@memsharded
Copy link
Member

The problem with the API v1 is the get_download_urls, they might point to an URL different from the remote one. But, the failing behavior would be to store more things in Artifactory, not a big issue though.

That is true, it is possible, but I am not aware of any server implementation right now that uses different URLs for the downloads, so it could be a good enough assumption. I am fine with providing this for revisions V2 only.

SCM sources. I see some integration for Git LFS and Artifactory, but nothing built-in. I would say this can wait for a second iteration, it will affect recipes using SCM feature and servers that cannot create a bundle from a commit, but this w won't happen for recipes in ConanCenter. IMO, this won't block this feature.

Yes, agree it can wait, it is just something to think at some point.

@jgsogo jgsogo added this to the 1.33 milestone Dec 1, 2020
@jgsogo
Copy link
Contributor Author

jgsogo commented Dec 1, 2020

This PR needs to be implemented on top of #8116

@jgsogo
Copy link
Contributor Author

jgsogo commented Dec 15, 2020

Superseded by #8211

@jgsogo jgsogo closed this Dec 15, 2020
@jgsogo jgsogo deleted the poc/sources_cache branch December 15, 2020 12:42
@czoido czoido removed this from the 1.33 milestone Jan 12, 2021
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.

3 participants