Hello,
Is kojira capable of creating static repos such as those at http://koji.fedoraproject.org/static-repos/ or is this achieved through some other means? Either way, would anyone be able to instruct me as to how it's done?
Thanks,
Brian Schubert Open System Solutions Rutgers University
Brian Schubert wrote:
Is kojira capable of creating static repos such as those at http://koji.fedoraproject.org/static-repos/ or is this achieved through some other means? Either way, would anyone be able to instruct me as to how it's done?
Short answer: not really, but it is not hard to accomplish yourself
Longer answer: kojira doesn't actually create repos at all. It tracks what repos are needed and whether they are current. When a repo is needed that does not exist, or when one is out of date, kojira creates a koji task asking the builders to create the repo.
Actually, the repos that are created by the process /are/ static, they just have a complicated path (involving the repo id and tag name). A koji repo, once created, remains the same until it is deleted. If tag content changes, a new repo will be created.
So, this term 'static-repo' is unfortunate. What folks really mean is 'slowly changing repo at a convenient location.' One way to get such a thing is to make a cronjob that periodically copies the current active repo for a tag to a fixed location.
On Tue, 2008-08-05 at 18:34 -0400, Mike McLean wrote:
So, this term 'static-repo' is unfortunate. What folks really mean is 'slowly changing repo at a convenient location.' One way to get such a thing is to make a cronjob that periodically copies the current active repo for a tag to a fixed location.
I chose the term as in a "static location to the latest repo".
Mike McLean wrote:
So, this term 'static-repo' is unfortunate. What folks really mean is 'slowly changing repo at a convenient location.' One way to get such a thing is to make a cronjob that periodically copies the current active repo for a tag to a fixed location.
Just saw this old post. Coincidentally, I recently patched my kojid (patch below) to create a symlink to the "latest" repo. Unless I'm missing something that's fundamentally wrong with this, it seems easier/better.
So I can now always get to the latest repo via /mnt/koji/repos/repo_tag/latest. Add this to kojiweb.conf: Alias /repos/ "/mnt/koji/repos/" <Directory "/mnt/koji/repos"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order allow,deny Allow from all </Directory>
And the "latest" can be had via http://koji.foo.com/repos/repo_tag/latest. Be sure to also add this to kojiweb.conf so that your packages can be found: Alias /packages/ "/mnt/koji/packages/" <Directory "/mnt/koji/packages"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order allow,deny Allow from all </Directory>
Cheers...Paul...
diff --git a/builder/kojid b/builder/kojid index 8b566a3..aab0f0b 100755 --- a/builder/kojid +++ b/builder/kojid @@ -2223,6 +2223,7 @@ class CreaterepoTask(BaseTaskHandler): raise koji.GenericError, "Repo %(id)s not in INIT state (got %(state)s)" % rinfo pathinfo = koji.PathInfo(options.topdir) toprepodir = pathinfo.repo(repo_id, rinfo['tag_name']) + latestrepolink = pathinfo.repo('latest', rinfo['tag_name']) repodir = "%s/%s" % (toprepodir, arch) groupdata = os.path.join(toprepodir, 'groups', 'comps.xml') if not os.path.isdir(repodir): @@ -2266,6 +2267,10 @@ class CreaterepoTask(BaseTaskHandler): files.append(f) session.uploadWrapper("%s/%s" % (datadir, f), uploadpath, f)
+ if os.path.lexists(latestrepolink): + os.unlink(latestrepolink) + os.symlink(toprepodir, latestrepolink) + return [uploadpath, files]
class WaitrepoTask(BaseTaskHandler):
Paul B Schroeder wrote:
Mike McLean wrote:
So, this term 'static-repo' is unfortunate. What folks really mean is 'slowly changing repo at a convenient location.' One way to get such a thing is to make a cronjob that periodically copies the current active repo for a tag to a fixed location.
Just saw this old post. Coincidentally, I recently patched my kojid (patch below) to create a symlink to the "latest" repo. Unless I'm missing something that's fundamentally wrong with this, it seems easier/better.
This shouldn't be done in kojid. Koji does not require the builders to have write access to the filesystem, but your patch assumes it.
My only worry is that the sometime rapid rate of repo regeneration might cause a problem for yum when the link changes at the wrong time. I guess it is probably ok though.
This should probably be handled in HostExports.repoDone on the hub. I've made a patch for that. Will test and push later.
Hmm, I should probably also make this configurable, since some admins might already have their own mechanism for creating such links (e.g. a cronjob).
So I can now always get to the latest repo via /mnt/koji/repos/repo_tag/latest. Add this to kojiweb.conf: Alias /repos/ "/mnt/koji/repos/" <Directory "/mnt/koji/repos"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order allow,deny Allow from all
</Directory>
Is multiviews needed? I don't see how it will help anything with the content that Koji generates here.
And the "latest" can be had via http://koji.foo.com/repos/repo_tag/latest. Be sure to also add this to kojiweb.conf so that your packages can be found: Alias /packages/ "/mnt/koji/packages/" <Directory "/mnt/koji/packages"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order allow,deny Allow from all
</Directory>
I don't see why FollowSymLinks is required for /mnt/koji/packages/
Mike McLean wrote:
Paul B Schroeder wrote:
Mike McLean wrote:
So, this term 'static-repo' is unfortunate. What folks really mean is 'slowly changing repo at a convenient location.' One way to get such a thing is to make a cronjob that periodically copies the current active repo for a tag to a fixed location.
Just saw this old post. Coincidentally, I recently patched my kojid (patch below) to create a symlink to the "latest" repo. Unless I'm missing something that's fundamentally wrong with this, it seems easier/better.
This shouldn't be done in kojid. Koji does not require the builders to have write access to the filesystem, but your patch assumes it.
Gotcha..
My only worry is that the sometime rapid rate of repo regeneration might cause a problem for yum when the link changes at the wrong time. I guess it is probably ok though.
I had thought about that actually, but then thought it may not be very likely to cause an issue. It's definitely not an issue for me as my repos aren't getting regenerated all to often (and I'm the only one really using them).
This should probably be handled in HostExports.repoDone on the hub. I've made a patch for that. Will test and push later.
Cool.. Thanks..
Hmm, I should probably also make this configurable, since some admins might already have their own mechanism for creating such links (e.g. a cronjob).
So I can now always get to the latest repo via /mnt/koji/repos/repo_tag/latest. Add this to kojiweb.conf: Alias /repos/ "/mnt/koji/repos/" <Directory "/mnt/koji/repos"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order allow,deny Allow from all
</Directory>
Is multiviews needed? I don't see how it will help anything with the content that Koji generates here.
And the "latest" can be had via http://koji.foo.com/repos/repo_tag/latest. Be sure to also add this to kojiweb.conf so that your packages can be found: Alias /packages/ "/mnt/koji/packages/" <Directory "/mnt/koji/packages"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order allow,deny Allow from all
</Directory>
I don't see why FollowSymLinks is required for /mnt/koji/packages/
I simply didn't look over the options I put in my kojiweb.conf too well. It may be worth having the proper config commented out in the kojiweb.conf file by default. Then when somebody installs, they can simply uncomment these and change the directory names if need be.
buildsys@lists.fedoraproject.org