You are viewing a plain text version of this content. The canonical link for it is here.
Posted to infrastructure-issues@apache.org by "Konstantin Gribov (JIRA)" <ji...@apache.org> on 2014/12/08 17:33:13 UTC
[jira] [Comment Edited] (INFRA-8753) Provide /dyn/closer.cgi-like
mirror suggester for in-script usage
[ https://issues.apache.org/jira/browse/INFRA-8753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14238034#comment-14238034 ]
Konstantin Gribov edited comment on INFRA-8753 at 12/8/14 4:33 PM:
-------------------------------------------------------------------
[~henp] suggested {{asjson=1}} parameter in {{closer.cgi}}.
So, as a workaround, you can use [http://www.apache.org/dyn/closer.cgi/lucene/solr/4.10.2/solr-4.10.2.tgz?asjson=1] to retrive info about closer and backup mirrors in json format:
{code:json}
{
"backup": [
"http://www.eu.apache.org/dist/",
"http://www.us.apache.org/dist/"
],
"ftp": [],
"http": [
"http://apache-mirror.rbc.ru/pub/apache/"
],
"location": "/dyn/closer.cgi",
"path_info": "lucene/solr/4.10.2/solr4.10.2.tgz",
"preferred": "http://apache-mirror.rbc.ru/pub/apache/"
}
{code}
I'm parsing it with grep+sed+awk in my case (building minimalistic container) but it's a little fragile. See [https://github.com/grossws/docker-comp-solr4/blob/0cd289a4d966605b248d37ab8e64df3d437f35ea/Dockerfile#L34].
was (Author: grossws):
[~henkp@cs.uu.nl] suggested {{asjson=1}} parameter in {{closer.cgi}}.
So, as a workaround, you can use [http://www.apache.org/dyn/closer.cgi/lucene/solr/4.10.2/solr-4.10.2.tgz?asjson=1] to retrive info about closer and backup mirrors in json format:
{code:json}
{
"backup": [
"http://www.eu.apache.org/dist/",
"http://www.us.apache.org/dist/"
],
"ftp": [],
"http": [
"http://apache-mirror.rbc.ru/pub/apache/"
],
"location": "/dyn/closer.cgi",
"path_info": "lucene/solr/4.10.2/solr4.10.2.tgz",
"preferred": "http://apache-mirror.rbc.ru/pub/apache/"
}
{code}
I'm parsing it with grep+sed+awk in my case (building minimalistic container) but it's a little fragile. See [https://github.com/grossws/docker-comp-solr4/blob/0cd289a4d966605b248d37ab8e64df3d437f35ea/Dockerfile#L34].
> Provide /dyn/closer.cgi-like mirror suggester for in-script usage
> -----------------------------------------------------------------
>
> Key: INFRA-8753
> URL: https://issues.apache.org/jira/browse/INFRA-8753
> Project: Infrastructure
> Issue Type: New Feature
> Components: Mirrors
> Reporter: Konstantin Gribov
> Priority: Minor
>
> Provide some script-friendly mirror suggester.
> As far as I know, now you can either parse user-friendly html page (fragile method) or download from specific mirror.
> I think, some cgi endpoint like closer.cgi which returns redirect to first suggested mirror by default would be good solution. To avoid dead-mirror case skip parameter (default 0, so the first mirror is returned) may be added to choose some less preferred mirror.
> Case arised from docker container building pattern, where some distro from apache in downloaded into container, unpacked, installed etc. Since I don't know what are the closest to the Docker Hub build farm mirrors are, I can either download from main site or specific mirror. Both choises are bad.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)