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

A set of useful alternative package index mirrors? #3870

Open
HuStmpHrrr opened this issue Feb 16, 2018 · 9 comments
Open

A set of useful alternative package index mirrors? #3870

HuStmpHrrr opened this issue Feb 16, 2018 · 9 comments

Comments

@HuStmpHrrr
Copy link

Similar issue has been around for long and I cannot find a place where it shows what can be the alternative mirrors when s3 is not working well. Specifically, I was trying to download package index for the last 24 hours without managing it.

A couple of related issues are following:

#1223
#774
#3088

So I am wondering if there is already a list of stable alternative mirrors which can be used already? I can only find such alternatives in github issues. Wouldn't it be a good idea to make it in documentation?

I cannot find such list in the documentation, my apologies if I looked over.

@hvr
Copy link

hvr commented Feb 16, 2018

So I am wondering if there is already a list of stable alternative mirrors which can be used already?

As a matter of fact there is! The work on Hackage Security (funded by the Industrial Haskell Group (IHG)) made this possible, and there's even a DNS-based discovery protocol available which allows cabal and other Hackage clients to discover mirrors (as you obviously wouldn't want to hardcode them) when being bootstrapped in case the primary upstream is unreachable. But you can also take a look at http://hackage.haskell.org/mirrors.json to see a list of currently registered fallback mirrors; but generally from a UX perspective this is something that IMO should ideally be handled automatically by the tooling w/o requiring user intervention - maybe Stack could steal some ideas from Cabal in this context.

@mgsloan
Copy link
Contributor

mgsloan commented Feb 16, 2018

Looks like mirrors.json only has 2 things in it, and one is the default `
https://s3.amazonaws.com/hackage.fpcomplete.com/". The following seems to
work for the fpco mirror, standard hackage and the dream.io mirror:

package-indices:
- name: fpco-hackage-mirror
  download-prefix: https://s3.amazonaws.com/hackage.fpcomplete.com/packages/
  http: https://s3.amazonaws.com/hackage.fpcomplete.com/
  hackage-security:
    keyids:
      [ "0a5c7ea47cd1b15f01f5f51a33adda7e655bc0f0b0615baa8e271f4c3351e21d"
      , "1ea9ba32c526d1cc91ab5e5bd364ec5e9e8cb67179a471872f6e26f0ae773d42"
      , "280b10153a522681163658cb49f632cde3f38d768b736ddbc901d99a1a772833"
      , "2a96b1889dc221c17296fcc2bb34b908ca9734376f0f361660200935916ef201"
      , "2c6c3627bd6c982990239487f1abd02e08a02e6cf16edb105a8012d444d870c3"
      , "51f0161b906011b52c6613376b1ae937670da69322113a246a09f807c62f6921"
      , "772e9f4c7db33d251d5c6e357199c819e569d130857dc225549b40845ff0890d"
      , "aa315286e6ad281ad61182235533c41e806e5a787e0b6d1e7eef3f09d137d2e9"
      , "fe331502606802feac15e514d9b9ea83fee8b6ffef71335479a2e68d84adc6b0"
      ]
    key-threshold: 3
- name: standard-hackage
  download-prefix: https://hackage.haskell.org/packages/
  http: https://hackage.haskell.org/
  hackage-security:
    keyids:
      [ "0a5c7ea47cd1b15f01f5f51a33adda7e655bc0f0b0615baa8e271f4c3351e21d"
      , "1ea9ba32c526d1cc91ab5e5bd364ec5e9e8cb67179a471872f6e26f0ae773d42"
      , "280b10153a522681163658cb49f632cde3f38d768b736ddbc901d99a1a772833"
      , "2a96b1889dc221c17296fcc2bb34b908ca9734376f0f361660200935916ef201"
      , "2c6c3627bd6c982990239487f1abd02e08a02e6cf16edb105a8012d444d870c3"
      , "51f0161b906011b52c6613376b1ae937670da69322113a246a09f807c62f6921"
      , "772e9f4c7db33d251d5c6e357199c819e569d130857dc225549b40845ff0890d"
      , "aa315286e6ad281ad61182235533c41e806e5a787e0b6d1e7eef3f09d137d2e9"
      , "fe331502606802feac15e514d9b9ea83fee8b6ffef71335479a2e68d84adc6b0"
      ]
    key-threshold: 3
- name: dream-hackage-mirror
  download-prefix: http://objects-us-west-1.dream.io/hackage-mirror/package/
  http: http://objects-us-west-1.dream.io/hackage-mirror/
  hackage-security:
    keyids:
      [ "0a5c7ea47cd1b15f01f5f51a33adda7e655bc0f0b0615baa8e271f4c3351e21d"
      , "1ea9ba32c526d1cc91ab5e5bd364ec5e9e8cb67179a471872f6e26f0ae773d42"
      , "280b10153a522681163658cb49f632cde3f38d768b736ddbc901d99a1a772833"
      , "2a96b1889dc221c17296fcc2bb34b908ca9734376f0f361660200935916ef201"
      , "2c6c3627bd6c982990239487f1abd02e08a02e6cf16edb105a8012d444d870c3"
      , "51f0161b906011b52c6613376b1ae937670da69322113a246a09f807c62f6921"
      , "772e9f4c7db33d251d5c6e357199c819e569d130857dc225549b40845ff0890d"
      , "aa315286e6ad281ad61182235533c41e806e5a787e0b6d1e7eef3f09d137d2e9"
      , "fe331502606802feac15e514d9b9ea83fee8b6ffef71335479a2e68d84adc6b0"
      ]
    key-threshold: 3

Not 100% sure what the value "keyids" should be. These are the keyids that
are used for the fpco mirror, and they seem to work fine with hackage /
dream.io.

This should probably be added to the documentation on haskellstack.org .
It shouldn't be directly inlined in the configuration docs, but definitely
the docs for "package-indices" should link to it -
https://docs.haskellstack.org/en/stable/yaml_configuration/#package-indices

We could also consider having stack default to using a set of mirrors like
this, for reliability.

@mgsloan mgsloan added this to the Support milestone Feb 16, 2018
@HuStmpHrrr
Copy link
Author

We could also consider having stack default to using a set of mirrors like
this, for reliability.

yeah, that will definitely be a wonderful idea. it's lots of suffering every time I setup haskell I will need to flip a coin to test my luck.

@mgsloan
Copy link
Contributor

mgsloan commented Feb 18, 2018 via email

@HuStmpHrrr
Copy link
Author

for now, it is best to avoid ctrl-C in the middle of an index update!

I am not sure it's just me or not cuz I cannot find any related issues, very often, stack download things at a much slower speed than what I would make in a browser, or even freezes. For instance, quite oftenly, downloading ghc binary might freeze, and it also happens for downloading indices as well(but I cannot tell since there is no progress indication). anyways, i don't know what can be done, but it's true that things do not seem quite stable.

@mgsloan
Copy link
Contributor

mgsloan commented Mar 5, 2018

Note that the mirrors json above had an error which I've corrected via an edit. The download-prefix field of fpco-hackage-mirror was missing a /.

@cblp
Copy link
Contributor

cblp commented Apr 17, 2018

Currently, Russia is blocking AWS and S3 from its own citizens. We can't use stack because of it.

@doofin
Copy link

doofin commented Jul 19, 2018

some chinese mirror is working https://mirror.tuna.tsinghua.edu.cn/help/stackage/

@Yu-zh
Copy link

Yu-zh commented Mar 30, 2019

some chinese mirror is working https://mirror.tuna.tsinghua.edu.cn/help/stackage/

Thanks! This mirror is awesome!

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

No branches or pull requests

6 participants