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

proposal: remote cache (stepstone to central repository) #340

Closed
aaronkavlie-wf opened this issue Mar 18, 2016 · 7 comments
Closed

proposal: remote cache (stepstone to central repository) #340

aaronkavlie-wf opened this issue Mar 18, 2016 · 7 comments

Comments

@aaronkavlie-wf
Copy link

Background

Central package repositories are commonplace in package managers for other languages.
In Python (the language I'm most familiar with), packages rarely include code from other projects in their source tree.

Many Go developers would prefer to avoid checking in 3rd-party packages, to avoid the bloat and messy diffs that leads to. However, without vendored dependencies Go tools usually fetch packages from multiple independent hosts. This causes problems if projects move, hosts disappear (I'm looking at you, Google Code), repositories have downtime, etc. Central package repositories are typically much more reliable.

Solution

Following the lead of the caching functionality already in glide, I have a WIP implementation of a remote-cache option (name up for debate). This option would attempt to check out the package from a user-supplied URL first. Unlike a local cache it could not write to the cache, but it could supply the package name or URL (perhaps in the Referer header), so that a server could, in turn, check out (or pull updates) for the package so it's available for the next user.

Ideally you would be able to save this setting in a config file in your home directory (like pip) to avoid setting it on every usage.
It doesn't look like Glide has support for config files (discounting per-project glide.yaml files) yet, but this is pretty essential to make the feature usable.

@technosophos
Copy link
Member

I am very interested in this idea. A few others in the community have expressed interest in something like this too.

@mattfarina
Copy link
Member

I'm up for this and have been for some time. To link in other issues, #39 and #128 are related to this.

@aaronkavlie-wf
Copy link
Author

I can put up my WIP code. Didn't seem too complicated to add, though I got tripped up a bit by the implementation details in repo/vcs.go.

Thinking about it more, I'm not sure that "remote cache" adequately describes this functionality. A cache is often temporary and ephemeral. It would act like a cache only in that you fall back to fetching as usual (and that could even be potentially disabled, for companies with strict requirements for 3rd-party packages).

@sdboyer
Copy link
Member

sdboyer commented Apr 1, 2016

yes, WIP code would be beneficial, though...

what amounts to an engine rewrite for glide over in vsolver would likely change the dynamics of how this might work. in the parlance of that system, it could probably be implemented as an alternate SourceManager (compare to the - still very much WIP - built-in, local-cache-oriented default)

@aaronkavlie-wf
Copy link
Author

@sdboyer are @mattfarina & co planning to use vsolver for glide at some point, or is that speculative?

@sdboyer
Copy link
Member

sdboyer commented Apr 16, 2016

@aaronkavlie-wf yes, it's the formal plan. with any luck, i'll have a PR up sometime next week that gets things started.

@mattfarina
Copy link
Member

This has been implemented. See the mirror command and subcommands.

In the future I would like to add patterns to the mirror setup. Now that the groundwork has been laid it should be easy. Any takers?

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

No branches or pull requests

4 participants