Mailinglist Archive: zypp-devel (116 mails)

< Previous Next >
Re: [zypp-devel] mirrorlist support in zypp?
  • From: Michael E Brown <Michael_E_Brown@xxxxxxxx>
  • Date: Wed, 6 Jun 2007 09:44:34 -0500
  • Message-id: <20070606144434.GB30401@xxxxxxxxxxxxxxxxxxx>
On Wed, Jun 06, 2007 at 10:05:43AM +0200, Duncan Mac-Vicar Prett wrote:
> On Wednesday 06 June 2007 07:57:36 Michael E Brown wrote:
> > 1) How do I set up a repomd (yum) format repository that is set up
> > using "mirrorlist=URL" in yum?
> 
> This is not supported in released versions, altough this is exactly what is 
> being developed.
> 
> > 2) How can I do variable substitution in a URL? I want to set up a
> > repomd repository (using mirrorlist function above) with a URL like:
> > mirrorlist=http://some.domain.com/repo/path/mirror.pl?osver=$releasever&osn
> >ame=sles Where "$releasever" is automatically replaced with the OS version.
> 
> You can't. Mirror list is not supported. And also variable substitution.
> 
> You can get the mirror list effect at the server level (configuring apache). 
> Just like software.opensuse.org works.

Mirrorlist functionality is a really useful capability. I dont see how
you could you could support millions of users without it. It allows you
to load balance between separate servers which may even have different
paths to the repo. It also enables you to do really cool things, like
have a cgi script that produces the mirror list. It can, for example,
return geographically-close mirror based on the users client IP.

> 
> > 3) How can I write a plugin to add (two) new variables in the
> > substitution process? I want to set up repositories that are specific to
> > dell system models and have a server-side cgi redirect the client to the
> > correct repo based on the system model. Something like:
> 
> You can't. I think it is the first time we get feedback like this, that can 
> actually be used to improve things.
>   
> The problem implementing these standards is that finding documentation is 
> really hard.
> 
> So basically we need to standarize. And you can help with that. What variables 
> are already allowed?

Out of the box, yum has three variables it will replace:
    - $basearch: i386, x86_64
    - $arch:     i386, i486, i586, i686, etc, x86_64
    - $releasever: OS version. ex: for opensuse 10.3, should == "10.3"

For the most part, $arch isnt usually used.

> 
> > mirrorlist=http://domain.com/repo/mirrors.pl?vendor=0x1028&model=0x0152&osn
> >ame=sles&osver=$releasever
> 
> What is model? What variables do you need appart of the ones YUM already 
> provides (which I also don't know)

I have written a small plugin to yum (iirc <50 LOC) to provide:
    - $sys_ven_id:  For Dell == "0x1028"
    - $sys_dev_id:  equal to the Dell model (uniquely assigned system
      id)

Each Dell system has a two-byte "system id", which uniquely identifies
that system model.

The utility of this is that I can distribute a single config (below).
Also, if a user moves hdd from system to system, the variables are
automatically updated to the new machine model ids.

mirrorlist=http://linux.dell.com/repo/hardware/mirrors.pl?sys_ven_id=$sys_ven_id&sys_dev_id=$sys_dev_id&osname=fc$releasever.$basearch&dellsysidpluginver=$dellsysidpluginver

Breaking this down:
    - mirrorlist=http://linux.dell.com/repo/hardware/mirrors.pl
        This is the CGI script that is the brains of the whole operation
        This cgi script uses the variables that follow to provide the
        client with the list of appropriate repo urls.
    - sys_ven_id=$sys_ven_id
        pass in the vendor ID as a cgi variable.
    - sys_dev_id=$sys_dev_id
        pass in system model so cgi can select the correct repository
    - osname=fc$releasever.$basearch
        and the correct os
    - dellsysidpluginver=$dellsysidpluginver
        This is mostly for auditing purposes.

--
Michael
-- 
To unsubscribe, e-mail: zypp-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-devel+help@xxxxxxxxxxxx

< Previous Next >