Skip to content
This repository has been archived by the owner on Aug 23, 2018. It is now read-only.

Allow for custom mirror hosts for downloading registered packages #245

Closed
wants to merge 2 commits into from
Closed

Allow for custom mirror hosts for downloading registered packages #245

wants to merge 2 commits into from

Conversation

eeue56
Copy link
Contributor

@eeue56 eeue56 commented Oct 17, 2016

We discussed this almost a year ago, but this problem has come up again so I'm opening a new PR.

There's a sibling PR elm-lang/elm-make#121 that needs to be merged at the same time.

Problem

  • Github goes down sometimes
    • When it does, Elm packages go down meaning no builds can be made
  • Github is also slow depending on location
    • This makes all builds slow
  • Sometimes for local development, it's handy to be able to modify an package with a bug fix. This is pretty important to us in production, since right now I have to do some tricks like modifying things after they come down in order to fix or debug things.

Solution

  • Add the ability to use a different host instead of Github for getting zip files only
  • Default to github packages
  • Package resolving, etc, is all still done against package.elm-lang
  • Use this docker image for hosting a simple caching system

Proof is in the pudding

Before:
screen shot 2016-10-17 at 13 26 04

After:
screen shot 2016-10-17 at 13 25 56

This is about consistent for me in Norway. You will have different speeds depending on location. Note that the reliabilty is more important than the speed improvements, but they help out a bit!

@process-bot
Copy link

Thanks for the pull request! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

@rehno-lindeque
Copy link

rehno-lindeque commented Nov 21, 2016

Perhaps it's worth giving ipfs a mention here.

The nix package manager is considering ipfs integration NixOS/nix#859 NixOS/nixpkgs#18296 and some of the ipfs folks are building a package manager themselves https://github.com/whyrusleeping/gx#readme.

My understanding is that IPFS can even address git objects directly (as git uses merkle trees) and will support private networks at some point in the near future. Honestly, I can't say enough good things about the project.

@evancz
Copy link
Contributor

evancz commented Jul 10, 2017

This will be improved in a few ways soon:

  • Downloads are cached per user, so if you want fast CI, you should preserve that cache. In that case there is only one download from an external service ever.
  • There is good evidence for adding retries by default in Evidence for retry in package managers #276 which will help a bit
  • The package server can now route folks to different download endpoints (with known hashes) so we can start transitioning to a different host than GitHub. As that develops, it'll be clearer how we can allow people to do custom hosting.

In any case, the code here is not the hard part of getting a good solution, so I am going to close.

@evancz evancz closed this Jul 10, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants